-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffda909
commit 322646b
Showing
10 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/modules/Dashboard/components/ActivityStatusChip/ActivityStatusChip.const.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,18 @@ | ||
import { Icons } from 'svgSprite'; | ||
import { ChipOwnProps } from '@mui/material'; | ||
|
||
import { ActivityAssignmentStatus } from 'api'; | ||
|
||
export const ActivityStatusColors: Record<ActivityAssignmentStatus, ChipOwnProps['color']> = { | ||
active: 'success', | ||
inactive: 'warning', | ||
hidden: 'warning', | ||
deleted: 'error', | ||
}; | ||
|
||
export const ActivityStatusIcons: Record<ActivityAssignmentStatus, Icons> = { | ||
active: 'check-outlined', | ||
inactive: 'cross-outlined', | ||
hidden: 'eye-hidden', | ||
deleted: 'trash', | ||
}; |
26 changes: 26 additions & 0 deletions
26
src/modules/Dashboard/components/ActivityStatusChip/ActivityStatusChip.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,26 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { ActivityAssignmentStatus } from 'api'; | ||
import { Chip, ChipShape, Svg, Tooltip } from 'shared/components'; | ||
import { StyledFlexTopCenter, variables } from 'shared/styles'; | ||
|
||
import { ActivityStatusColors, ActivityStatusIcons } from './ActivityStatusChip.const'; | ||
|
||
export const ActivityStatusChip = ({ status }: { status: ActivityAssignmentStatus }) => { | ||
const { t } = useTranslation('app'); | ||
|
||
return ( | ||
<Tooltip tooltipTitle={t(`activityStatus.${status}Tooltip`)} maxWidth="50rem"> | ||
<StyledFlexTopCenter> | ||
<Chip | ||
color={ActivityStatusColors[status]} | ||
size="small" | ||
icon={<Svg aria-hidden id={ActivityStatusIcons[status]} height={18} width={18} />} | ||
shape={ChipShape.Rounded} | ||
title={t(`activityStatus.${status}`)} | ||
sx={status === 'hidden' ? { backgroundColor: variables.palette.orange_light } : undefined} | ||
/> | ||
</StyledFlexTopCenter> | ||
</Tooltip> | ||
); | ||
}; |
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 @@ | ||
export * from './ActivityStatusChip'; |
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
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