Skip to content

Commit

Permalink
/materials page: Greatly improve the margins/padding. Make tighter. M…
Browse files Browse the repository at this point in the history
…ake ProjectFilesTable less likely to require horizontal scroll
  • Loading branch information
KastanDay committed May 15, 2024
1 parent 602b474 commit 8ff7394
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/components/UIUC-Components/EditCourseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ const EditCourseCard = ({
shadow="xs"
padding="none"
radius="xl"
style={{ maxWidth: '85%', width: '100%', marginTop: '4%' }}
// style={{ maxWidth: '85%', width: '100%', marginTop: '4%' }}
className="mt-[4%] w-[96%] md:w-[90%]"
>
<Flex direction={isSmallScreen ? 'column' : 'row'}>
<div
Expand Down
10 changes: 5 additions & 5 deletions src/components/UIUC-Components/MakeOldCoursePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const MakeOldCoursePage = ({
courseMetadata={metadata}
/>

<div className="flex w-[85%] flex-col items-center justify-center pb-8 pt-8">
<div className="flex w-[95%] flex-col items-center justify-center pb-8 pt-8 md:w-[90%] xl:w-[85%]">
{metadata && (
<>
<Blockquote
Expand Down Expand Up @@ -172,7 +172,7 @@ const MakeOldCoursePage = ({
</div>
{/* Course files header/background */}
<div
className="w-[90%] items-start rounded-2xl shadow-md shadow-purple-600"
className="w-[95%] items-start rounded-2xl shadow-md shadow-purple-600 md:w-[93%] xl:w-[85%]"
style={{ zIndex: 1, background: '#15162c' }}
>
<Flex direction="row" justify="space-between">
Expand All @@ -199,12 +199,12 @@ const MakeOldCoursePage = ({
</div>
</Flex>
</div>
<div className="w-[85%] pb-8 pt-8">
<div className="w-[95%] pb-8 pt-8 md:w-[90%] xl:w-[85%]">
<DocGroupsTable course_name={course_name} />
</div>

<div
className="w-[90%] items-start rounded-2xl shadow-md shadow-purple-600"
className="w-[95%] items-start rounded-2xl shadow-md shadow-purple-600 md:w-[93%] xl:w-[85%]"
style={{ zIndex: 1, background: '#15162c' }}
>
<Flex direction="row" justify="space-between">
Expand All @@ -231,7 +231,7 @@ const MakeOldCoursePage = ({
</div>
</Flex>
</div>
<div className="flex w-[85%] max-w-full flex-col items-center justify-center pb-2 pt-8">
<div className="flex w-[96%] max-w-full flex-col items-center justify-center pb-2 pt-8 md:w-[90%] xl:w-[85%]">
{metadata && (
<>
<Tabs
Expand Down
29 changes: 19 additions & 10 deletions src/components/UIUC-Components/ProjectFilesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
} from '~/hooks/docGroupsQueries'
import { LoadingSpinner } from './LoadingSpinner'
import { montserrat_heading } from 'fonts'
import { useMediaQuery } from '@mantine/hooks'

const useStyles = createStyles((theme) => ({}))

Expand Down Expand Up @@ -83,6 +84,7 @@ export function ProjectFilesTable({
})
const [errorModalOpened, setErrorModalOpened] = useState(false)
const [currentError, setCurrentError] = useState('')
const isSmallScreen = useMediaQuery('(max-width: 768px)')

const openModel = (open: boolean, error = '') => {
setErrorModalOpened(open)
Expand Down Expand Up @@ -421,13 +423,14 @@ export function ProjectFilesTable({
// readable_filename ? `${readable_filename}` : '',
render: ({ readable_filename }) =>
readable_filename ? (
<div style={{ wordWrap: 'break-word', maxWidth: '18vw' }}>
<div style={{ wordWrap: 'break-word' }} className="">
{readable_filename}
</div>
) : (
''
),
width: '18vw',
// width: '14vw',
width: isSmallScreen ? '35vw' : '14vw',
sortable: true,
filter: (
<TextInput
Expand Down Expand Up @@ -461,14 +464,14 @@ export function ProjectFilesTable({
title: 'URL',
render: ({ url }) =>
url ? (
<div style={{ wordWrap: 'break-word', maxWidth: '18vw' }}>
<div style={{ wordWrap: 'break-word', maxWidth: '14vw' }}>
{url}
</div>
) : (
''
),
sortable: true,
width: '18vw',
width: '14vw',
filter: (
<TextInput
label="URL"
Expand Down Expand Up @@ -501,14 +504,13 @@ export function ProjectFilesTable({
title: 'The Starting URL of Web Scraping',
render: ({ base_url }) =>
base_url ? (
<div style={{ wordWrap: 'break-word', maxWidth: '18vw' }}>
{base_url}
</div>
<div style={{ wordWrap: 'break-word' }}>{base_url}</div>
) : (
''
),
sortable: true,
width: '18vw',
// width: '10vw',
width: isSmallScreen ? '12vw' : '12vw',
filter: (
<TextInput
label="The Starting URL of Web Scraping"
Expand Down Expand Up @@ -540,8 +542,15 @@ export function ProjectFilesTable({
accessor: 'created_at',
title: 'Date created',
render: ({ created_at }) =>
created_at ? new Date(created_at).toLocaleString() : '',
width: 130,
created_at ? (
<div style={{ wordWrap: 'break-word' }}>
{new Date(created_at).toLocaleString()}
</div>
) : (
''
),
// width: 130,
width: isSmallScreen ? 60 : 130,
sortable: true,
// TODO: Think about how to allow filtering on date... need different UI to select date range
// filter: (
Expand Down

0 comments on commit 8ff7394

Please sign in to comment.