Skip to content

Commit

Permalink
feat(web): 优化 issueList 样式
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyao27 committed Jul 6, 2022
1 parent 60079f4 commit ae787c6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
20 changes: 13 additions & 7 deletions packages/web/src/components/issueList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ const IssueList: FC<Props> = ({ issues }) => {
h="full"
overflowX="hidden"
overflowY="auto"
rounded="lg"
w="full"
>
{/* header */}
<ThemeBox
bg="gray"
border="1px"
borderColor="current"
display="flex"
px="2"
py="3"
overflow="hidden"
p="2"
rounded="lg"
>
<Box w="50%">
Message
Expand Down Expand Up @@ -69,18 +71,22 @@ const IssueList: FC<Props> = ({ issues }) => {
Users
</Center>
</ThemeBox>

{/* body */}
<Box>
{
issues.map(issue => (
<Flex
<ThemeBox
_hover={
{ bg: rowHoverBg }
}
border="1px"
borderColor="current"
borderTop="none"
borderX="none"
display="flex"
key={issue.id}
px="2"
py="3"
rounded="sm"
>
{/* main */}
<Box w="50%">
Expand Down Expand Up @@ -173,7 +179,7 @@ const IssueList: FC<Props> = ({ issues }) => {
<Center w="20">
{issue._count?.users}
</Center>
</Flex>
</ThemeBox>
))
}
</Box>
Expand Down
41 changes: 22 additions & 19 deletions packages/web/src/pages/[projectId]/issues/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useSWR from 'swr'
import IssueList from '~/components/issueList'
import Loading from '~/components/loading'
import Pagination from '~/components/pagination'
import ThemeBox from '~/components/themeBox'
import Wrapper from '~/components/wrapper'
import useCurrentProject from '~/hooks/useCurrentProject'

Expand All @@ -15,25 +16,27 @@ const Issues: NextPage = () => {
const loading = useMemo(() => !issues, [issues])

return (
<Wrapper>
{
loading
? <Loading />
: (
<>
<IssueList
issues={issues}
/>
<Pagination
mt="6"
onChange={page => setPage(page)}
page={page}
total={total}
/>
</>
)
}
</Wrapper>
<ThemeBox bg="current">
<Wrapper>
{
loading
? <Loading />
: (
<>
<IssueList
issues={issues}
/>
<Pagination
mt="6"
onChange={page => setPage(page)}
page={page}
total={total}
/>
</>
)
}
</Wrapper>
</ThemeBox>
)
}

Expand Down

0 comments on commit ae787c6

Please sign in to comment.