Skip to content

Commit

Permalink
Merge pull request #62 from IFRCGo/fix/add-link
Browse files Browse the repository at this point in the history
Fix Link and admin1 details
  • Loading branch information
barshathakuri authored Apr 29, 2024
2 parents 1ee716e + a42df07 commit 0b6d0c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/views/AlertDetails/AlertInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
isTruthyString,
} from '@togglecorp/fujs';

import Link from '#components/Link';
import {
GetAreaAlertInfoQuery,
GetAreaAlertInfoQueryVariables,
Expand Down Expand Up @@ -235,7 +236,15 @@ function AlertInfo(props: Props) {
/>
<TextOutput
label={strings.alertInfoWeb}
value={data?.web}
value={isTruthyString(data?.web) && (
<Link
className={styles.alertInfoWebLink}
href={data.web}
external
>
{data.web}
</Link>
)}
strongValue
/>
<TextOutput
Expand Down
12 changes: 11 additions & 1 deletion src/views/AlertDetails/AlertMetadata/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { useTranslation } from '@ifrc-go/ui/hooks';
import {
_cs,
isFalsyString,
isTruthyString,
} from '@togglecorp/fujs';

import Link from '#components/Link';
import { AlertDetailsQuery } from '#generated/types/graphql';

import i18n from './i18n.json';
Expand Down Expand Up @@ -132,7 +134,15 @@ function AlertMetadata(props: Props) {
<MetaOutput
valueClassName={styles.url}
label={strings.alertMetaDataURL}
value={data?.url}
value={isTruthyString(data?.url) && (
<Link
className={styles.alertMetaDataUrl}
href={data.url}
external
>
{data.url}
</Link>
)}
/>
<MetaOutput
valueClassName={styles.references}
Expand Down

0 comments on commit 0b6d0c2

Please sign in to comment.