-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: link atlas task counts to filtered tasks (#248) * feat: updated tasks count link to url object (#248) * feat: added progress indicator (#248) * feat: updated progress indicator (#248) * chore: updated findable-ui (#248) --------- Co-authored-by: Fran McDade <[email protected]>
- Loading branch information
Showing
7 changed files
with
107 additions
and
11 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
app/components/Table/components/TableCell/components/TaskCountsCell/taskCountsCell.styles.ts
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,13 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const Cell = styled.div` | ||
align-items: center; | ||
display: grid; | ||
gap: 4px; | ||
grid-auto-flow: column; | ||
justify-content: flex-start; | ||
.MuiCircularProgress-root { | ||
margin: 2px; | ||
} | ||
`; |
46 changes: 46 additions & 0 deletions
46
app/components/Table/components/TableCell/components/TaskCountsCell/taskCountsCell.tsx
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,46 @@ | ||
import { | ||
CircularProgress, | ||
CircularProgressProps, | ||
} from "@databiosphere/findable-ui/lib/components/common/Progress/components/CircularProgress/circularProgress"; | ||
import { | ||
Link, | ||
LinkProps, | ||
} from "@databiosphere/findable-ui/lib/components/Links/components/Link/link"; | ||
import { Cell } from "./taskCountsCell.styles"; | ||
|
||
export interface TaskCountsCellProps { | ||
label: LinkProps["label"]; | ||
url: LinkProps["url"]; | ||
value: CircularProgressProps["value"]; | ||
} | ||
|
||
export const TaskCountsCell = ({ | ||
label, | ||
url, | ||
value, | ||
}: TaskCountsCellProps): JSX.Element => { | ||
return ( | ||
<Cell> | ||
<CircularProgress | ||
color={getProgressColor(value)} | ||
size={16} | ||
thickness={6} | ||
value={value} | ||
variant="determinate" | ||
/> | ||
<Link {...{ label, url }} /> | ||
</Cell> | ||
); | ||
}; | ||
|
||
/** | ||
* Returns circular progress color. | ||
* @param value - Circular progress value. | ||
* @returns circular progress color. | ||
*/ | ||
function getProgressColor(value = 0): CircularProgressProps["color"] { | ||
if (value < 50) { | ||
return "warning"; | ||
} | ||
return "success"; | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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