Skip to content

Commit 12f7c6d

Browse files
Poleg KashtiPoleg Kashti
authored andcommitted
Modify(Navbar.tsx): Remove links and version from nav bar, add new logo and adjustments
1 parent e071870 commit 12f7c6d

File tree

3 files changed

+13
-43
lines changed

3 files changed

+13
-43
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ export const NavbarItem = styled.div`
8383
padding: 0.5rem 0.75rem;
8484
`;
8585

86+
export const NavbarVersion = styled.div`
87+
color: ${({ theme }) => theme.input.label.color};
88+
font-size: 14px;
89+
margin-left: auto;
90+
`;
91+
8692
export const Hyperlink = styled(Link)(
8793
({ theme }) => css`
8894
position: relative;
@@ -99,7 +105,7 @@ export const Hyperlink = styled(Link)(
99105
font-family: Inter, sans-serif;
100106
font-style: normal;
101107
font-weight: bold;
102-
font-size: 22px;
108+
font-size: 15px;
103109
line-height: 16px;
104110
color: ${theme.default.color.normal};
105111

frontend/src/components/NavBar/NavBar.tsx

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
11
import React, { useContext } from 'react';
22
import Select from 'components/common/Select/Select';
33
import Logo from 'components/common/Logo/Logo';
4-
import Version from 'components/Version/Version';
5-
import GitHubIcon from 'components/common/Icons/GitHubIcon';
6-
import DiscordIcon from 'components/common/Icons/DiscordIcon';
7-
import AutoIcon from 'components/common/Icons/AutoIcon';
84
import SunIcon from 'components/common/Icons/SunIcon';
95
import MoonIcon from 'components/common/Icons/MoonIcon';
106
import { ThemeModeContext } from 'components/contexts/ThemeModeContext';
11-
import ProductHuntIcon from 'components/common/Icons/ProductHuntIcon';
127
import { Button } from 'components/common/Button/Button';
138
import MenuIcon from 'components/common/Icons/MenuIcon';
14-
159
import UserInfo from './UserInfo/UserInfo';
1610
import * as S from './NavBar.styled';
1711

1812
interface Props {
1913
onBurgerClick: () => void;
2014
}
2115

22-
export type ThemeDropDownValue = 'auto_theme' | 'light_theme' | 'dark_theme';
16+
export type ThemeDropDownValue = 'light_theme' | 'dark_theme';
2317

2418
const options = [
25-
{
26-
label: (
27-
<>
28-
<AutoIcon />
29-
<div>Auto theme</div>
30-
</>
31-
),
32-
value: 'auto_theme',
33-
},
3419
{
3520
label: (
3621
<>
@@ -64,36 +49,19 @@ const NavBar: React.FC<Props> = ({ onBurgerClick }) => {
6449

6550
<S.Hyperlink to="/">
6651
<Logo />
67-
kafbat UI
52+
Kafka by IDFcTS
6853
</S.Hyperlink>
6954

70-
<S.NavbarItem>
71-
<Version />
72-
</S.NavbarItem>
7355
</S.NavbarBrand>
7456
</S.NavbarBrand>
57+
<S.NavbarVersion>Version: v1.1.4</S.NavbarVersion>
7558
<S.NavbarSocial>
7659
<Select
7760
options={options}
7861
value={themeMode}
7962
onChange={setThemeMode}
8063
isThemeMode
8164
/>
82-
<S.SocialLink href="https://github.com/kafbat/kafka-ui" target="_blank">
83-
<GitHubIcon />
84-
</S.SocialLink>
85-
<S.SocialLink
86-
href="https://discord.com/invite/4DWzD7pGE5"
87-
target="_blank"
88-
>
89-
<DiscordIcon />
90-
</S.SocialLink>
91-
<S.SocialLink
92-
href="https://producthunt.com/products/ui-for-apache-kafka"
93-
target="_blank"
94-
>
95-
<ProductHuntIcon />
96-
</S.SocialLink>
9765
<UserInfo />
9866
</S.NavbarSocial>
9967
</S.Navbar>

frontend/src/components/contexts/ThemeModeContext.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,22 @@ interface ThemeModeContextProps {
1010

1111
export const ThemeModeContext = React.createContext<ThemeModeContextProps>({
1212
isDarkMode: false,
13-
themeMode: 'auto_theme',
13+
themeMode: 'light_theme',
1414
setThemeMode: () => {},
1515
});
1616

1717
export const ThemeModeProvider: FC<PropsWithChildren<unknown>> = ({
1818
children,
1919
}) => {
20-
const matchDark = window.matchMedia('(prefers-color-scheme: dark)');
2120
const [themeMode, setThemeModeState] =
22-
React.useState<ThemeDropDownValue>('auto_theme');
21+
React.useState<ThemeDropDownValue>('light_theme');
2322

2423
React.useLayoutEffect(() => {
2524
const mode = localStorage.getItem('mode');
26-
setThemeModeState((mode as ThemeDropDownValue) ?? 'auto_theme');
25+
setThemeModeState((mode as ThemeDropDownValue) ?? 'light_theme');
2726
}, [setThemeModeState]);
2827

2928
const isDarkMode = React.useMemo(() => {
30-
if (themeMode === 'auto_theme') {
31-
return matchDark.matches;
32-
}
3329
return themeMode === 'dark_theme';
3430
}, [themeMode]);
3531

0 commit comments

Comments
 (0)