-
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.
- Loading branch information
1 parent
e9d781b
commit b21ef43
Showing
9 changed files
with
233 additions
and
145 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,6 @@ | ||
{ | ||
"namespace": "alertDetails", | ||
"strings": { | ||
"alertViewDetails": "View Details" | ||
} | ||
} |
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 { ChevronRightLineIcon } from '@ifrc-go/icons'; | ||
import { | ||
Button, | ||
Container, | ||
} from '@ifrc-go/ui'; | ||
import { useTranslation } from '@ifrc-go/ui/hooks'; | ||
|
||
import { AlertsInfoQuery } from '#generated/types'; | ||
Check failure on line 8 in src/views/AlertMap/AlertDetail/index.tsx GitHub Actions / Typecheck
|
||
|
||
import i18n from './i18n.json'; | ||
import styles from './styles.module.css'; | ||
|
||
type Alert = NonNullable<NonNullable<NonNullable<AlertsInfoQuery['public']>['alerts']>['items']>[number]; | ||
|
||
export interface Props { | ||
data: Alert; | ||
onExpandClick: (alertId: string | undefined) => void; | ||
} | ||
|
||
function AlertDetail(props: Props) { | ||
const { | ||
data, | ||
onExpandClick, | ||
} = props; | ||
|
||
const strings = useTranslation(i18n); | ||
|
||
return ( | ||
<Container | ||
className={styles.alertInfo} | ||
heading={data?.country.name ?? '--'} | ||
headerClassName={styles.alertListItem} | ||
headingLevel={5} | ||
key={data.countryId} | ||
headerDescription={data.infos.map((alert) => alert.event)} | ||
actions={( | ||
<Button | ||
name={data.countryId} | ||
onClick={onExpandClick} | ||
variant="tertiary" | ||
title={strings.alertViewDetails} | ||
> | ||
<ChevronRightLineIcon className={styles.icon} /> | ||
</Button> | ||
)} | ||
/> | ||
); | ||
} | ||
|
||
export default AlertDetail; |
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,32 @@ | ||
.alert-info { | ||
.alert-list-item { | ||
gap: 0; | ||
|
||
.icon { | ||
align-self: flex-end; | ||
font-size: var(--go-ui-height-icon-multiplier); | ||
}:hover { | ||
.icon { | ||
animation: wiggle var(--go-ui-duration-transition-slow) ease-in-out; | ||
} | ||
} | ||
} | ||
|
||
@keyframes wiggle { | ||
0% { | ||
transform: translateX(0); | ||
} | ||
|
||
25% { | ||
transform: translateX(-0.1rem); | ||
} | ||
|
||
50% { | ||
transform: translateX(0.1rem); | ||
} | ||
|
||
100% { | ||
transform: translateX(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
Oops, something went wrong.