-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[POR-2200] Beginning work of making db dashboard look like app dashbo…
…ard (#4164) Co-authored-by: Stefan McShane <[email protected]>
- Loading branch information
1 parent
1ba29af
commit 4b9d46e
Showing
13 changed files
with
270 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, { useMemo } from "react"; | ||
import styled from "styled-components"; | ||
import { match } from "ts-pattern"; | ||
|
||
type StatusDotProps = { | ||
status: "available" | "pending" | "failing"; | ||
heightPixels?: number; | ||
}; | ||
|
||
const StatusDot: React.FC<StatusDotProps> = ({ status, heightPixels = 7 }) => { | ||
const color = useMemo(() => { | ||
return match(status) | ||
.with("available", () => "#38a88a") | ||
.with("pending", () => "#FFA500") | ||
.with("failing", () => "#ff0000") | ||
.exhaustive(); | ||
}, [status]); | ||
return <StyledStatusDot color={color} height={heightPixels} />; | ||
}; | ||
|
||
export default StatusDot; | ||
|
||
const StyledStatusDot = styled.div<{ color: string; height: number }>` | ||
min-width: ${(props) => props.height}px; | ||
max-width: ${(props) => props.height}px; | ||
height: ${(props) => props.height}px; | ||
border-radius: 50%; | ||
margin-right: 10px; | ||
background: ${(props) => props.color}; | ||
box-shadow: 0 0 0 0 rgba(0, 0, 0, 1); | ||
transform: scale(1); | ||
animation: pulse 2s infinite; | ||
@keyframes pulse { | ||
0% { | ||
transform: scale(0.95); | ||
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7); | ||
} | ||
70% { | ||
transform: scale(1); | ||
box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); | ||
} | ||
100% { | ||
transform: scale(0.95); | ||
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.