Skip to content

Commit 9a78740

Browse files
committed
fix: initial render glitch, rm isDesktop boolean
1 parent 8698f1a commit 9a78740

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

src/components/FileContributors.tsx

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
ModalBody,
1010
ModalHeader,
1111
UnorderedList,
12-
useBreakpointValue,
1312
VStack,
1413
} from "@chakra-ui/react"
1514

@@ -60,8 +59,6 @@ const FileContributors = ({
6059
const [isModalOpen, setModalOpen] = useState(false)
6160
const { locale } = useRouter()
6261

63-
const isDesktop = useBreakpointValue({ base: false, md: true })
64-
6562
const lastContributor: FileContributor = contributors.length
6663
? contributors[0]
6764
: ({
@@ -99,28 +96,22 @@ const FileContributors = ({
9996
p={{ base: 0, md: 2 }}
10097
{...props}
10198
>
102-
<Flex me={4} alignItems="center" flex="1">
103-
{isDesktop && (
104-
<>
105-
<Avatar
106-
height="40px"
107-
width="40px"
108-
src={lastContributor.avatar_url}
109-
name={lastContributor.login}
110-
me={2}
111-
/>
112-
113-
<Text m={0} color="text200">
114-
<Translation id="last-edit" />:{" "}
115-
<InlineLink
116-
href={"https://github.com/" + lastContributor.login}
117-
>
118-
@{lastContributor.login}
119-
</InlineLink>
120-
, {getLocaleTimestamp(locale as Lang, lastEdit)}
121-
</Text>
122-
</>
123-
)}
99+
<Flex me={4} alignItems="center" flex="1" hideBelow="md">
100+
<Avatar
101+
height="40px"
102+
width="40px"
103+
src={lastContributor.avatar_url}
104+
name={lastContributor.login}
105+
me={2}
106+
/>
107+
108+
<Text m={0} color="text200">
109+
<Translation id="last-edit" />:{" "}
110+
<InlineLink href={"https://github.com/" + lastContributor.login}>
111+
@{lastContributor.login}
112+
</InlineLink>
113+
, {getLocaleTimestamp(locale as Lang, lastEdit)}
114+
</Text>
124115
</Flex>
125116

126117
<VStack align="stretch" justifyContent="space-between" spacing={2}>

0 commit comments

Comments
 (0)