Skip to content

Commit 01edbb9

Browse files
kujo205kujo205
and
kujo205
authored
fix: Made RouterSelect inline (#6560) (#6568)
Co-authored-by: kujo205 <[email protected]>
1 parent 2f9368c commit 01edbb9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

components/Common/Select/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type SelectProps = {
3737
inline?: boolean;
3838
onChange?: (value: string) => void;
3939
className?: string;
40+
ariaLabel?: string;
4041
};
4142

4243
const Select: FC<SelectProps> = ({
@@ -47,6 +48,7 @@ const Select: FC<SelectProps> = ({
4748
inline,
4849
onChange,
4950
className,
51+
ariaLabel,
5052
}) => {
5153
const id = useId();
5254

@@ -72,7 +74,7 @@ const Select: FC<SelectProps> = ({
7274
className
7375
)}
7476
>
75-
{label && !inline && (
77+
{label && (
7678
<label className={styles.label} htmlFor={id}>
7779
{label}
7880
</label>
@@ -81,7 +83,7 @@ const Select: FC<SelectProps> = ({
8183
<SelectPrimitive.Root value={defaultValue} onValueChange={onChange}>
8284
<SelectPrimitive.Trigger
8385
className={styles.trigger}
84-
aria-label={label}
86+
aria-label={ariaLabel}
8587
id={id}
8688
>
8789
<SelectPrimitive.Value placeholder={placeholder} />

components/Downloads/Release/BitnessDropdown.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use client';
2-
32
import { useTranslations } from 'next-intl';
43
import type { FC } from 'react';
54
import { useEffect, useContext, useMemo } from 'react';
@@ -86,11 +85,11 @@ const BitnessDropdown: FC = () => {
8685

8786
return (
8887
<Select
89-
label={t('layouts.download.dropdown.bitness')}
9088
values={formatDropdownItems({
9189
items: bitnessItems[os],
9290
disabledItems,
9391
})}
92+
ariaLabel={t('layouts.download.dropdown.bitness')}
9493
defaultValue={String(bitness)}
9594
onChange={bitness => setBitness(parseNumericBitness(bitness))}
9695
className="w-28"

components/Downloads/Release/OperatingSystemDropdown.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use client';
2-
32
import { useTranslations } from 'next-intl';
43
import { useContext, useEffect, useMemo } from 'react';
54
import type { FC } from 'react';
@@ -68,7 +67,6 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = ({
6867

6968
return (
7069
<Select
71-
label={t('layouts.download.dropdown.os')}
7270
values={formatDropdownItems({
7371
items: operatingSystemItems,
7472
disabledItems,
@@ -79,6 +77,7 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = ({
7977
AIX: <Aix width={16} height={16} />,
8078
},
8179
})}
80+
ariaLabel={t('layouts.download.dropdown.os')}
8281
defaultValue={os}
8382
onChange={value => setOS(value as UserOS)}
8483
className="w-[8.5rem]"

components/Downloads/Release/PlatformDropdown.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use client';
2-
32
import { useTranslations } from 'next-intl';
43
import { useContext, useEffect, useMemo } from 'react';
54
import type { FC } from 'react';
@@ -69,7 +68,6 @@ const PlatformDropdown: FC = () => {
6968

7069
return (
7170
<Select
72-
label={t('layouts.download.dropdown.platform')}
7371
values={formatDropdownItems({
7472
items: platformItems,
7573
icons: {
@@ -80,6 +78,7 @@ const PlatformDropdown: FC = () => {
8078
},
8179
disabledItems,
8280
})}
81+
ariaLabel={t('layouts.download.dropdown.platform')}
8382
defaultValue={platform}
8483
onChange={platform => setPlatform(platform as PackageManager)}
8584
className="w-28"

components/Downloads/Release/VersionDropdown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const VersionDropdown: FC = () => {
2525

2626
return (
2727
<Select
28-
label={t('layouts.download.dropdown.version')}
28+
ariaLabel={t('layouts.download.dropdown.version')}
2929
values={releases.map(({ status, versionWithPrefix }) => ({
3030
value: versionWithPrefix,
3131
label: getDropDownStatus(versionWithPrefix, status),

components/withRouterSelect.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const WithRouterSelect: FC<WithSidebarSelectProps> = ({
1919

2020
return (
2121
<Select
22+
inline={true}
2223
label={label}
2324
values={values}
2425
defaultValue={defaultValue}

0 commit comments

Comments
 (0)