-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added onClick functionality, updated theme colors, removed uneeded de…
…pendencies
- Loading branch information
Tyler Jordan Wright
committed
Oct 21, 2020
1 parent
36896ff
commit c9cda61
Showing
5 changed files
with
87 additions
and
42 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
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 |
---|---|---|
@@ -1,30 +1,57 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { TextField } from "@material-ui/core"; | ||
import { TextField, useTheme, makeStyles } from "@material-ui/core"; | ||
import { yellow } from '@material-ui/core/colors'; | ||
|
||
export default function ItemTableFilter({ label, onChange }) { | ||
return ( | ||
<> | ||
<TextField | ||
label={label} | ||
onChange={onChange} | ||
type="search" | ||
size="small" | ||
color="secondary" | ||
variant="outlined" | ||
fullWidth | ||
/> | ||
</> | ||
); | ||
const theme = useTheme(); | ||
const useStyles = makeStyles({ | ||
root: { | ||
'& label.Mui-focused': { | ||
color: theme.palette.type === "light" ? "black" : "white", | ||
}, | ||
'& .MuiOutlinedInput-root': { | ||
'& fieldset': { | ||
borderColor: theme.palette.type === "light" ? theme.palette.action.disabled : "white", | ||
}, | ||
'&:hover fieldset': { | ||
borderColor: theme.palette.type === "light" ? "black" : "white", | ||
}, | ||
'&.Mui-focused fieldset': { | ||
borderColor: theme.palette.type === "light" ? "black" : "white", | ||
}, | ||
'&.Mui-focused label': { | ||
borderColor: theme.palette.type === "light" ? "black" : "white", | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
const classes = useStyles(); | ||
|
||
return ( | ||
<> | ||
<TextField | ||
label={label} | ||
onChange={onChange} | ||
color="secondary" | ||
type="search" | ||
size="small" | ||
variant="outlined" | ||
fullWidth | ||
/> | ||
</> | ||
); | ||
|
||
}; | ||
|
||
ItemTableFilter.propTypes = { | ||
/** The label that appears inside the search box. */ | ||
"label": PropTypes.string, | ||
/** The callback function that sets a column's filter value. */ | ||
"onChange": PropTypes.func.isRequired | ||
/** The label that appears inside the search box. */ | ||
"label": PropTypes.string, | ||
/** The callback function that sets a column's filter value. */ | ||
"onChange": PropTypes.func.isRequired | ||
}; | ||
|
||
ItemTableFilter.defaultProps = { | ||
"label": "" | ||
"label": "" | ||
} |
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