-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue 859] Add BetaAlert component and update its content (#869)
* Add a new `BetaAlert` component and update all pages to use it * Use a single instance of content strings for the alert (delete copies for each page) * Add alert to 404 page * Separate `sticky` concern from `FullWidthAlert` * Update alert content -- Closes #859
- Loading branch information
1 parent
e9071e4
commit 56af1e5
Showing
13 changed files
with
106 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ExternalRoutes } from "src/constants/routes"; | ||
|
||
import { Trans, useTranslation } from "next-i18next"; | ||
|
||
import FullWidthAlert from "./FullWidthAlert"; | ||
|
||
const BetaAlert = () => { | ||
const { t } = useTranslation("common", { | ||
keyPrefix: "Beta_alert", | ||
}); | ||
|
||
return ( | ||
<div | ||
data-testid="beta-alert" | ||
className="desktop:position-sticky top-0 z-200" | ||
> | ||
<FullWidthAlert | ||
type="info" | ||
heading={ | ||
<Trans | ||
t={t} | ||
i18nKey="alert_title" | ||
components={{ | ||
LinkToGrants: ( | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={ExternalRoutes.GRANTS_HOME} | ||
/> | ||
), | ||
}} | ||
/> | ||
} | ||
> | ||
{t("alert")} | ||
</FullWidthAlert> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BetaAlert; |
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
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,18 @@ | ||
import { Meta } from "@storybook/react"; | ||
|
||
import BetaAlert from "src/components/BetaAlert"; | ||
|
||
const meta: Meta<typeof BetaAlert> = { | ||
title: "Components/BetaAlert", | ||
component: BetaAlert, | ||
}; | ||
export default meta; | ||
|
||
export const Default = { | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: "https://www.figma.com/file/lpKPdyTyLJB5JArxhGjJnE/beta.grants.gov?type=design&node-id=2157-633&mode=design&t=JS0JebJ4QTnv0jor-0", | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.