File tree Expand file tree Collapse file tree 9 files changed +16
-41
lines changed
packages/ui-components/src Expand file tree Collapse file tree 9 files changed +16
-41
lines changed Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import BaseLinkTabs from '@node-core/ui-components/Common/BaseLinkTabs' ;
42import type { LinkTabsProps } from '@node-core/ui-components/Common/BaseLinkTabs' ;
53import type { FC } from 'react' ;
64
75import 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
1511export default LinkTabs ;
Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import Avatar from '@node-core/ui-components/Common/AvatarGroup/Avatar' ;
42import type { FC } from 'react' ;
53
Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import { CloudArrowDownIcon } from '@heroicons/react/24/outline' ;
42import classNames from 'classnames' ;
53import type { FC , PropsWithChildren } from 'react' ;
64
5+ import { getClientContext } from '#site/client-context' ;
76import Button from '#site/components/Common/Button' ;
8- import { useClientContext } from '#site/hooks' ;
97import type { NodeRelease } from '#site/types' ;
108import { getNodeDownloadUrl } from '#site/util/url' ;
119import { getUserPlatform } from '#site/util/userAgent' ;
@@ -18,7 +16,7 @@ const DownloadButton: FC<PropsWithChildren<DownloadButtonProps>> = ({
1816 release : { versionWithPrefix } ,
1917 children,
2018} ) => {
21- const { os, bitness, architecture } = useClientContext ( ) ;
19+ const { os, bitness, architecture } = getClientContext ( ) ;
2220
2321 const platform = getUserPlatform ( architecture , bitness ) ;
2422 const downloadLink = getNodeDownloadUrl ( { versionWithPrefix, os, platform } ) ;
Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import type { FC , PropsWithChildren } from 'react' ;
42
3+ import { getClientContext } from '#site/client-context' ;
54import LinkWithArrow from '#site/components/Common/LinkWithArrow' ;
6- import { useClientContext } from '#site/hooks' ;
75import type { DownloadKind , NodeRelease } from '#site/types' ;
86import { getNodeDownloadUrl } from '#site/util/url' ;
97import { getUserPlatform } from '#site/util/userAgent' ;
@@ -15,7 +13,7 @@ const DownloadLink: FC<PropsWithChildren<DownloadLinkProps>> = ({
1513 kind = 'installer' ,
1614 children,
1715} ) => {
18- const { os, bitness, architecture } = useClientContext ( ) ;
16+ const { os, bitness, architecture } = getClientContext ( ) ;
1917
2018 const platform = getUserPlatform ( architecture , bitness ) ;
2119
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 11import type { FC , PropsWithChildren } from 'react' ;
22
3- import Select from '#ui/Common/Select' ;
43import type { LinkLike } from '#ui/types' ;
54
65import styles from './index.module.css' ;
6+ import StatelessSelect from '../Select/StatelessSelect' ;
77
88type 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
1817const 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 </ >
Original file line number Diff line number Diff line change 180180 }
181181
182182 .dropdown {
183- @apply absolute
183+ @apply z-99
184+ absolute
184185 left-0
185186 mt-4;
186187 }
Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import * as SeparatorPrimitive from '@radix-ui/react-separator' ;
42import classNames from 'classnames' ;
53import type { FC , ComponentProps } from 'react' ;
Original file line number Diff line number Diff line change 1- 'use client' ;
2-
31import Hamburger from '@heroicons/react/24/solid/Bars3Icon' ;
42import XMark from '@heroicons/react/24/solid/XMarkIcon' ;
53import * as Label from '@radix-ui/react-label' ;
You can’t perform that action at this time.
0 commit comments