11import { TranslationOutlined } from '@ant-design/icons' ;
22import { Col , Dropdown , Layout , Row } from 'antd' ;
33import React from 'react' ;
4- import { Language , Size } from '../../constants' ;
4+ import { Language } from '../../constants' ;
55import { useI18n , useTheme } from '../../utils' ;
66import { OverlayAlertsWithButton } from '../Alerts' ;
77import { BuilderSelect } from './builder-select' ;
88import { Menus } from './menus' ;
9- import './header.sass' ;
109import { Client } from '@rsdoctor/types' ;
1110import { useNavigate } from 'react-router-dom' ;
11+ import styles from './header.module.scss' ;
12+ import clsx from 'clsx' ;
1213
1314export interface HeaderProps {
1415 enableRoutes ?: string [ ] ;
@@ -18,58 +19,22 @@ export const Header: React.FC<HeaderProps> = ({ enableRoutes }) => {
1819 const { i18n } = useI18n ( ) ;
1920
2021 const navigate = useNavigate ( ) ;
21- const { isLight } = useTheme ( ) ;
22- const iconStyle : React . CSSProperties = {
23- display : 'inline-block' ,
24- fontSize : 20 ,
25- textAlign : 'center' ,
26- verticalAlign : 'middle' ,
27- cursor : 'pointer' ,
28- width : 30 ,
29- transition : 'all 0.3s ease' ,
30- } ;
22+ const { isDark } = useTheme ( ) ;
3123 const languages = [
3224 { value : Language . Cn , label : '中文' } ,
3325 { value : Language . En , label : 'English' } ,
3426 ] ;
3527
3628 return (
37- < Layout . Header
38- style = { {
39- height : Size . NavBarHeight ,
40- padding : 0 ,
41- paddingLeft : Size . BasePadding ,
42- paddingRight : Size . BasePadding ,
43- position : 'fixed' ,
44- zIndex : 999 ,
45- width : '100%' ,
46- backgroundColor : isLight ? '#fff' : '#141414' ,
47- transition : 'none' ,
48- } }
49- >
50- < Row
51- justify = "space-between"
52- align = "middle"
53- style = { { height : Size . NavBarHeight } }
54- wrap = { false }
55- >
56- < Col
57- style = { {
58- height : Size . NavBarHeight ,
59- lineHeight : `${ Size . NavBarHeight + 2 } px` ,
60- } }
61- >
62- < div
63- style = { {
64- display : 'flex' ,
65- justifyContent : 'space-between' ,
66- alignItems : 'center' ,
67- height : '100%' ,
68- } }
69- >
29+ < Layout . Header className = { clsx ( styles . root , isDark && styles . rootDark ) } >
30+ < Row className = { styles . innerRoot } >
31+ < Col className = { styles . leftCol } >
32+ < div className = { styles . leftColInner } >
7033 < img
34+ width = "1604"
35+ height = "380"
7136 src = "https://assets.rspack.rs/rsdoctor/rsdoctor-title-logo.png"
72- className = "rsdoctor-logo"
37+ className = { styles . rsdoctorLogo }
7338 alt = "logo"
7439 onClick = { ( ) => {
7540 if (
@@ -92,14 +57,8 @@ export const Header: React.FC<HeaderProps> = ({ enableRoutes }) => {
9257 style = { { transition : 'none' } }
9358 />
9459
95- < Col flex = { 1 } >
96- < Row
97- align = "middle"
98- justify = "end"
99- style = { { height : Size . NavBarHeight } }
100- wrap = { false }
101- gutter = { [ Size . BasePadding / 3 , 0 ] }
102- >
60+ < Col className = { styles . rightCol } >
61+ < Row className = { styles . rightColInner } >
10362 < Col >
10463 < OverlayAlertsWithButton />
10564 </ Col >
@@ -130,10 +89,7 @@ export const Header: React.FC<HeaderProps> = ({ enableRoutes }) => {
13089 selectedKeys : [ i18n . language ] ,
13190 } }
13291 >
133- < TranslationOutlined
134- className = "header-icon"
135- style = { iconStyle }
136- />
92+ < TranslationOutlined className = { styles . translationsIcon } />
13793 </ Dropdown >
13894 </ Col >
13995 </ Row >
0 commit comments