Skip to content

Commit 80d1a2b

Browse files
committed
Fix padding on dropdown select
1 parent d1d1a15 commit 80d1a2b

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

frontend/src/components/NavBar/NavBar.styled.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
33
import DiscordIcon from 'components/common/Icons/DiscordIcon';
44
import GitHubIcon from 'components/common/Icons/GitHubIcon';
55
import ProductHuntIcon from 'components/common/Icons/ProductHuntIcon';
6+
import Select from 'components/common/Select/Select';
67

78
export const Navbar = styled.nav(
89
({ theme }) => css`
@@ -118,3 +119,8 @@ export const Hyperlink = styled(Link)(
118119
cursor: pointer;
119120
`
120121
);
122+
123+
// Add the new styled component for Select with custom padding
124+
export const NoPaddingSelect = styled(Select)`
125+
padding-left: 0 !important;
126+
`;

frontend/src/components/NavBar/NavBar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const options = [
4141

4242
const NavBar: React.FC<Props> = ({ onBurgerClick }) => {
4343
const { themeMode, setThemeMode } = useContext(ThemeModeContext);
44-
// const { data: supportUrl } = useSupportUrl();
44+
const { data: supportUrl } = useSupportUrl();
4545

4646
const handleSupportRedirect = () => {
4747
if (supportUrl) {
@@ -68,13 +68,13 @@ const NavBar: React.FC<Props> = ({ onBurgerClick }) => {
6868
<S.NavbarVersion>v1.1.4</S.NavbarVersion>
6969
<S.NavbarSocial>
7070
<Button buttonType="text" buttonSize="S" onClick={handleSupportRedirect}>
71-
Docs<External_Link/>
71+
Docs <External_Link/>
7272
</Button>
73-
<Select
73+
<S.NoPaddingSelect
7474
options={options}
7575
value={themeMode}
76-
onChange={setThemeMode}
77-
isThemeMode
76+
onChange={(option) => setThemeMode(option as string | number)}
77+
isThemeMode={true}
7878
/>
7979
<UserInfo />
8080
</S.NavbarSocial>

frontend/src/components/common/Select/Select.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const Select = styled.ul<Props>`
3535
border-radius: 4px;
3636
font-size: 14px;
3737
width: fit-content;
38-
padding-left: 0px;
38+
padding-left: 16px;
3939
padding-right: 12px;
4040
color: ${({ theme, disabled }) =>
4141
disabled ? theme.select.color.disabled : theme.select.color.normal};

0 commit comments

Comments
 (0)