Skip to content

Commit 5ac8b8f

Browse files
committed
feat(server): more server components
1 parent 843297a commit 5ac8b8f

File tree

7 files changed

+12
-33
lines changed

7 files changed

+12
-33
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
'use client';
2-
31
import BaseLinkTabs from '@node-core/ui-components/Common/BaseLinkTabs';
42
import type { LinkTabsProps } from '@node-core/ui-components/Common/BaseLinkTabs';
53
import type { FC } from 'react';
64

75
import Link from '#site/components/Link';
8-
import { useRouter } from '#site/navigation.mjs';
96

10-
const LinkTabs: FC<Omit<LinkTabsProps, 'as' | 'onSelect'>> = props => {
11-
const { push } = useRouter();
12-
return <BaseLinkTabs onSelect={value => push(value)} as={Link} {...props} />;
7+
const LinkTabs: FC<Omit<LinkTabsProps, 'as'>> = props => {
8+
return <BaseLinkTabs as={Link} {...props} />;
139
};
1410

1511
export default LinkTabs;

apps/site/components/Common/Supporters/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import Avatar from '@node-core/ui-components/Common/AvatarGroup/Avatar';
42
import type { FC } from 'react';
53

packages/ui-components/src/Common/BaseLinkTabs/index.module.css

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,5 @@
3838
}
3939

4040
.tabsSelect {
41-
@apply sm:visible
42-
md:hidden;
43-
44-
> span {
45-
@apply max-xs:flex
46-
my-6
47-
hidden
48-
w-full;
49-
}
41+
@apply md:hidden;
5042
}

packages/ui-components/src/Common/BaseLinkTabs/index.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { FC, PropsWithChildren } from 'react';
22

3-
import Select from '#ui/Common/Select';
43
import type { LinkLike } from '#ui/types';
54

65
import styles from './index.module.css';
6+
import StatelessSelect from '../Select/StatelessSelect';
77

88
type LinkTab = { key: string; label: string; link: string };
99

@@ -12,7 +12,6 @@ export type LinkTabsProps = PropsWithChildren<{
1212
tabs: Array<LinkTab>;
1313
activeTab: string;
1414
as?: LinkLike;
15-
onSelect: (value: string) => void;
1615
}>;
1716

1817
const BaseLinkTabs: FC<LinkTabsProps> = ({
@@ -21,7 +20,6 @@ const BaseLinkTabs: FC<LinkTabsProps> = ({
2120
activeTab,
2221
children,
2322
as: Component = 'a',
24-
onSelect,
2523
}) => (
2624
<>
2725
<div className={styles.tabsList}>
@@ -37,14 +35,12 @@ const BaseLinkTabs: FC<LinkTabsProps> = ({
3735
))}
3836
</div>
3937

40-
<div className={styles.tabsSelect}>
41-
<Select
42-
label={label}
43-
defaultValue={tabs.find(tab => tab.key === activeTab)?.link}
44-
values={tabs.map(tab => ({ label: tab.label, value: tab.link }))}
45-
onChange={onSelect}
46-
/>
47-
</div>
38+
<StatelessSelect
39+
label={label}
40+
className={styles.tabsSelect}
41+
defaultValue={tabs.find(tab => tab.key === activeTab)?.link}
42+
values={tabs.map(tab => ({ label: tab.label, value: tab.link }))}
43+
/>
4844

4945
{children}
5046
</>

packages/ui-components/src/Common/Select/index.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@
180180
}
181181

182182
.dropdown {
183-
@apply absolute
183+
@apply z-99
184+
absolute
184185
left-0
185186
mt-4;
186187
}

packages/ui-components/src/Common/Separator/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import * as SeparatorPrimitive from '@radix-ui/react-separator';
42
import classNames from 'classnames';
53
import type { FC, ComponentProps } from 'react';

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import Hamburger from '@heroicons/react/24/solid/Bars3Icon';
42
import XMark from '@heroicons/react/24/solid/XMarkIcon';
53
import * as Label from '@radix-ui/react-label';

0 commit comments

Comments
 (0)