Skip to content

Commit 92a2698

Browse files
committed
Improve users list
1 parent f7e4dcd commit 92a2698

File tree

3 files changed

+35
-45
lines changed

3 files changed

+35
-45
lines changed

README.md

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,42 +49,8 @@ Your app is ready to be deployed!
4949

5050
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
5151

52-
### `yarn eject`
5352

54-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
5553

56-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
54+
### ToDo:
5755

58-
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
59-
60-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
61-
62-
## Learn More
63-
64-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
65-
66-
To learn React, check out the [React documentation](https://reactjs.org/).
67-
68-
### Code Splitting
69-
70-
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
71-
72-
### Analyzing the Bundle Size
73-
74-
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
75-
76-
### Making a Progressive Web App
77-
78-
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
79-
80-
### Advanced Configuration
81-
82-
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
83-
84-
### Deployment
85-
86-
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
87-
88-
### `yarn build` fails to minify
89-
90-
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
56+
- Migrate mocks to https://github.com/mswjs/msw

src/Administration/Users/UsersList/UsersListActions.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
// ArrowDropDown as IconDropDown,
1010
Add as IconNew,
1111
Search as IconSearch,
12+
Clear as IconClear,
1213
} from '@material-ui/icons'
1314

1415
// import usersListContext from './usersListContext'
@@ -22,32 +23,43 @@ const DashboardActions = () => {
2223
setSearch(event.target.value)
2324
}
2425

26+
const handelClickSearchClearButton = () => {
27+
setSearch('')
28+
}
29+
2530
return (
2631
<div className={classes.root}>
2732
<div className={classes.search}>
2833
<div className={classes.searchIcon}>
2934
<IconSearch />
3035
</div>
3136
<InputBase
32-
placeholder="Search…"
37+
placeholder="Search users…"
3338
classes={{
3439
root: classes.searchInputRoot,
35-
input: clsx(
36-
classes.searchInputInput,
37-
search && classes.searchInputInputActive,
38-
),
40+
input: clsx(classes.searchInputInput, search && '-active'),
3941
}}
4042
inputProps={{ 'aria-label': 'search' }}
43+
value={search}
4144
onChange={handleChangeSearchInput}
4245
/>
46+
{search && (
47+
<div className={classes.searchButtonClear}>
48+
<Tooltip title="Clear search">
49+
<Button color="secondary" onClick={handelClickSearchClearButton}>
50+
<IconClear />
51+
</Button>
52+
</Tooltip>
53+
</div>
54+
)}
4355
</div>
44-
<Tooltip title="Create new">
56+
<Tooltip title="Create new user">
4557
<Button color="secondary">
4658
<IconNew className={classes.iconNew} />
4759
New
4860
</Button>
4961
</Tooltip>
50-
<Tooltip title="Filter">
62+
<Tooltip title="Filter users">
5163
<Button color="secondary">
5264
<IconFilter />
5365
</Button>
@@ -63,7 +75,8 @@ const DashboardActions = () => {
6375

6476
const useStyles = makeStyles(theme => ({
6577
root: {
66-
color: theme.palette.secondary.main,
78+
// color: theme.palette.secondary.main,
79+
color: theme.palette.grey[600],
6780
},
6881
iconNew: {
6982
marginRight: 5,
@@ -93,18 +106,28 @@ const useStyles = makeStyles(theme => ({
93106
alignItems: 'center',
94107
justifyContent: 'center',
95108
},
109+
searchButtonClear: {
110+
position: 'absolute',
111+
height: '100%',
112+
top: 0,
113+
right: 0,
114+
display: 'flex',
115+
alignItems: 'center',
116+
justifyContent: 'center',
117+
},
96118
searchInputRoot: {
97119
color: 'inherit',
98120
},
99121
searchInputInput: {
100122
padding: theme.spacing(1, 1, 1, 0),
101123
// vertical padding + font size from searchIcon
102124
paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,
125+
paddingRight: '2.2em',
103126
transition: theme.transitions.create('width'),
104127
width: '100%',
105128
[theme.breakpoints.up('sm')]: {
106129
width: '12ch',
107-
'&:focus, &.active': {
130+
'&:focus, &.-active': {
108131
width: '20ch',
109132
},
110133
},

src/_common/BasePageToolbar/BasePageToolbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const useStyles = makeStyles(theme =>
5959
},
6060
titleContainer: {},
6161
actionsContainer: {
62+
color: theme.palette.grey[600],
6263
display: 'flex',
6364
justifyContent: 'flex-end',
6465
},

0 commit comments

Comments
 (0)