diff --git a/src/assets/icons/alerthub_Logo.png b/src/assets/icons/alerthub_Logo.png new file mode 100644 index 00000000..117d5628 Binary files /dev/null and b/src/assets/icons/alerthub_Logo.png differ diff --git a/src/assets/icons/alerthub_api.svg b/src/assets/icons/alerthub_api.svg new file mode 100644 index 00000000..1002f39b --- /dev/null +++ b/src/assets/icons/alerthub_api.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/views/Home/AlertsMap/index.tsx b/src/views/Home/AlertsMap/index.tsx index 3a8817fb..cf88bdce 100644 --- a/src/views/Home/AlertsMap/index.tsx +++ b/src/views/Home/AlertsMap/index.tsx @@ -7,19 +7,12 @@ import { gql, useQuery, } from '@apollo/client'; +import { ChevronRightLineIcon } from '@ifrc-go/icons'; import { - AddLineIcon, - ChevronRightLineIcon, -} from '@ifrc-go/icons'; -import { - Button, Container, InfoPopup, } from '@ifrc-go/ui'; -import { - useBooleanState, - useTranslation, -} from '@ifrc-go/ui/hooks'; +import { useTranslation } from '@ifrc-go/ui/hooks'; import { resolveToString } from '@ifrc-go/ui/utils'; import { isDefined, @@ -35,7 +28,6 @@ import { FilteredCountryListQueryVariables, } from '#generated/types/graphql'; import useFilterState from '#hooks/useFilterState'; -import NewSubscriptionModal from '#views/NewSubscriptionModal'; import AlertDataContext from '../AlertDataContext'; import AlertFilters from '../AlertFilters'; @@ -86,20 +78,12 @@ export function Component() { const strings = useTranslation(i18n); const alertFilters = useAlertFilters(); - const [showSubscriptionModal, { - setTrue: setShowSubscriptionModalTrue, - setFalse: setShowSubscriptionModalFalse, - }] = useBooleanState(false); - const { activeAdmin1Id, activeCountryId, activeAlertId, activeCountryDetails, activeAdmin1Details, - selectedUrgencyTypes, - selectedCertaintyTypes, - selectedSeverityTypes, } = useContext(AlertDataContext); // FIXME: We should remove useFilterState as we are not using any feature @@ -187,20 +171,6 @@ export function Component() { [totalAlertCount, activeCountryDetails, activeAdmin1Details, strings], ); - const defaultSubscription = useMemo(() => ({ - filterAlertUrgencies: selectedUrgencyTypes, - filterAlertCertainties: selectedCertaintyTypes, - filterAlertSeverities: selectedSeverityTypes, - filterAlertCountry: activeCountryId || '', - filterAlertAdmin1s: activeAdmin1Id ? [activeAdmin1Id] : [], - }), [ - selectedUrgencyTypes, - selectedSeverityTypes, - selectedCertaintyTypes, - activeCountryId, - activeAdmin1Id, - ]); - return ( - } > - {showSubscriptionModal && ( - - )} ({ - filterAlertUrgencies: selectedUrgencyTypes, - filterAlertCertainties: selectedCertaintyTypes, - filterAlertSeverities: selectedSeverityTypes, - filterAlertCategories: selectedCategoryTypes, - filterAlertCountry: activeCountryId || '', - filterAlertAdmin1s: activeAdmin1Id ? [activeAdmin1Id] : [], - }), [ - selectedUrgencyTypes, - selectedSeverityTypes, - selectedCertaintyTypes, - activeCountryId, - activeAdmin1Id, - selectedCategoryTypes, - ]); - return ( - } > - {showSubscriptionModal && ( - - )} -& Pick -& { - alert: string | undefined; - startDateFrom: string | undefined; - startDateTo: string | undefined; -}; + & Pick + & { + alert: string | undefined; + startDateFrom: string | undefined; + startDateTo: string | undefined; + }; type CombinedAlertFilterKey = ApplicableAlertFilterKey | 'alert' | 'startDateFrom' | 'startDateTo'; const filterKeys: CombinedAlertFilterKey[] = ['country', 'admin1', 'region', 'urgency', 'severity', 'category', 'certainty', 'alert', 'startDateTo', 'startDateFrom']; @@ -92,8 +103,8 @@ export function Component() { admin1: convertUrlQueryToId(urlValues.admin1), region: convertUrlQueryToId(urlValues.region), infos: (isDefined(category) - || isDefined(urgency) - || isDefined(severity) || isDefined(certainty)) + || isDefined(urgency) + || isDefined(severity) || isDefined(certainty)) ? ({ category, urgency, @@ -214,6 +225,20 @@ export function Component() { getFilterFieldSetterFn, ], ); + const defaultSubscription = useMemo(() => ({ + filterAlertUrgencies: alertContextValue.selectedUrgencyTypes, + filterAlertCertainties: alertContextValue.selectedCertaintyTypes, + filterAlertSeverities: alertContextValue.selectedSeverityTypes, + filterAlertCategories: alertContextValue.selectedCategoryTypes, + filterAlertCountry: alertContextValue.activeCountryId, + filterAlertAdmin1s: alertContextValue.activeAdmin1Id + ? [alertContextValue.activeAdmin1Id] : [], + }), [alertContextValue]); + + const [showSubscriptionModal, { + setTrue: setShowSubscriptionModalTrue, + setFalse: setShowSubscriptionModalFalse, + }] = useBooleanState(false); return ( @@ -225,15 +250,93 @@ export function Component() { infoContainerClassName={styles.tabSection} mainSectionClassName={styles.content} info={( - - - {strings.mapTabTitle} - - - {strings.tableTabTitle} - - + <> + + + + {strings.alertNewSubscription} + + )} + /> + + + + + {showSubscriptionModal && ( + + )} + + + {strings.alertApiReference} + + )} + /> + + + + + +
+ + + {strings.mapTabTitle} + + + {strings.tableTabTitle} + + +
+ )} + > diff --git a/src/views/Home/styles.module.css b/src/views/Home/styles.module.css index f21f003f..13e65d9f 100644 --- a/src/views/Home/styles.module.css +++ b/src/views/Home/styles.module.css @@ -7,7 +7,32 @@ .tab-section { display: flex; + flex-direction: column; + gap:var(--go-ui-spacing-xl); justify-content: center; + + .cards { + gap: var(--go-ui-spacing-xl); + + .card { + gap: var(--go-ui-spacing-lg); + border-radius: var(--go-ui-border-radius-lg); + box-shadow: var(--go-ui-box-shadow-md); + background-color: var(--go-ui-color-foreground); + overflow: auto; + + .cards-content { + display:flex; + align-items: center; + + .alert-image { + margin: 0 auto; + object-fit: contain; + height: 5rem; + } + } + } + } } .map-filter, @@ -16,4 +41,4 @@ flex-direction: column; gap: var(--go-ui-spacing-lg); } -} \ No newline at end of file +} diff --git a/src/views/Login/i18n.json b/src/views/Login/i18n.json index 98a1f050..f06d9a11 100644 --- a/src/views/Login/i18n.json +++ b/src/views/Login/i18n.json @@ -16,7 +16,7 @@ "loginButton":"Login", "loginDontHaveAccount":"Don’t have an account? {signUpLink}", "loginCreateAccountTitle":"Create new account", - "loginSignUp":"Sign up", + "loginRegister":"Register", "loginFailureMessage": "Failed to login!", "loginSuccessfully": "Logged in successfully!" } diff --git a/src/views/Login/index.tsx b/src/views/Login/index.tsx index 4d296cd7..88845e11 100644 --- a/src/views/Login/index.tsx +++ b/src/views/Login/index.tsx @@ -161,15 +161,15 @@ export function Component() { validate, ]); - const signupInfo = resolveToComponent( + const registerInfo = resolveToComponent( strings.loginDontHaveAccount, { - signUpLink: ( + registerLink: ( - {strings.loginSignUp} + {strings.loginRegister} ), }, @@ -232,7 +232,7 @@ export function Component() { {strings.loginButton}
- {signupInfo} + {registerInfo}