Skip to content

Commit 101bbe3

Browse files
Merge branch 'main' of github.com:UniversityOfHelsinkiCS/gptwrapper
2 parents c745779 + 72a3384 commit 101bbe3

File tree

7 files changed

+49
-21
lines changed

7 files changed

+49
-21
lines changed

src/client/components/ChatV2/ChatBox.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,19 @@ export const ChatBox = ({
258258
</Tooltip>
259259
</Box>
260260

261-
<OutlineButtonBlack
262-
sx={{ display: { xs: 'block', lg: 'none' } }}
263-
startIcon={<SettingsIcon />}
264-
onClick={() => setChatLeftSidePanelOpen(true)}
265-
id="settings-button"
261+
<Tooltip
262+
arrow
263+
placement="top"
264+
title={
265+
<Typography variant="body2" sx={{ p: 1 }}>
266+
{t('chat:settings')}
267+
</Typography>
268+
}
266269
>
267-
{t('chat:settings')}
268-
</OutlineButtonBlack>
270+
<OutlineButtonBlack sx={{ display: { xs: 'block', lg: 'none' } }} onClick={() => setChatLeftSidePanelOpen(true)} id="settings-button">
271+
<SettingsIcon sx={{ color: 'rgba(0, 0, 0, 0.7)' }} />
272+
</OutlineButtonBlack>
273+
</Tooltip>
269274
<>
270275
{!notOptoutSaving && saveChat && (
271276
<FormControlLabel control={<Switch onChange={() => setSaveConsent(!saveConsent)} checked={saveConsent} />} label={t('chat:allowSave')} />

src/client/components/ChatV2/ChatV2.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { useIsEmbedded } from '../../contexts/EmbeddedContext'
3232
import { enqueueSnackbar } from 'notistack'
3333
import { useAnalyticsDispatch } from '../../stores/analytics'
3434
import EmailButton from './EmailButton'
35+
import { Tune } from '@mui/icons-material'
3536

3637
function useLocalStorageStateWithURLDefault(key: string, defaultValue: string, urlKey: string) {
3738
const [value, setValue] = useLocalStorageState(key, defaultValue)
@@ -570,7 +571,7 @@ const LeftMenu = ({
570571
</OutlineButtonBlack>
571572

572573
<EmailButton messages={messages} disabled={!messages?.length} />
573-
<OutlineButtonBlack startIcon={<SettingsIcon />} onClick={() => setSettingsModalOpen(true)} id="settings-button">
574+
<OutlineButtonBlack startIcon={<Tune />} onClick={() => setSettingsModalOpen(true)} id="settings-button">
574575
{t('chat:settings')}
575576
</OutlineButtonBlack>
576577
<OutlineButtonBlack startIcon={<HelpIcon />} onClick={() => setDisclaimerStatus(true)} id="help-button">

src/client/components/ChatV2/Disclaimer.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,22 @@ export const DisclaimerModal = ({
6363
transform: 'translate(-50%, -50%)',
6464
display: 'flex',
6565
flexDirection: 'column',
66-
minWidth: 600,
67-
width: '85vw',
68-
maxWidth: 1000,
69-
height: 'fit-content',
70-
maxHeight: '100vh',
66+
width: { xs: '95vw', sm: '85vw' },
67+
maxWidth: { xs: '95vw', sm: 1000 },
68+
minHeight: '25vh',
69+
maxHeight: { xs: '90vh', sm: '90vh' },
7170
bgcolor: 'background.paper',
7271
boxShadow: 24,
7372
borderRadius: '0.3rem',
7473
overflow: 'auto',
75-
padding: '3rem',
74+
padding: '2rem',
7675
}}
7776
>
78-
<IconButton id="close-disclaimer" onClick={() => closeAccepted()} sx={{ position: 'absolute', top: 10, right: 20, color: 'grey.500' }}>
77+
<IconButton
78+
id="close-disclaimer"
79+
onClick={() => closeAccepted()}
80+
sx={{ position: 'absolute', top: 10, right: 20, color: 'grey.500', display: termsAccepted ? '' : 'none' }}
81+
>
7982
<Close />
8083
</IconButton>
8184

src/client/components/ChatV2/EmailButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const EmailButton = ({ messages, disabled }: { messages: Message[]; disabled: bo
194194
}
195195

196196
return (
197-
<Tooltip placement="right" title={<Typography variant="body2">{t('chat:email', { email: user.email })}</Typography>}>
197+
<Tooltip placement="right" title={t('chat:email', { email: user.email })}>
198198
<OutlineButtonBlack startIcon={<EmailIcon />} onClick={handleSend}>
199199
{t('email:save')}
200200
</OutlineButtonBlack>

src/client/components/ChatV2/SettingsModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({
200200
<Typography variant="body1">{t('settings:temperatureInstructions')}</Typography>
201201

202202
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
203-
<Box sx={{ padding: '1.5rem 0' }}>
203+
<Box sx={{ padding: '1.5rem 0', width: '100%', maxWidth: 600 }}>
204204
<Slider
205-
sx={{ width: 800 }}
205+
sx={{ width: '100%' }}
206206
min={0.0}
207207
max={1.0}
208208
step={0.1}
@@ -245,7 +245,7 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({
245245
>
246246
{t('settings:resetDefault')}
247247
</OutlineButtonBlack>{' '}
248-
<BlueButton onClick={() => setOpen(false)}>{t('common:close')}</BlueButton>
248+
<BlueButton onClick={() => setOpen(false)}>OK</BlueButton>
249249
</Box>
250250
<SaveMyPromptModal
251251
isOpen={myPromptModalOpen}

src/client/components/Feedback.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,19 @@ export const Feedback: React.FC = () => {
4848

4949
return (
5050
<>
51-
<Tooltip title={t('feedback:giveFeedback')} placement="top">
51+
<Tooltip arrow title={t('feedback:giveFeedback')} placement="top">
5252
<Fab
5353
color="default"
5454
aria-label="feedback"
55-
sx={(theme) => ({ position: 'absolute', bottom: 80, right: 32, zIndex: theme.zIndex.modal + 1 })}
55+
sx={(theme) => ({
56+
position: 'fixed',
57+
bottom: { xs: 12, sm: 18 },
58+
right: { xs: 12, sm: 18 },
59+
zIndex: theme.zIndex.modal + 1,
60+
opacity: 0.9,
61+
62+
transition: 'opacity 0.2s',
63+
})}
5664
onClick={() => setModalOpen(true)}
5765
>
5866
<FeedbackIcon />

src/client/theme.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ const themeOptions: ThemeOptions = {
6363
},
6464
},
6565
},
66+
67+
MuiTooltip: {
68+
styleOverrides: {
69+
tooltip: {
70+
fontSize: '0.875rem',
71+
fontWeight: 400,
72+
lineHeight: 1.43,
73+
padding: '8px',
74+
},
75+
},
76+
},
6677
},
6778
}
6879

0 commit comments

Comments
 (0)