Skip to content

Commit

Permalink
fix: disconnection overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
SHolleworth committed Dec 13, 2024
1 parent 166419c commit 46b2cf8
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions packages/client/src/client/components/DisconnectionOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,20 @@ import {
useConnectionStatus,
} from "@/services/connection"

// TODO - Use component from styleguide when available
const Button = styled.button`
background-color: ${({ theme }) => theme.button.primary.backgroundColor};
color: #ffffff;
padding: 5px 9px;
border-radius: 4px;
font-size: 0.6875rem;
margin-top: 20px;
&:hover {
background-color: ${({ theme }) => theme.accents.primary.darker};
}
`
import { Button } from "./Button"
import { FlexBox } from "./FlexBox"
import { Typography } from "./Typography"

type DisconnectedStatus =
| ConnectionStatus.DISCONNECTED
| ConnectionStatus.IDLE_DISCONNECTED
| ConnectionStatus.OFFLINE_DISCONNECTED

const Wrapper = styled(FlexBox)`
flex-direction: column;
gap: ${({ theme }) => theme.newTheme.spacing.xl};
`

export const DisconnectionOverlayInner = ({
connectionStatus,
onReconnect,
Expand All @@ -38,10 +33,14 @@ export const DisconnectionOverlayInner = ({
}) => (
<Modal shouldShow>
{connectionStatus === ConnectionStatus.IDLE_DISCONNECTED ? (
<>
<p>You have been disconnected due to inactivity.</p>
<Button onClick={onReconnect}>Reconnect</Button>
</>
<Wrapper>
<Typography variant={"Text sm/Regular"}>
You have been disconnected due to inactivity.
</Typography>
<Button variant="outline" size="lg" onClick={onReconnect}>
Reconnect
</Button>
</Wrapper>
) : connectionStatus === ConnectionStatus.OFFLINE_DISCONNECTED ? (
"This device has been detected to be offline. Connection to the server will resume when a stable internet connection is established."
) : (
Expand Down

0 comments on commit 46b2cf8

Please sign in to comment.