Skip to content

Commit

Permalink
fix: #3964 which is erroring locally
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Oct 28, 2024
1 parent 1132134 commit 5b8b1bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface IconCountWithTooltipProps {

export const IconCountWithTooltip = (props: IconCountWithTooltipProps) => {
const { count, dataCy, icon, text } = props
const id = useMemo(() => crypto.randomUUID(), [])
const id = useMemo(() => (Math.random() * 16).toString(), [])

return (
<>
Expand Down
30 changes: 12 additions & 18 deletions src/pages/Question/QuestionListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ export const QuestionListItem = ({ question, query }: IProps) => {
data-id={question._id}
sx={{
position: 'relative',
border: 'none',
borderBottom: '2px solid #cccccc',
borderRadius: 0,
border: 0,
overflow: 'hidden',
}}
>
<Flex
Expand Down Expand Up @@ -125,21 +124,16 @@ export const QuestionListItem = ({ question, query }: IProps) => {
paddingX: 12,
}}
>
<Box>
<IconCountWithTooltip
count={(votedUsefulBy || []).length}
icon="star-active"
text={listing.usefulness}
/>
</Box>

<Box>
<IconCountWithTooltip
count={(question as any).commentCount || 0}
icon="comment"
text={listing.totalComments}
/>
</Box>
<IconCountWithTooltip
count={(votedUsefulBy || []).length}
icon="star-active"
text={listing.usefulness}
/>
<IconCountWithTooltip
count={(question as any).commentCount || 0}
icon="comment"
text={listing.totalComments}
/>
</Flex>
</Flex>

Expand Down
5 changes: 4 additions & 1 deletion src/pages/Question/QuestionListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ export const QuestionListing = () => {
marginBottom: 5,
border: '2px solid black',
borderRadius: 5,
overflowX: 'hidden',
background: 'lightGrey',
display: 'flex',
flexDirection: 'column',
gap: '2px',
}}
>
{questions.map((question, index) => (
Expand Down

0 comments on commit 5b8b1bb

Please sign in to comment.