File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
backend/wiki_game_info/gamesdb
components/UI/DialogHandler/components/MessageBoxModal Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export async function getInfoFromGamesDB(
14
14
legendary : 'epic' ,
15
15
gog : 'gog' ,
16
16
hyperplay : 'hyperplay' ,
17
+ steam : 'steam' ,
17
18
sideload : undefined
18
19
}
19
20
const storeName = storeMap [ runner ]
Original file line number Diff line number Diff line change 1
1
import './index.css'
2
- import React from 'react'
2
+ import React , { ReactElement } from 'react'
3
3
import {
4
4
Dialog ,
5
5
DialogContent ,
@@ -13,7 +13,7 @@ import { Button } from '@hyperplay/ui'
13
13
14
14
interface MessageBoxModalProps {
15
15
title : string
16
- message : string
16
+ message : string | ReactElement
17
17
onClose : ( ) => void
18
18
buttons : Array < ButtonOptions >
19
19
type : DialogType
@@ -55,9 +55,11 @@ const MessageBoxModal: React.FC<MessageBoxModalProps> = function (props) {
55
55
{ t ( 'error' , 'Error' ) } :
56
56
</ div >
57
57
< div className = "errorDialog error-box" >
58
- { props . message . split ( '\n' ) . map ( ( line , key ) => {
59
- return < p key = { key } > { line } </ p >
60
- } ) }
58
+ { typeof props . message === 'string'
59
+ ? props . message . split ( '\n' ) . map ( ( line , key ) => {
60
+ return < p key = { key } > { line } </ p >
61
+ } )
62
+ : props . message }
61
63
</ div >
62
64
</ >
63
65
)
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
MetricsOptInStatus ,
11
11
DownloadManagerState
12
12
} from 'common/types'
13
+ import { ReactElement } from 'react'
13
14
14
15
export type Category =
15
16
| 'all'
@@ -75,7 +76,7 @@ export interface ContextType {
75
76
export type DialogModalOptions = {
76
77
showDialog ?: boolean
77
78
title ?: string
78
- message ?: string | React . ReactNode
79
+ message ?: string | ReactElement
79
80
buttons ?: Array < ButtonOptions >
80
81
type ?: DialogType
81
82
onClose ?: ( ) => void
You can’t perform that action at this time.
0 commit comments