File tree Expand file tree Collapse file tree 5 files changed +52
-17
lines changed
packages/ui-components/styles Expand file tree Collapse file tree 5 files changed +52
-17
lines changed Original file line number Diff line number Diff line change 1- import AlertBox from '@node-core/ui-components/Common/AlertBox' ;
21import Modal from '@node-core/ui-components/Common/Modal' ;
32import { useTranslations } from 'next-intl' ;
43import type { FC } from 'react' ;
54
65import { MinorReleasesTable } from '#site/components/Downloads/MinorReleasesTable' ;
76import { ReleaseOverview } from '#site/components/Downloads/ReleaseOverview' ;
87import LinkWithArrow from '#site/components/LinkWithArrow' ;
8+ import WithReleaseAlertBox from '#site/components/withReleaseAlertBox' ;
99import type { NodeRelease } from '#site/types' ;
1010
1111type ReleaseModalProps = {
@@ -32,15 +32,7 @@ const ReleaseModal: FC<ReleaseModalProps> = ({
3232
3333 return (
3434 < Modal open = { isOpen } onOpenChange = { closeModal } heading = { modalHeading } >
35- { release . status === 'End-of-life' && (
36- < AlertBox
37- title = { t ( 'components.common.alertBox.warning' ) }
38- level = "warning"
39- size = "small"
40- >
41- { t ( 'components.releaseModal.unsupportedVersionWarning' ) }
42- </ AlertBox >
43- ) }
35+ < WithReleaseAlertBox status = { release . status } />
4436
4537 { release . releaseAnnounceLink && (
4638 < LinkWithArrow href = { release . releaseAnnounceLink } >
Original file line number Diff line number Diff line change 1+ import AlertBox from '@node-core/ui-components/Common/AlertBox' ;
2+ import { useTranslations } from 'next-intl' ;
3+ import type { FC } from 'react' ;
4+
5+ import type { NodeReleaseStatus } from '#site/types' ;
6+
7+ type WithReleaseAlertBoxProps = {
8+ status : NodeReleaseStatus ;
9+ } ;
10+
11+ const WithReleaseAlertBox : FC < WithReleaseAlertBoxProps > = ( { status } ) => {
12+ const t = useTranslations ( ) ;
13+
14+ switch ( status ) {
15+ case 'End-of-life' :
16+ return (
17+ < AlertBox
18+ title = { t ( 'components.common.alertBox.warning' ) }
19+ level = "warning"
20+ size = "small"
21+ >
22+ { t ( 'components.releaseModal.unsupportedVersionWarning' ) }
23+ </ AlertBox >
24+ ) ;
25+ default :
26+ return null ;
27+ }
28+ } ;
29+
30+ export default WithReleaseAlertBox ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import WithBadgeGroup from './components/withBadgeGroup';
99import WithBanner from './components/withBanner' ;
1010import WithDownloadArchive from './components/withDownloadArchive' ;
1111import WithNodeRelease from './components/withNodeRelease' ;
12+ import WithReleaseAlertBox from './components/withReleaseAlertBox' ;
1213
1314/**
1415 * A full list of React Components that we want to pass through to MDX
@@ -23,6 +24,8 @@ export const mdxComponents = {
2324 DownloadsTable : DownloadsTable ,
2425 // HOC for getting Node.js Release Metadata
2526 WithNodeRelease : WithNodeRelease ,
27+ // Renders an alert box with the given release status
28+ WithReleaseAlertBox : WithReleaseAlertBox ,
2629 // HOC for providing Banner Data
2730 WithBanner : WithBanner ,
2831 // HOC for providing Badge Data
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ layout: download-archive
1111 { version }
1212 { release .codename && ` (${release .codename }) ` }
1313 </h2 >
14+ <WithReleaseAlertBox status = { release .status } />
1415 <ReleaseOverview release = { release } />
1516 <ul >
1617 <li >
Original file line number Diff line number Diff line change @@ -172,13 +172,22 @@ main {
172172 }
173173
174174 details {
175- h1 ,
176- h2 ,
177- h3 ,
178- h4 ,
179- h5 ,
180- h6 {
181- @apply inline;
175+ summary * {
176+ @apply inline
177+ pl-2;
178+ }
179+
180+ a {
181+ h1 ,
182+ h2 ,
183+ h3 ,
184+ h4 ,
185+ h5 ,
186+ h6 {
187+ @apply inline
188+ text-green-600
189+ dark:text-green-400;
190+ }
182191 }
183192 }
184193}
You can’t perform that action at this time.
0 commit comments