-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implemented questions table * fixed comment and added description for title field * fix lint
- Loading branch information
Showing
19 changed files
with
355 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/containers/my-resources/questions-container/QuestionsContainer.constants.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline' | ||
import Typography from '@mui/material/Typography' | ||
import Box from '@mui/material/Box' | ||
|
||
import IconTitleDescription from '~/components/icon-title-description/IconTitleDescription' | ||
import AppChip from '~/components/app-chip/AppChip' | ||
|
||
import { Question, RemoveColumnRules, SortEnum, TableColumn } from '~/types' | ||
import { getFormattedDate } from '~/utils/helper-functions' | ||
import { styles } from '~/containers/my-resources/questions-container/QuestionsContainer.styles' | ||
|
||
export const columns: TableColumn<Question>[] = [ | ||
{ | ||
label: 'myResourcesPage.questions.title', | ||
field: 'title', | ||
calculatedCellValue: (item: Question) => { | ||
return ( | ||
<IconTitleDescription | ||
description={'Which word is the antonym of "benevolent"?'} | ||
icon={ | ||
<Box sx={styles.iconWrapper}> | ||
<CheckCircleOutlineIcon /> | ||
</Box> | ||
} | ||
sx={styles.iconTitleDescription} | ||
title={item.title} | ||
/> | ||
) | ||
} | ||
}, | ||
{ | ||
label: 'myResourcesPage.questions.category', | ||
calculatedCellValue: () => ( | ||
<AppChip labelSx={styles.categoryChipLabel} sx={styles.categoryChip}> | ||
{'Vocabulary Building'} | ||
</AppChip> | ||
) | ||
}, | ||
{ | ||
label: 'myResourcesPage.questions.updated', | ||
field: 'updatedAt', | ||
calculatedCellValue: (item: Question) => ( | ||
<Typography sx={styles.date}> | ||
{getFormattedDate({ date: item.updatedAt })} | ||
</Typography> | ||
) | ||
} | ||
] | ||
|
||
export const removeColumnRules: RemoveColumnRules<Question> = { | ||
tablet: ['myOffersPage.tableHeaders.updated'] | ||
} | ||
|
||
export const initialSort = { order: SortEnum.Desc, orderBy: 'updatedAt' } | ||
|
||
export const itemsLoadLimit = { | ||
default: 10, | ||
tablet: 8, | ||
mobile: 6 | ||
} |
44 changes: 44 additions & 0 deletions
44
src/containers/my-resources/questions-container/QuestionsContainer.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import palette from '~/styles/app-theme/app.pallete' | ||
import { TypographyVariantEnum } from '~/types' | ||
|
||
export const styles = { | ||
iconTitleDescription: { | ||
container: { display: 'flex', columnGap: '16px', alignItems: 'center' }, | ||
icon: { | ||
svg: { width: '16px', height: '16px', color: 'primary.600' } | ||
}, | ||
titleWithDescription: { | ||
wrapper: { display: 'flex', flexDirection: 'column', rowGap: '3px' }, | ||
title: { | ||
typography: TypographyVariantEnum.Subtitle2, | ||
color: 'primary.900' | ||
}, | ||
description: { | ||
typography: TypographyVariantEnum.Caption, | ||
color: 'primary.400' | ||
} | ||
} | ||
}, | ||
iconWrapper: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
backgroundColor: 'basic.grey', | ||
borderRadius: '4px', | ||
p: '8px' | ||
}, | ||
categoryChip: { | ||
backgroundColor: 'inherit', | ||
border: `2px solid ${palette.basic.turquoiseDark}`, | ||
borderRadius: '50px', | ||
'& .MuiChip-label': { p: '0px 8px' } | ||
}, | ||
categoryChipLabel: { | ||
typography: TypographyVariantEnum.Caption, | ||
fontWeight: 500, | ||
color: 'basic.turquoiseDark' | ||
}, | ||
date: { | ||
color: 'primary.400', | ||
typography: TypographyVariantEnum.Caption | ||
} | ||
} |
91 changes: 90 additions & 1 deletion
91
src/containers/my-resources/questions-container/QuestionsContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.