Skip to content

Commit

Permalink
405 polling comments in option page (#428)
Browse files Browse the repository at this point in the history
* Modify text button disabled styles

* Add polling to comments every 5 seconds
  • Loading branch information
camilovegag authored Apr 30, 2024
1 parent db7fa6e commit 8f4c804
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/berlin/src/components/button/Button.styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,21 @@ export const StyledButton = styled.button<StyledButtonProps>`
${(props) =>
props.$variant === 'text' &&
css`
background-color: none;
background-color: transparent;
color: var(--color-black);
font-family: inherit;
font-size: inherit;
font-weight: inherit;
text-transform: inherit;
padding: 0;
&:disabled {
background-color: transparent;
user-select: none;
cursor: pointer;
&:hover {
opacity: 1;
}
}
`}
`;
1 change: 1 addition & 0 deletions packages/berlin/src/pages/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function Option() {
queryKey: ['comments', optionId],
queryFn: () => fetchComments({ optionId: optionId || '' }),
enabled: !!optionId,
refetchInterval: 5000, // Poll every 5 seconds
});

const sortedComments = comments?.sort((a, b) => {
Expand Down

0 comments on commit 8f4c804

Please sign in to comment.