@@ -2,14 +2,11 @@ import { useEffect } from "react";
22import { GoabNotification } from "@abgov/react-components" ;
33import { MAX_CONTENT_WIDTH } from "../../global-constants" ;
44import { useVersionUpdateNotification } from "./VersionUpdateNotificationContext" ;
5- import type { LanguageVersion } from "@components/version-language-switcher/version-language-constants " ;
5+ import { getV2Link } from "../../utils " ;
66
7- interface VersionUpdateNotificationProps {
8- version : LanguageVersion ;
9- }
10-
11- export function VersionUpdateNotification ( { version } : VersionUpdateNotificationProps ) {
12- const { isDismissed, dismiss, oldLinkRef, newLinkRef } = useVersionUpdateNotification ( ) ;
7+ export function VersionUpdateNotification ( ) {
8+ const { isDismissed, dismiss, newLinkRef } = useVersionUpdateNotification ( ) ;
9+ const v2UpgradeLink = getV2Link ( "/upgrade-guide" ) ;
1310
1411 useEffect ( ( ) => {
1512 const el = document . querySelector ( "goa-notification" ) ;
@@ -24,22 +21,19 @@ export function VersionUpdateNotification({ version }: VersionUpdateNotification
2421 if ( isDismissed ) return null ;
2522
2623 return (
27- < GoabNotification type = { version === "old" ? "important" : "information" } maxContentWidth = { MAX_CONTENT_WIDTH } >
28- { version === "old" ? (
24+ < GoabNotification type = "information" maxContentWidth = { MAX_CONTENT_WIDTH } >
2925 < >
30- Support for v3 (Angular) and v5 (React) has ended. Read the{ " " }
31- < a ref = { oldLinkRef } href = "/get-started/developers/update" >
26+ Design System 2 is now available! Check out the{ " " }
27+ < a
28+ ref = { newLinkRef }
29+ href = { v2UpgradeLink }
30+ className = "no-external-icon"
31+ target = "_blank"
32+ rel = "noopener noreferrer"
33+ >
3234 < span style = { { whiteSpace : "nowrap" } } > upgrade guide</ span >
33- </ a >
34- </ >
35- ) : (
36- < >
37- Upgrading to the latest version of the design system?{ " " }
38- < a ref = { newLinkRef } href = "/get-started/developers/update" >
39- < span style = { { whiteSpace : "nowrap" } } > View the upgrade guide</ span >
40- </ a >
35+ </ a > .
4136 </ >
42- ) }
4337 </ GoabNotification >
4438 ) ;
4539}
0 commit comments