1
- import React , { useCallback , useEffect , useState } from 'react'
1
+ import React , { useCallback , useContext , useEffect , useState } from 'react'
2
2
import cx from 'classnames'
3
3
import {
4
4
EuiTextColor ,
5
5
EuiText ,
6
6
EuiTitle ,
7
7
EuiLink ,
8
8
EuiButton ,
9
+ EuiIcon ,
9
10
} from '@elastic/eui'
10
11
import { useSelector } from 'react-redux'
11
12
12
13
import { ReactComponent as MobileIcon } from 'uiSrc/assets/img/icons/mobile_module_not_loaded.svg'
13
14
import { ReactComponent as DesktopIcon } from 'uiSrc/assets/img/icons/module_not_loaded.svg'
15
+ import { ReactComponent as TelescopeDark } from 'uiSrc/assets/img/telescope-dark.svg'
16
+ import { ReactComponent as TelescopeLight } from 'uiSrc/assets/img/telescope-light.svg'
14
17
import { ReactComponent as CheerIcon } from 'uiSrc/assets/img/icons/cheer.svg'
15
- import { MODULE_NOT_LOADED_CONTENT as CONTENT , MODULE_TEXT_VIEW } from 'uiSrc/constants'
18
+ import { MODULE_NOT_LOADED_CONTENT as CONTENT , MODULE_TEXT_VIEW , Theme } from 'uiSrc/constants'
16
19
import { RedisDefaultModules , OAuthSocialSource } from 'uiSrc/slices/interfaces'
17
20
import { OAuthConnectFreeDb , OAuthSsoHandlerDialog } from 'uiSrc/components'
18
21
import { freeInstanceSelector } from 'uiSrc/slices/instances/instances'
22
+ import { ThemeContext } from 'uiSrc/contexts/themeContext'
19
23
20
24
import styles from './styles.module.scss'
21
25
@@ -51,6 +55,7 @@ const ListItem = ({ item }: { item: string }) => (
51
55
const ModuleNotLoaded = ( { moduleName, id, type = 'workbench' , onClose } : IProps ) => {
52
56
const [ width , setWidth ] = useState ( 0 )
53
57
const freeInstance = useSelector ( freeInstanceSelector )
58
+ const { theme } = useContext ( ThemeContext )
54
59
55
60
const module = MODULE_TEXT_VIEW [ moduleName ]
56
61
@@ -78,8 +83,8 @@ const ModuleNotLoaded = ({ moduleName, id, type = 'workbench', onClose }: IProps
78
83
{ `Create a free Redis Stack database with ${ moduleName } which extends the core capabilities of open-source Redis` }
79
84
</ EuiText >
80
85
) : (
81
- < EuiText className = { cx ( styles . text , styles . marginBottom ) } >
82
- Use your Redis Stack database in Redis Enterprise Cloud to start exploring these capabilities.
86
+ < EuiText className = { cx ( styles . text , styles . marginBottom , styles . textFooter ) } >
87
+ Use your free all-in-one Redis Enterprise Cloud database to start exploring these capabilities.
83
88
</ EuiText >
84
89
) ) , [ freeInstance ] )
85
90
@@ -95,9 +100,18 @@ const ModuleNotLoaded = ({ moduleName, id, type = 'workbench', onClose }: IProps
95
100
>
96
101
< div className = { styles . flex } >
97
102
< div >
98
- { width > MAX_ELEMENT_WIDTH
99
- ? < DesktopIcon className = { styles . bigIcon } />
100
- : < MobileIcon className = { styles . icon } /> }
103
+ { type !== 'browser' && (
104
+ width > MAX_ELEMENT_WIDTH
105
+ ? < DesktopIcon className = { styles . bigIcon } />
106
+ : < MobileIcon className = { styles . icon } />
107
+ ) }
108
+ { type === 'browser' && (
109
+ < EuiIcon
110
+ className = { styles . iconTelescope }
111
+ type = { theme === Theme . Dark ? TelescopeDark : TelescopeLight }
112
+ size = "original"
113
+ />
114
+ ) }
101
115
</ div >
102
116
< div className = { styles . contentWrapper } >
103
117
{ renderTitle ( width , module ) }
0 commit comments