Skip to content

Commit

Permalink
fix: rename gened to genEd
Browse files Browse the repository at this point in the history
  • Loading branch information
new5558 committed Jan 29, 2021
1 parent ef0754a commit 39970aa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/AnnouncementCard/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const AnnouncementCardStory = () => {
)}
title={text('title', 'เปิดวิชาเรียนใหม่ 0201170 Military Science เสริมสร้างวินัยทหารในตัวคุณ')}
tags={array('tags', ['เปิดวิชา', 'เปิดวิชา'])}
geneds={array('geneds', [GenEd.HU, GenEd.IN]) as GenEd[]}
genEds={array('geneds', [GenEd.HU, GenEd.IN]) as GenEd[]}
body={text(
'body',
'เนื้อหาวิชา วิทยาการทหาร ยุทธศาสตร์ชาติ ประวัติศาสตร์การทหาร กองทัพบก กองทัพอากาศ กองทัพเรือ ...'
Expand Down
10 changes: 5 additions & 5 deletions src/components/AnnouncementCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export interface AnnouncementCardPropTypes {
imageURL: string
title: string
tags: string[]
geneds: GenEd[]
genEds: GenEd[]
body: string
}

const AnnouncementCard = ({ date, imageURL, title, tags, geneds, body }: AnnouncementCardPropTypes) => {
const AnnouncementCard = ({ date, imageURL, title, tags, genEds, body }: AnnouncementCardPropTypes) => {
const styles = useStyles()
const theme = useTheme<Theme>()

Expand All @@ -29,9 +29,9 @@ const AnnouncementCard = ({ date, imageURL, title, tags, geneds, body }: Announc
</Box>
))

const genedsComponents = geneds.map((gened) => (
<Box key={gened} mr={TAG_INNER_MARGIN}>
<GenEdChip category={gened} />
const genedsComponents = genEds.map((genEd) => (
<Box key={genEd} mr={TAG_INNER_MARGIN}>
<GenEdChip category={genEd} />
</Box>
))

Expand Down
2 changes: 1 addition & 1 deletion src/components/GenEdChip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface GenedChipPropsType {

const GenedChip = ({ category }: GenedChipPropsType) => {
const theme = useTheme<Theme>()
const { t } = useTranslation('gened')
const { t } = useTranslation('genEd')
const BACKGROUND_COLOR = theme.palette.background.paper
const color = genedColorMapper(category, theme)

Expand Down
4 changes: 2 additions & 2 deletions src/components/GenEdChip/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { GenEd } from '@/utils/types'
import { Theme } from '@material-ui/core'

export const genedColorMapper = (gened: GenEd, theme: Theme) =>
export const genedColorMapper = (genEd: GenEd, theme: Theme) =>
({
[GenEd.HU]: '#C7117F',
[GenEd.IN]: '#681A83',
[GenEd.SC]: theme.palette.secondaryRange[900],
[GenEd.SO]: '#4B991C',
[GenEd.NOT_GENED]: theme.palette.primary.main,
}[gened])
}[genEd])
2 changes: 1 addition & 1 deletion src/i18n/locales/th.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const navBar = {
signin: 'เข้าสู่ระบบ',
}

export const gened = {
export const genEd = {
[GenEd.HU]: 'หมวดมนุษย์',
[GenEd.IN]: 'หมวดสหฯ',
[GenEd.SC]: 'หมวดวิทย์',
Expand Down

0 comments on commit 39970aa

Please sign in to comment.