Skip to content

Commit

Permalink
feat: 搜索框样式优化
Browse files Browse the repository at this point in the history
  • Loading branch information
xucz committed Jun 4, 2022
1 parent d860271 commit c9d2fe3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
File renamed without changes.
14 changes: 14 additions & 0 deletions src/layouts/components/Header/Search.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.panel {
:global {
.t-input {
border: none;
}
.t-input:hover {
background: #EEE;
transition: background var(--tdvns-anim-duration-base) linear
}
.t-input--focused {
box-shadow: none;
}
}
}
8 changes: 8 additions & 0 deletions src/layouts/components/Header/Search.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import { Input } from 'tdesign-react';
import { SearchIcon } from 'tdesign-icons-react';
import Style from './Search.module.less';

const Search = () => <Input className={Style.panel} prefixIcon={<SearchIcon />} placeholder='请输入搜索内容' />;

export default React.memo(Search);
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { memo } from 'react';
import { Layout, Button, Row, Col, Input } from 'tdesign-react';
import { ViewListIcon, SearchIcon } from 'tdesign-icons-react';
import { Layout, Button, Row, Col } from 'tdesign-react';
import { ViewListIcon } from 'tdesign-icons-react';
import { useAppDispatch, useAppSelector } from 'modules/store';
import { selectGlobal, toggleMenu } from 'modules/global';
import HeaderIcon from './HeaderIcon';
import { HeaderMenu } from './Menu';
import Style from './Header.module.less';
import { HeaderMenu } from '../Menu';
import Search from './Search';
import Style from './index.module.less';

const { Header } = Layout;

Expand Down Expand Up @@ -33,7 +34,7 @@ export default memo((props: { showMenu?: boolean }) => {
</Button>
</Col>
<Col>
<Input prefixIcon={<SearchIcon />} placeholder='请输入内容1' />
<Search />
</Col>
</Row>
);
Expand Down

0 comments on commit c9d2fe3

Please sign in to comment.