diff --git a/apps/site/components/Downloads/ReleaseModal/index.tsx b/apps/site/components/Downloads/ReleaseModal/index.tsx index a8887a5397116..3f0bf31f71edb 100644 --- a/apps/site/components/Downloads/ReleaseModal/index.tsx +++ b/apps/site/components/Downloads/ReleaseModal/index.tsx @@ -1,5 +1,5 @@ import AlertBox from '@node-core/ui-components/Common/AlertBox'; -import Modal from '@node-core/ui-components/Common/Modal'; +import { Modal, Title, Content } from '@node-core/ui-components/Common/Modal'; import { useTranslations } from 'next-intl'; import type { FC } from 'react'; @@ -32,7 +32,7 @@ const ReleaseModal: FC = ({ }); return ( - + {release.status === 'End-of-life' && ( = ({ size="small" > {t.rich('components.releaseModal.unsupportedVersionWarning', { - link: text => {text}, + link: text => ( + + {text} + + ), })} )} @@ -57,19 +64,23 @@ const ReleaseModal: FC = ({ )} - {release.releaseAnnounceLink && ( - - {t('components.releaseModal.releaseAnnouncement')} - - )} + {modalHeading} + + + {release.releaseAnnounceLink && ( + + {t('components.releaseModal.releaseAnnouncement')} + + )} -
{t('components.releaseModal.overview')}
+
{t('components.releaseModal.overview')}
- + -
{t('components.releaseModal.minorVersions')}
+
{t('components.releaseModal.minorVersions')}
- + +
); }; diff --git a/packages/i18n/locales/en.json b/packages/i18n/locales/en.json index a1e9f6a3699d9..064b82e74f790 100644 --- a/packages/i18n/locales/en.json +++ b/packages/i18n/locales/en.json @@ -163,12 +163,12 @@ "details": "Details" }, "releaseModal": { - "title": "Node.js {version} ({codename})", - "titleWithoutCodename": "Node.js {version}", + "title": "Node.js v{version} ({codename})", + "titleWithoutCodename": "Node.js v{version}", "overview": "Overview", "minorVersions": "Minor versions", "releaseAnnouncement": "Release Announcement", - "unsupportedVersionWarning": "This version is out of maintenance. Please use a currently supported version. Understand EOL support.", + "unsupportedVersionWarning": "This version is out of maintenance. Please use a supported version. Understand EOL support.", "ltsVersionFeaturesNotice": "Want new features sooner? Get the latest Node.js version instead and try the latest improvements!" }, "minorReleasesTable": { diff --git a/packages/ui-components/Common/Modal/index.module.css b/packages/ui-components/Common/Modal/index.module.css index 5b399767fdf7e..d5e385f7228bd 100644 --- a/packages/ui-components/Common/Modal/index.module.css +++ b/packages/ui-components/Common/Modal/index.module.css @@ -17,6 +17,7 @@ w-full max-w-3xl flex-col + gap-2 overflow-y-auto rounded border @@ -47,8 +48,7 @@ } .title { - @apply mb-2 - text-3xl + @apply text-3xl font-semibold text-neutral-900 dark:text-white; @@ -56,7 +56,7 @@ .description { @apply font-regular - mb-4 + mb-2 text-lg text-neutral-800 dark:text-neutral-200; diff --git a/packages/ui-components/Common/Modal/index.stories.tsx b/packages/ui-components/Common/Modal/index.stories.tsx index 8040bbd63134e..350be68bd68b5 100644 --- a/packages/ui-components/Common/Modal/index.stories.tsx +++ b/packages/ui-components/Common/Modal/index.stories.tsx @@ -1,6 +1,6 @@ import type { Meta as MetaObj, StoryObj } from '@storybook/react'; -import Modal from '#ui/Common/Modal'; +import { Modal, Title, Description, Content } from '#ui/Common/Modal'; type Story = StoryObj; type Meta = MetaObj; @@ -8,10 +8,12 @@ type Meta = MetaObj; export const Default: Story = { args: { open: true, - heading: 'Node.js Versions Information', - subheading: 'Get all information about Node.js versions and their changes.', children: ( - <> + + Node.js Versions Information + + Get all information about Node.js versions and their changes. +

Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto atque sint doloremque, sapiente recusandae debitis libero nostrum @@ -24,7 +26,7 @@ export const Default: Story = { amet minus sit architecto blanditiis hic sed odit cumque numquam dignissimos delectus.

- +
), }, }; diff --git a/packages/ui-components/Common/Modal/index.tsx b/packages/ui-components/Common/Modal/index.tsx index 787a80e0cb73a..d254ce40facd5 100644 --- a/packages/ui-components/Common/Modal/index.tsx +++ b/packages/ui-components/Common/Modal/index.tsx @@ -7,15 +7,11 @@ import type { FC, PropsWithChildren } from 'react'; import styles from './index.module.css'; type ModalProps = PropsWithChildren<{ - heading: string; - subheading?: string; open?: boolean; onOpenChange?: (open: boolean) => void; }>; const Modal: FC = ({ - heading, - subheading, children, open = false, onOpenChange = () => {}, @@ -28,15 +24,7 @@ const Modal: FC = ({ - {heading} - - {subheading && ( - - {subheading} - - )} - -
{children}
+ {children} @@ -45,4 +33,18 @@ const Modal: FC = ({ ); -export default Modal; +const Title = ({ children }: PropsWithChildren) => ( + {children} +); + +const Description = ({ children }: PropsWithChildren) => ( + + {children} + +); + +const Content = ({ children }: PropsWithChildren) => ( +
{children}
+); + +export { Modal, Title, Description, Content };