-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2.20.0-SNAPSHOT][Merge] - Merge fix/1495 into develop - Ref gestion-…
…de-projet#1495 gestion-de-projet#1775 [2.20.0-SNAPSHOT][Merge] - Merge fix/1495 into develop
- Loading branch information
Showing
18 changed files
with
697 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react' | ||
|
||
import { Grid, IconButton, InputAdornment, InputBase } from '@material-ui/core' | ||
|
||
import { ReactComponent as SearchIcon } from 'assets/icones/search.svg' | ||
import ClearIcon from '@material-ui/icons/Clear' | ||
|
||
import useStyles from './styles' | ||
import Alert from '@material-ui/lab/Alert' | ||
|
||
type ScopeSearchBarProps = { | ||
searchInput: string | ||
onChangeInput: (searchInput: string) => void | ||
alertMessage?: string | ||
} | ||
|
||
const ScopeSearchBar: React.FC<ScopeSearchBarProps> = ({ searchInput, onChangeInput, alertMessage }) => { | ||
const classes = useStyles() | ||
|
||
const handleChangeInput = (event: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => { | ||
onChangeInput(event.target.value) | ||
} | ||
|
||
const handleClearInput = () => { | ||
onChangeInput('') | ||
} | ||
|
||
return ( | ||
<Grid id="je suis ici" container alignItems="flex-end" direction="row-reverse" style={{ marginBlock: 8 }}> | ||
<Grid item container alignItems="center" xs={1} className={classes.searchBar}> | ||
<InputBase | ||
placeholder="Rechercher" | ||
className={classes.input} | ||
value={searchInput} | ||
onChange={handleChangeInput} | ||
endAdornment={ | ||
searchInput && ( | ||
<InputAdornment position="end"> | ||
<IconButton onClick={handleClearInput}> | ||
<ClearIcon /> | ||
</IconButton> | ||
</InputAdornment> | ||
) | ||
} | ||
/> | ||
<IconButton type="submit" aria-label="search"> | ||
<SearchIcon fill="#ED6D91" height="15px" /> | ||
</IconButton> | ||
</Grid> | ||
{alertMessage && ( | ||
<Alert severity="info" style={{ backgroundColor: 'transparent' }}> | ||
{alertMessage} | ||
</Alert> | ||
)} | ||
</Grid> | ||
) | ||
} | ||
|
||
export default ScopeSearchBar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { makeStyles } from '@material-ui/core/styles' | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
searchBar: { | ||
minWidth: 250, | ||
backgroundColor: '#FFF', | ||
border: '1px solid #D0D7D8', | ||
boxShadow: '0px 1px 16px #0000000A', | ||
borderRadius: '25px' | ||
}, | ||
input: { | ||
marginLeft: theme.spacing(1), | ||
flex: 1 | ||
} | ||
})) | ||
|
||
export default useStyles |
Oops, something went wrong.