Skip to content

Commit 113086a

Browse files
Fixed background color of file upload box in Chat configuration (#5132)
* Fixed background color of file upload box in Chat configuration * Refactor FileUpload to use useSelector for customization * lint fix --------- Co-authored-by: Henry Heng <[email protected]>
1 parent c17dd1f commit 113086a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/ui/src/ui-component/extended/FileUpload.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useDispatch } from 'react-redux'
1+
import { useDispatch, useSelector } from 'react-redux'
22
import { useState, useEffect } from 'react'
33
import PropTypes from 'prop-types'
44
import { enqueueSnackbar as enqueueSnackbarAction, closeSnackbar as closeSnackbarAction, SET_CHATFLOW } from '@/store/actions'
@@ -41,6 +41,7 @@ const availableFileTypes = [
4141

4242
const FileUpload = ({ dialogProps }) => {
4343
const dispatch = useDispatch()
44+
const customization = useSelector((state) => state.customization)
4445

4546
useNotifier()
4647

@@ -234,14 +235,18 @@ const FileUpload = ({ dialogProps }) => {
234235
<Box
235236
sx={{
236237
borderRadius: 2,
237-
border: '1px solid #e0e0e0',
238-
backgroundColor: '#fafafa',
238+
border: customization.isDarkMode ? '1px solid #424242' : '1px solid #e0e0e0',
239+
backgroundColor: customization.isDarkMode ? '#2d2d2d' : '#fafafa',
239240
padding: 3,
240241
marginBottom: 3,
241242
marginTop: 2
242243
}}
243244
>
244-
<Typography sx={{ fontSize: 16, fontWeight: 600, marginBottom: 2, color: '#424242' }}>PDF Configuration</Typography>
245+
<Typography
246+
sx={{ fontSize: 16, fontWeight: 600, marginBottom: 2, color: customization.isDarkMode ? '#ffffff' : '#424242' }}
247+
>
248+
PDF Configuration
249+
</Typography>
245250

246251
<Box>
247252
<Typography sx={{ fontSize: 14, fontWeight: 500, marginBottom: 1 }}>PDF Usage</Typography>

0 commit comments

Comments
 (0)