Skip to content

Commit

Permalink
feat(web): exam ics part 2 (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors authored Nov 2, 2023
1 parent 20ca9fc commit 9a97af7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-keys-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'web': minor
---

feat(web): exam ics improvement
18 changes: 12 additions & 6 deletions apps/web/src/modules/Schedule/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { createRef, useState } from 'react'
import { useTranslation } from 'react-i18next'

import GetAppRoundedIcon from '@mui/icons-material/GetAppRounded'
import { Button, Typography, useMediaQuery, useTheme } from '@mui/material'
import { observer } from 'mobx-react'

Expand Down Expand Up @@ -118,12 +119,17 @@ export const SchedulePage = observer(() => {
<InfoSpacer />
<ButtonBar>
{!isExamTable && <SaveImgButton imageRef={ref} />}
<Button variant="outlined" disabled>
{t('addToCalendar')}
</Button>
<Button variant="outlined" onClick={() => downloadExamSchedules(shopItems)}>
ตารางสอบ (.ics)
</Button>
{!isExamTable && (
<Button variant="outlined" disabled>
{t('addToCalendar')}
</Button>
)}
{isExamTable && (
<Button variant="outlined" onClick={() => downloadExamSchedules(shopItems)}>
<GetAppRoundedIcon />
ตารางสอบ (.ics)
</Button>
)}
<LinkWithAnalytics href={buildLink(`/schedule/cr11`)} passHref elementName={CR11_BUTTON}>
<Button style={{ marginRight: 0 }} variant="outlined">
{isDesktop ? t('showCR11') : t('showCR11Mobile')}
Expand Down

0 comments on commit 9a97af7

Please sign in to comment.