mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-23 05:19:37 +02:00
update search bar stayx
This commit is contained in:
parent
3c347c854c
commit
0de8bdbf71
2 changed files with 53 additions and 21 deletions
|
@ -1,18 +1,44 @@
|
||||||
.SearchBar {
|
.SearchContainer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px 0;
|
padding-bottom: 10px;
|
||||||
color: var(--color-primary);
|
|
||||||
/* font-size: 20px; */
|
|
||||||
margin-bottom: 20px;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 2px solid var(--color-accent);
|
|
||||||
opacity: 0.5;
|
|
||||||
transition: all 0.2s;
|
|
||||||
border-radius: 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.SearchBar:focus {
|
.SearchWrapper {
|
||||||
opacity: 1;
|
display: flex;
|
||||||
outline: none;
|
align-items: center;
|
||||||
|
background-color: var(--color-bg-secondary);
|
||||||
|
border: 2px solid var(--color-accent);
|
||||||
|
border-radius: 30px; /* 药丸形状 */
|
||||||
|
padding: 10px 15px;
|
||||||
|
width: 70%;
|
||||||
|
/* max-width: 600px; */
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: box-shadow 0.2s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SearchWrapper:focus-within {
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.SearchIcon {
|
||||||
|
color: var(--color-primary);
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SearchBar {
|
||||||
|
flex: 1;
|
||||||
|
border: none;
|
||||||
|
background-color: transparent;
|
||||||
|
outline: none;
|
||||||
|
font-size: 16px;
|
||||||
|
color: var(--color-primary);
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SearchBar::placeholder {
|
||||||
|
color: var(--color-placeholder);
|
||||||
|
opacity: 0.7;
|
||||||
}
|
}
|
|
@ -15,6 +15,9 @@ import { State } from '../../store/reducers';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { actionCreators } from '../../store';
|
import { actionCreators } from '../../store';
|
||||||
|
|
||||||
|
import Icon from '@mdi/react';
|
||||||
|
import { mdiSearchWeb } from '@mdi/js';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
setLocalSearch: (query: string) => void;
|
setLocalSearch: (query: string) => void;
|
||||||
appSearchResult: App[] | null;
|
appSearchResult: App[] | null;
|
||||||
|
@ -120,6 +123,8 @@ export const SearchBar = (props: Props): JSX.Element => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.SearchContainer}>
|
<div className={classes.SearchContainer}>
|
||||||
|
<div className={classes.SearchWrapper}>
|
||||||
|
<Icon path={mdiSearchWeb} size={1} className={classes.SearchIcon} />
|
||||||
<input
|
<input
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -128,5 +133,6 @@ export const SearchBar = (props: Props): JSX.Element => {
|
||||||
onDoubleClick={clearSearch}
|
onDoubleClick={clearSearch}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue