-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update format for NSW version in footer to include the DDS version (#185
- Loading branch information
1 parent
49848f0
commit 3266839
Showing
2 changed files
with
38 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import nswPackageJson from 'nsw-design-system/package.json'; | ||
|
||
export function DesignSystemVersionInformation() { | ||
let designSystemVersion = nswPackageJson?.version; | ||
try { | ||
designSystemVersion = designSystemVersion.split('.').slice(0, 2).join('.'); | ||
} catch { | ||
console.warn( | ||
'Failed to fetch valid design system version: ', | ||
designSystemVersion, | ||
); | ||
} | ||
|
||
if (!designSystemVersion) { | ||
return ( | ||
<FormattedMessage | ||
id="NSW Built with - plone only" | ||
defaultMessage="NSW DDS Plone" | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<FormattedMessage | ||
id="NSW Built with - DDS and Plone" | ||
defaultMessage="NSW DDS Plone {ddsVersion}" | ||
values={{ | ||
ddsVersion: designSystemVersion, | ||
}} | ||
/> | ||
); | ||
} |
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