Skip to content

Commit 48464a5

Browse files
committed
disable maxWidth on chatV2
1 parent 39d44e1 commit 48464a5

File tree

12 files changed

+41
-44
lines changed

12 files changed

+41
-44
lines changed

src/client/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const App = () => {
9999
<AppContext.Provider value={appRef}>
100100
<Box minHeight="100vh" display="flex" flexDirection="column" ref={appRef}>
101101
<NavBar />
102-
<Container component="main" sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
102+
<Container component="main" maxWidth={false}>
103103
<Outlet />
104104
</Container>
105105
<Footer />

src/client/components/Admin/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Box, Tabs, Tab, Typography } from '@mui/material'
2+
import { Container, Box, Tabs, Tab, Typography } from '@mui/material'
33
import { useTranslation } from 'react-i18next'
44
import { Route, Routes, Link, matchPath, useLocation, Navigate } from 'react-router-dom'
55
import { get } from 'lodash'
@@ -33,7 +33,7 @@ const Admin = () => {
3333
const lastRestart = format(new Date(user?.lastRestart), 'dd/MM/yyyy HH.mm.ss')
3434

3535
return (
36-
<Box>
36+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
3737
<Box m={2}>
3838
<Typography variant="body1">
3939
{t('admin:lastUpdate')}
@@ -57,7 +57,7 @@ const Admin = () => {
5757
<Route path="/edit-texts" element={<EditTexts />} />
5858
<Route path="/usersearch" element={<UserSearch />} />
5959
</Routes>
60-
</Box>
60+
</ Container>
6161
)
6262
}
6363

src/client/components/Chat/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useRef, useEffect } from 'react'
2-
import { Alert, Box, Typography, Slider } from '@mui/material'
2+
import { Alert, Box, Typography, Slider, Container } from '@mui/material'
33
import { useTranslation } from 'react-i18next'
44
import { useParams } from 'react-router-dom'
55

@@ -350,7 +350,8 @@ const Chat = () => {
350350
}
351351

352352
return (
353-
<Box>
353+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
354+
354355
<Banner disclaimer={disclaimer} />
355356
{course && <CourseInfo course={course} />}
356357
<Box sx={{ mb: 3 }} />
@@ -420,7 +421,7 @@ const Chat = () => {
420421
max={1}
421422
/>
422423
</Box>
423-
</Box>
424+
</Container>
424425
)
425426
}
426427

src/client/components/Chats/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, TableContainer, TableBody, TableCell, TableHead, TableRow, Paper, Typography, Table } from '@mui/material'
1+
import { Box, TableContainer, TableBody, TableCell, TableHead, TableRow, Paper, Typography, Table, Container } from '@mui/material'
22
import { useTranslation } from 'react-i18next'
33
import useCurrentUser from '../../hooks/useCurrentUser'
44
import { formatDate } from '../Courses/util'
@@ -34,7 +34,7 @@ const Chats = () => {
3434
}
3535

3636
return (
37-
<div>
37+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
3838
<h2>{t('chats:header')}</h2>
3939

4040
<Box my={2}>
@@ -87,7 +87,7 @@ const Chats = () => {
8787
</Table>
8888
</TableContainer>
8989
</Box>
90-
</div>
90+
</Container>
9191
)
9292
}
9393

src/client/components/Courses/Course/Discussion.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useParams } from 'react-router-dom'
22
import { useTranslation } from 'react-i18next'
3-
import { Box, Paper, Divider } from '@mui/material'
3+
import { Box, Paper, Divider, Container } from '@mui/material'
44
import { Person, Assistant } from '@mui/icons-material'
55
import ReactMarkdown from 'react-markdown'
66
import remarkGfm from 'remark-gfm'
@@ -62,7 +62,7 @@ const Discussion = () => {
6262
if (!course || courseLoading || !messages || usageLoading || isUserLoading || !user) return null
6363

6464
return (
65-
<div>
65+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
6666
<h2>{course.name[language]}</h2>
6767

6868
<div>student: {user_id}</div>
@@ -72,7 +72,7 @@ const Discussion = () => {
7272
<Message key={u.id} message={u} />
7373
))}
7474
</div>
75-
</div>
75+
</Container>
7676
)
7777
}
7878

src/client/components/Courses/Course/index.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react'
2-
import { Box, Paper, Typography, Button, Modal, Checkbox, FormControlLabel, Input, Alert, Tooltip } from '@mui/material'
2+
import { Box, Paper, Typography, Button, Modal, Checkbox, FormControlLabel, Input, Alert, Tooltip, Container } from '@mui/material'
33
import { OpenInNew, Edit } from '@mui/icons-material'
44
import { enqueueSnackbar } from 'notistack'
55
import { useTranslation } from 'react-i18next'
@@ -143,13 +143,7 @@ const Course = () => {
143143
}
144144

