Skip to content

Commit 5d10c1d

Browse files
committed
fixup!
1 parent 3ed7d66 commit 5d10c1d

8 files changed

Lines changed: 79 additions & 64 deletions

File tree

‎apps/site/app/[locale]/error.tsx‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
'use client';
22

3+
import GlowingBackdrop from '@node-core/ui-components/Common/GlowingBackdrop';
34
import { useTranslations } from 'next-intl';
45

56
import Button from '#site/components/Common/Button';
6-
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
7+
import styles from '#site/layouts/layouts.module.css';
78

89
import type { FC } from 'react';
910

1011
const ErrorPage: FC<{ error: Error }> = () => {
1112
const t = useTranslations();
1213

1314
return (
14-
<GlowingBackdropLayout kind="default">
15-
<span>500</span>
15+
<div className={styles.centeredLayout}>
16+
<GlowingBackdrop />
1617

17-
<h1 className="special -mt-4 text-center">
18-
{t('layouts.error.internalServerError.title')}
19-
</h1>
18+
<main id="main" tabIndex={-1}>
19+
<span>500</span>
2020

21-
<p className="-mt-4 max-w-sm text-center text-lg">
22-
{t('layouts.error.internalServerError.description')}
23-
</p>
21+
<h1 className="special -mt-4 text-center">
22+
{t('layouts.error.internalServerError.title')}
23+
</h1>
2424

25-
<Button href="/">{t('layouts.error.backToHome')}</Button>
26-
</GlowingBackdropLayout>
25+
<p className="-mt-4 max-w-sm text-center text-lg">
26+
{t('layouts.error.internalServerError.description')}
27+
</p>
28+
29+
<Button href="/">{t('layouts.error.backToHome')}</Button>
30+
</main>
31+
</div>
2732
);
2833
};
2934

‎apps/site/components/AvatarGroup.tsx‎

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client';
2+
3+
import AvatarGroupContainer from '@node-core/ui-components/Common/AvatarGroup';
4+
5+
import Link from '#site/components/Link';
6+
7+
import type { ComponentProps, FC } from 'react';
8+
9+
type AvatarsProps = Omit<ComponentProps<typeof AvatarGroupContainer>, 'as'>;
10+
11+
const Avatars: FC<AvatarsProps> = props => (
12+
<AvatarGroupContainer as={Link} {...props} />
13+
);
14+
15+
export default Avatars;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { getAuthors } from '#site/util/author';
2+
3+
import type { AuthorProps } from '#site/types';
4+
import type { ComponentProps, FC } from 'react';
5+
6+
import Avatars from './Avatars';
7+
8+
type AvatarGroupProps = Omit<ComponentProps<typeof Avatars>, 'avatars'> &
9+
AuthorProps;
10+
11+
// Resolves the authors on the server, so `authors.json` stays there
12+
const AvatarGroup: FC<AvatarGroupProps> = ({
13+
usernames,
14+
names,
15+
clickable = true,
16+
...props
17+
}) => (
18+
<Avatars avatars={getAuthors({ usernames, names, clickable })} {...props} />
19+
);
20+
21+
export default AvatarGroup;

apps/site/components/WebsiteBanner.tsx renamed to apps/site/components/WebsiteBanner/Banner.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,24 @@ import { useTranslations } from 'next-intl';
66
import { useEffect, useState } from 'react';
77

88
import Link from '#site/components/Link';
9-
import { siteConfig } from '#site/next.json.mjs';
109
import { dateIsBetween } from '#site/util/date';
1110

11+
import type { WebsiteBanner } from '#site/types';
1212
import type { FC } from 'react';
1313

1414
const STORAGE_KEY = 'banner-dismissal';
1515

16-
const WebsiteBanner: FC<{ section: string }> = ({ section }) => {
17-
const banner = siteConfig.websiteBanners[section];
16+
const Banner: FC<{ banner: WebsiteBanner }> = ({ banner }) => {
1817
const t = useTranslations();
1918

2019
const [open, setOpen] = useState(false);
2120

2221
useEffect(() => {
23-
if (banner) {
24-
// eslint-disable-next-line @eslint-react/set-state-in-effect
25-
setOpen(localStorage.getItem(STORAGE_KEY) !== banner.text);
26-
}
22+
// eslint-disable-next-line @eslint-react/set-state-in-effect
23+
setOpen(localStorage.getItem(STORAGE_KEY) !== banner.text);
2724
}, [banner]);
2825

29-
if (banner && open && dateIsBetween(banner.startDate, banner.endDate)) {
26+
if (open && dateIsBetween(banner.startDate, banner.endDate)) {
3027
const bannerType = banner.type || 'default';
3128

3229
const onClose = () => {
@@ -54,4 +51,4 @@ const WebsiteBanner: FC<{ section: string }> = ({ section }) => {
5451
return null;
5552
};
5653

57-
export default WebsiteBanner;
54+
export default Banner;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { siteConfig } from '#site/next.json.mjs';
2+
3+
import type { FC } from 'react';
4+
5+
import Banner from './Banner';
6+
7+
const WebsiteBanner: FC<{ section: string }> = ({ section }) => {
8+
const banner = siteConfig.websiteBanners[section];
9+
10+
return banner ? <Banner banner={banner} /> : null;
11+
};
12+
13+
export default WebsiteBanner;

‎packages/ui-components/src/Containers/NavBar/index.module.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
}
5757

5858
/* Swap the toggler's icon while the menu is open */
59-
.sidebarItemToggler:checked ~ .nodeIconAndMobileItemsToggler {
59+
&:has(.sidebarItemToggler:checked) {
6060
.showIcon {
6161
@apply hidden;
6262
}

‎packages/ui-components/src/Containers/NavBar/index.tsx‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ const NavBar: FC<PropsWithChildren<NavbarProps>> = ({
5353
return (
5454
<nav className={styles.container}>
5555
<div className={styles.innerContainer}>
56-
{/* Precedes the menu and its toggler, which follow it through CSS */}
57-
<input
58-
className={classNames('peer', styles.sidebarItemToggler)}
59-
id="sidebarItemToggler"
60-
type="checkbox"
61-
aria-label={sidebarItemTogglerAriaLabel}
62-
tabIndex={-1}
63-
/>
64-
6556
<div className={styles.nodeIconAndMobileItemsToggler}>
6657
{Logo && (
6758
<Component
@@ -91,6 +82,13 @@ const NavBar: FC<PropsWithChildren<NavbarProps>> = ({
9182
</Label.Root>
9283
</div>
9384

85+
<input
86+
className={classNames('peer', styles.sidebarItemToggler)}
87+
id="sidebarItemToggler"
88+
type="checkbox"
89+
aria-label={sidebarItemTogglerAriaLabel}
90+
tabIndex={-1}
91+
/>
9492
<div className={classNames(styles.main, `hidden peer-checked:flex`)}>
9593
{navItems && navItems.length > 0 && (
9694
<div className={styles.navItems}>

0 commit comments

Comments
 (0)