Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions apps/site/components/Common/LinkTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
'use client';

import BaseLinkTabs from '@node-core/ui-components/Common/BaseLinkTabs';
import type { LinkTabsProps } from '@node-core/ui-components/Common/BaseLinkTabs';
import type { FC } from 'react';

import Link from '#site/components/Link';
import { useRouter } from '#site/navigation.mjs';

const LinkTabs: FC<Omit<LinkTabsProps, 'as' | 'onSelect'>> = props => {
const { push } = useRouter();
return <BaseLinkTabs onSelect={value => push(value)} as={Link} {...props} />;
const LinkTabs: FC<Omit<LinkTabsProps, 'as'>> = props => {
return <BaseLinkTabs as={Link} {...props} />;
};

export default LinkTabs;
2 changes: 0 additions & 2 deletions apps/site/components/Common/Supporters/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

import Avatar from '@node-core/ui-components/Common/AvatarGroup/Avatar';
import type { FC } from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,5 @@
}

.tabsSelect {
@apply sm:visible
md:hidden;

> span {
@apply max-xs:flex
my-6
hidden
w-full;
}
@apply md:hidden;
}
18 changes: 7 additions & 11 deletions packages/ui-components/src/Common/BaseLinkTabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { FC, PropsWithChildren } from 'react';

import Select from '#ui/Common/Select';
import type { LinkLike } from '#ui/types';

import styles from './index.module.css';
import StatelessSelect from '../Select/StatelessSelect';

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

Expand All @@ -12,7 +12,6 @@ export type LinkTabsProps = PropsWithChildren<{
tabs: Array<LinkTab>;
activeTab: string;
as?: LinkLike;
onSelect: (value: string) => void;
}>;

const BaseLinkTabs: FC<LinkTabsProps> = ({
Expand All @@ -21,7 +20,6 @@ const BaseLinkTabs: FC<LinkTabsProps> = ({
activeTab,
children,
as: Component = 'a',
onSelect,
}) => (
<>
<div className={styles.tabsList}>
Expand All @@ -37,14 +35,12 @@ const BaseLinkTabs: FC<LinkTabsProps> = ({
))}
</div>

<div className={styles.tabsSelect}>
<Select
label={label}
defaultValue={tabs.find(tab => tab.key === activeTab)?.link}
values={tabs.map(tab => ({ label: tab.label, value: tab.link }))}
onChange={onSelect}
/>
</div>
<StatelessSelect
label={label}
className={styles.tabsSelect}
defaultValue={tabs.find(tab => tab.key === activeTab)?.link}
values={tabs.map(tab => ({ label: tab.label, value: tab.link }))}
/>

{children}
</>
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-components/src/Common/Select/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
}

.dropdown {
@apply absolute
@apply z-99
absolute
left-0
mt-4;
}
Expand Down
2 changes: 0 additions & 2 deletions packages/ui-components/src/Common/Separator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

import * as SeparatorPrimitive from '@radix-ui/react-separator';
import classNames from 'classnames';
import type { FC, ComponentProps } from 'react';
Expand Down
2 changes: 0 additions & 2 deletions packages/ui-components/src/Containers/NavBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use client';

import Hamburger from '@heroicons/react/24/solid/Bars3Icon';
import XMark from '@heroicons/react/24/solid/XMarkIcon';
import * as Label from '@radix-ui/react-label';
Expand Down
Loading