Skip to content

Commit

Permalink
fix(type style): fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtim committed Nov 1, 2022
1 parent cadc123 commit 3cb855f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
5 changes: 3 additions & 2 deletions components/PetsMap/PetMiniDetailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ const PetMiniDetailCard: React.FC<Props> = ({ id, name, description, picture_url
'https://images-na.ssl-images-amazon.com/images/I/71+mDoHG4mL.png'
}
alt={name}
w="24"
h="24"
w="32"
h="auto"
objectFit="cover"
onClick={onClick}
/>

Expand Down
12 changes: 6 additions & 6 deletions components/pets/InterestedTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Table from 'components/global/Table'
import TextLink from 'components/global/TextLink'
import { internalPages } from 'config'
import { InterestedPet } from 'interfaces/interested'
import { ParseDateTime } from 'libs/date'
// import { ParseDateTime } from 'libs/date'
import { CellProps, Column } from 'react-table'
import InterestedStepTag from './InterestedStepTag'

Expand Down Expand Up @@ -32,11 +32,11 @@ const columns: Column<InterestedPet>[] = [
accessor: 'description',
Header: <Text>รายละเอียด</Text>,
},
{
accessor: 'created_at',
Header: <Text>ลงทะเบียนเมื่อ</Text>,
Cell: ({ row }: CellProps<InterestedPet>) => <>{ParseDateTime(row.original.created_at)}</>,
},
// {
// accessor: 'created_at',
// Header: <Text>ลงทะเบียนเมื่อ</Text>,
// Cell: ({ row }: CellProps<InterestedPet>) => <>{ParseDateTime(row.original.created_at)}</>,
// },
]

const InterestedTable: React.FC<Props> = ({ pets }) => <Table data={pets} columns={columns} />
Expand Down
2 changes: 1 addition & 1 deletion pages/find/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
return {
props: {
...(await serverSideTranslations(ctx.locale || 'us', ['common', 'pet'])),
pets: pets.filter(pet => pet.status === Status.NEW) || [],
pets: pets?.filter(pet => pet.status === Status.NEW) || [],
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions pages/pets/[pet_id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const PetDetails: NextPage<UserProps & Props> = ({ user, pet, shelter, createdAt
</Flex>
)}
{!user?.is_org && (
<Flex>
<Flex gap={2}>
<Button colorScheme="blue" onClick={onClickLike} leftIcon={<StarIcon />}>
{isLiked ? 'ยกเลิกถูกใจ' : 'ถูกใจ'}
</Button>
Expand Down Expand Up @@ -121,7 +121,7 @@ const PetDetails: NextPage<UserProps & Props> = ({ user, pet, shelter, createdAt
</Stack>
<Divider />

<Text>พบเมื่อ {createdAt}</Text>
<Text>ลงทะเบียนเมื่อ {createdAt}</Text>

<Flex w="100%" h="100%">
<StaticMap lat={pet.lat} lng={pet.lng} />
Expand Down
2 changes: 1 addition & 1 deletion pages/pets/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PetNewPage: NextPage<UserProps & Props> = ({ user, tags }) => {
<Navbar user={user} />
<Center flexDir="column" gap={2} p={4}>
<Heading>ลงทะเบียนสัตว์เลี้ยง</Heading>
<PetRegisterCard onSubmitRegister={onSubmit} tags={tags} />
<PetRegisterCard onSubmitRegister={onSubmit} tags={tags} defaultValues={{ lat: user?.lat, lng: user?.lng }} />
</Center>
</PageLayout>
)
Expand Down
2 changes: 2 additions & 0 deletions pages/shelters/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const ShelterDetails: NextPage<UserProps & Props> = ({ user, shelter, pets, crea
<Heading>{shelter?.name}</Heading>
</Flex>
<SimpleGrid columns={2} spacing={1} h="auto">
<Text>รายละเอียด</Text>
<Text>{shelter.description || '-'}</Text>
<Text>อีเมล</Text>
<TextLink title={shelter.email} to={`mailto:${shelter.email}`} text={`${shelter.email}` || '-'} />

Expand Down

1 comment on commit 3cb855f

@vercel
Copy link

@vercel vercel bot commented on 3cb855f Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

be-friends – ./

be-friends.vercel.app
be-friends-cjtim.vercel.app
be-friends-git-master-cjtim.vercel.app

Please sign in to comment.