Skip to content

Commit

Permalink
🐛 fix(hydration): fix nextjs hydration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thrownullexception committed May 3, 2024
1 parent cddc99c commit a5ca4eb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/frontend/components/ApplicationRoot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ export function ApplicationRoot({
translation?: Messages;
}) {
return (
<LinguiProvider translation={translation}>
<QueryProvider>
<PortalProvider>
<ThemeContextProvider>
<LinguiProvider translation={translation}>
<QueryProvider>
<Toaster />
<GlobalStyles />
<ThemeContextProvider>{children}</ThemeContextProvider>
<ConfirmAlert />
</PortalProvider>
<GoogleTagManager />
</QueryProvider>
</LinguiProvider>
<PortalProvider>{children}</PortalProvider>
<GoogleTagManager />
</QueryProvider>
</LinguiProvider>
</ThemeContextProvider>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ const Lds = styled.div`
}
`;

const Root = styled.div`
text-align: center;
margin: 30px;
margin-bottom: 20px;
`;

export function ComponentIsLoading() {
return (
<div style={{ textAlign: "center", margin: "30px", marginBottom: "20px" }}>
<Root>
<LdsWrapper>
<Lds />
<Lds />
</LdsWrapper>
</div>
</Root>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const ChevronRight = styled(ChevronRightIcon)<{ $active?: boolean }>`
`;

const ListItem = styled.button<{
active: boolean;
disabled: boolean;
size?: "xs";
$active: boolean;
$disabled: boolean;
$size?: "xs";
}>`
justify-content: space-between;
align-items: center;
Expand Down Expand Up @@ -58,16 +58,16 @@ const ListItem = styled.button<{
border-top: 0;
}
${({ disabled }) =>
disabled &&
${({ $disabled }) =>
$disabled &&
css`
color: ${USE_ROOT_COLOR("muted-text")};
pointer-events: none;
background-color: ${USE_ROOT_COLOR("base-color")};
`}
${({ size }) =>
size === "xs" &&
${({ $size }) =>
$size === "xs" &&
css`
padding: 6px 0.75rem;
font-size: 12px;
Expand All @@ -81,8 +81,8 @@ const ListItem = styled.button<{
background-color: ${USE_ROOT_COLOR("soft-color")};
}
${({ active }) =>
active &&
${({ $active }) =>
$active &&
css`
z-index: 2;
color: ${USE_ROOT_COLOR("text-on-primary")} !important;
Expand Down Expand Up @@ -234,9 +234,9 @@ export function ListManagerItem({
);

const buttonProps = {
active: !!active,
disabled: !!disabled,
size,
$active: !!active,
$disabled: !!disabled,
$size: size,
};

if (typeof action === "string") {
Expand Down
4 changes: 2 additions & 2 deletions src/translations/locales/pseudo.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ msgid ""
msgstr ""

msgid "[[ name ]] is an invalid date"
msgstr "[[ name ]] is an invalid date"
msgstr ""

msgid "[[ name ]] is an invalid email"
msgstr "[[ name ]] is an invalid email"
msgstr ""

msgid "[[ name ]] is an invalid json"
msgstr ""
Expand Down

0 comments on commit a5ca4eb

Please sign in to comment.