Skip to content

Commit

Permalink
feat(MemberCard): add img header and change year format
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleNa1000 committed Feb 10, 2024
1 parent 722e9e8 commit 0de5a6c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/MemberCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Markdown, { MarkdownToJSX } from 'markdown-to-jsx'
import { CandidateCheckbox, CandidateCheckboxProps } from './CandidateCheckbox'
import { useRedText } from 'util/hooks'
import { ChevronDownIcon, ChevronUpIcon } from '@chakra-ui/icons'
import { academicYear } from 'util/constants'

type MemberCardProps = BoxProps &
Omit<CandidateCheckboxProps, 'index'> & {
Expand Down Expand Up @@ -81,6 +82,18 @@ export function MemberCard({
isParty={isParty}
cursor="pointer"
/>
<AspectRatio
overflow="hidden"
rounded="md"
width={['50px', '80px']}
ratio={1 / 1}
>
<Image
src={
member.avatar ? `${API_HOST}${member.avatar.url}` : undefined
}
/>
</AspectRatio>
</Stack>
{showDetail ? (
<ChevronUpIcon
Expand Down Expand Up @@ -226,7 +239,7 @@ function CardHeader({
{member.name}
</Text>
<Text fontSize={['2xs', 'sm', 'md']} fontWeight="extraLight">
{member.department} ปี {member.year}
{member.department} ชั้นปีที่ {academicYear - member.year + 1}
</Text>
</Stack>
</Stack>
Expand Down

0 comments on commit 0de5a6c

Please sign in to comment.