From 8f4c804197b081433821a967eb39d26f57480eb9 Mon Sep 17 00:00:00 2001 From: Camilo Vega <59750365+camilovegag@users.noreply.github.com> Date: Tue, 30 Apr 2024 07:52:53 -0500 Subject: [PATCH] 405 polling comments in option page (#428) * Modify text button disabled styles * Add polling to comments every 5 seconds --- .../berlin/src/components/button/Button.styled.tsx | 11 ++++++++++- packages/berlin/src/pages/Option.tsx | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/berlin/src/components/button/Button.styled.tsx b/packages/berlin/src/components/button/Button.styled.tsx index 05f0b579..f15e4667 100644 --- a/packages/berlin/src/components/button/Button.styled.tsx +++ b/packages/berlin/src/components/button/Button.styled.tsx @@ -50,12 +50,21 @@ export const StyledButton = styled.button` ${(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; + } + } `} `; diff --git a/packages/berlin/src/pages/Option.tsx b/packages/berlin/src/pages/Option.tsx index 64a0e21e..beda7b3d 100644 --- a/packages/berlin/src/pages/Option.tsx +++ b/packages/berlin/src/pages/Option.tsx @@ -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) => {