feat: 增加二级分类及标签

This commit is contained in:
秋水浮尘
2023-10-17 01:25:19 +08:00
parent 7ba8d52bfe
commit 5214648d90
9 changed files with 392 additions and 299 deletions

View File

@@ -1,4 +1,4 @@
import React, { Component, useEffect } from 'react';
import { useEffect, memo } from 'react';
import './App.less';
import { useLocation, useNavigate, Outlet } from 'react-router-dom';
import PubSub from 'pubsub-js';
@@ -8,67 +8,47 @@ import Head from '@views/imgs/head.jpg'
import TopMenu from '@components/top-menu'
const { Search } = Input;
class NavTop extends Component {
constructor(props) {
super(props);
this.state = {
userName: '',
intervieweEamil: '',
headImg: '',
isShowTimer: false,
};
}
timerRef = React.createRef();
const NavTop = () => {
const { pathname } = window.location;
componentDidMount() {
PubSub.subscribe('handleToRender', () => {
this.setState({});
});
}
render() {
let { headImg, isShowTimer } = this.state;
const { pathname } = window.location;
return (
<div className="head-navigator-box">
<div className="head-navigator">
<div className="head-navigator-left">
<div
className="head-navigator-logo"
onClick={() =>
(window.location.href = '/question-bank')
}>
<img src={Logo} style={{ height: 50 }} />
</div>
<TopMenu />
return (
<div className="head-navigator-box">
<div className="head-navigator">
<div className="head-navigator-left">
<div
className="head-navigator-logo"
onClick={() =>
(window.location.href = '/question-bank')
}>
<img src={Logo} style={{ height: 50 }} />
</div>
<div className="head-navigator-user-box">
<div className="time-box"></div>
{'/question-bank' == pathname && (
<div className="head-navigator-input-box">
<Search
placeholder="请输入感兴趣的内容~"
onSearch={(value) => console.log(value)}
style={{ width: 300, borderRadius: '10px' }}
/>
</div>
)}
<div className="head-navigator-bell">
{/* <Icon type="bell" /> */}
</div>
<div className="head-navigator-user-img">
<img
src={Head}
style={{ width: 36, height: 36 }}
<TopMenu />
</div>
<div className="head-navigator-user-box">
<div className="time-box"></div>
{'/question-bank' == pathname && (
<div className="head-navigator-input-box">
<Search
placeholder="请输入感兴趣的内容~"
onSearch={(value) => console.log(value)}
style={{ width: 300, borderRadius: '10px' }}
/>
</div>
)}
<div className="head-navigator-bell">
{/* <Icon type="bell" /> */}
</div>
<div className="head-navigator-user-img">
<img
src={Head}
style={{ width: 36, height: 36 }}
/>
</div>
</div>
</div>
);
}
</div>
)
}
const App = () => {
@@ -87,4 +67,4 @@ const App = () => {
)
}
export default App
export default memo(App)