145145
return (
146-
<Box
147-
sx={{
148-
margin: '0 auto',
149-
width: '90%',
150-
padding: '5%',
151-
}}
152-
>
146+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
153147
<Alert severity={getInfoSeverity()}>
154148
<Typography variant="h6">{getInfoMessage()}</Typography>
155149
</Alert>
@@ -317,7 +311,7 @@ const Course = () => {
317311
<Box sx={{ mt: 2 }}>
318312
<Rag />
319313
</Box>
320-
</Box>
314+
</Container>
321315
)
322316
}
323317

src/client/components/Courses/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Box, Tab, Tabs, Typography } from '@mui/material'
2+
import { Box, Tab, Tabs, Typography, Container } from '@mui/material'
33
import { useTranslation } from 'react-i18next'
44
import useUserCourses from '../../hooks/useUserCourses'
55
import CourseList from './CourseList'
@@ -38,7 +38,7 @@ const Courses = () => {
3838
const activeCourses = courses.filter((course) => !course.isExpired)
3939

4040
return (
41-
<>
41+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
4242
<Box display="flex" gap={2}>
4343
<Typography variant="h5" display="inline" mb={1}>
4444
{t('common:courses')}
@@ -58,7 +58,7 @@ const Courses = () => {
5858
<CustomTabPanel value={value} index={2}>
5959
<CourseList courseUnits={ended} />
6060
</CustomTabPanel>
61-
</>
61+
</Container>
6262
)
6363
}
6464

src/client/components/NoAccess/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import { Box, Typography } from '@mui/material'
1+
import { Box, Container, Typography } from '@mui/material'
22
import { useTranslation } from 'react-i18next'
33

44
const NoAccess = () => {
55
const { t } = useTranslation()
66

77
return (
8-
<Box m={5} display="flex" justifyContent="center" flexDirection="column">
9-
<Typography mb={2} variant="h3">
10-
{t('error:noAccess')}
11-
</Typography>
12-
<Typography>{t('error:noAccessInfo')}</Typography>
13-
</Box>
8+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
9+
<Box m={5} display="flex" justifyContent="center" flexDirection="column">
10+
<Typography mb={2} variant="h3">
11+
{t('error:noAccess')}
12+
</Typography>
13+
<Typography>{t('error:noAccessInfo')}</Typography>
14+
</Box>
15+
</Container>
1416
)
1517
}
1618

src/client/components/Rag/Rag.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import { TextField, Button, Box, Typography, Table, TableHead, TableBody, TableRow, TableCell, Paper, Link } from '@mui/material'
2+
import { TextField, Button, Box, Typography, Table, TableHead, TableBody, TableRow, TableCell, Paper, Link, Container } from '@mui/material'
33
import apiClient from '../../util/apiClient'
44
import { useMutation } from '@tanstack/react-query'
55
import { useNavigate, Link as RouterLink, useParams } from 'react-router-dom'
@@ -23,7 +23,7 @@ const Rag: React.FC = () => {
2323
const [indexName, setIndexName] = useState('')
2424

2525
return (
26-
<Box sx={{ display: 'flex', gap: 2 }}>
26+
<Container sx={{ display: 'flex', gap: 2, mt: '4rem', mb: '10rem' }} maxWidth="xl">
2727
<Box>
2828
<Typography variant="h4" mb="1rem">
2929
RAG Indices
@@ -76,7 +76,7 @@ const Rag: React.FC = () => {
7676
</Paper>
7777
))}
7878
</Box>
79-
</Box>
79+
</Container>
8080
)
8181
}
8282

src/client/components/Rag/RagFile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'
22
import { useParams, Link as RouterLink } from 'react-router-dom'
33
import apiClient from '../../util/apiClient'
44
import type { RagFileAttributes } from '../../../server/db/models/ragFile'
5-
import { Link, Typography } from '@mui/material'
5+
import { Container, Link, Typography } from '@mui/material'
66
import { RagFileInfo } from './RagFileDetails'
77
import type { RagIndexAttributes } from '../../../server/db/models/ragIndex'
88
import { Chunk } from './Chunk'
@@ -27,7 +27,7 @@ export const RagFile: React.FC = () => {
2727
}
2828

2929
return (
30-
<>
30+
<Container sx={{ mt: '4rem', mb: '10rem' }} maxWidth="xl">
3131
<Link component={RouterLink} to={`/rag/${id}`}>
3232
Back to RAG Index
3333
</Link>
@@ -48,6 +48,6 @@ export const RagFile: React.FC = () => {
4848
}}
4949
/>
5050
)}
51-
</>
51+
</Container>
5252
)
5353
}

0 commit comments

Comments
 (0)