-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated User Management Section #1557
Updated User Management Section #1557
Conversation
…and added New user button
Want to review this pull request? Take a look at this documentation for a step by step guide! From your project repository, check out a new branch and test the changes.
|
@spiteless just want to know your views on the recent changes, also if you can direct me to some examples for styling those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this going!
Use sx
or MUI system properties to style the boxes/buttons/button groups. I've added inline suggestions to help with some of the changes :)
import '../../sass/UserAdmin.scss'; | ||
|
||
const h3sx = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to bring in this object, the default styling is fine for this page
@@ -44,64 +55,77 @@ const UserManagement = ({ users, setUserToEdit }) => { | |||
return ( | |||
<div className="container--usermanagement"> | |||
<div> | |||
<h3>User Management</h3> | |||
<input | |||
<Typography variant='h3' sx={h3sx}>User Management</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to h1
|
||
<div className="tab-buttons"> | ||
<ButtonGroup> | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change nesting of elements to:
<ButtonGroup>
<Button> etc... </Button>
<Button> etc... </Button>
</ButtonGroup>
From
<ButtonGroup>
<div>
<Button> etc... </Button>
</div>
<div>
<Button> etc... </Button>
</div>
</ButtonGroup>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the nesting will allow the buttons to display in a pill shape as per the figma file
} | ||
variant='secondary' | ||
onClick={buttonSwap} | ||
disabled={searchResultType === 'name'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop disable prop, it's okay if these are clicked even if one is already selected
? 'select-button selected' | ||
: 'select-button' | ||
} | ||
variant='secondary' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change variant prop to secondary
or contained
based on the same ternamery in className
:
variant={
searchResultType === 'name'
? 'contained'
: 'secondary'
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contained
is the active button state, secondary
is the inactive button state
type="text" | ||
placeholder="Search by name and email..." | ||
value={searchTerm} | ||
onChange={handleChange} | ||
/> | ||
<div className="tab-buttons"> | ||
<Box> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to steal from other components in the project already:
This section with rendered users is similar to the results from the Project Management
page:
( this is actully pulled from the return of ValidatedTextField
, but its styling can be viewed from the Project Management page )
<Box sx={{ bgcolor: '#F5F5F5', my: 3 }}>
<Box sx={{ py: 2, px: 4, ...childrenBoxSx }}>
{children} {/* This is where searchRuslts.map() would go /*}
</Box>
</Box>
@spiteless please check the recent styling changes, and the screenshots are updated as well. |
…r the buttons and changed the color of the button text
@spiteless tried adding breakpoints to the button element, I guess the branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming together nicely!
Please update a few things:
- Change all
div
toBox
- Remove any width statement that is greater than
100%
- Give those elements
margin
orpadding
instead
(This is because a larger width than 100% will mess with the box model making maintenence down the line more complicated)
- Give those elements
- Remove commented out objects or objects that aren't bening used
- the
h3sx
object - the empty
sx
prop in theBox
- the
Great work! I'm stoked to get this merged.
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
width: '75%', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few other comments in here about width
being used. This is another case where I'd prefer to see the boundaries of the box maintained by margin
or padding
eg:
sx={{
mx: 2 // This is just an example value
// mx being mui's system for marginLeft and marginRight
}}
If we do need to limit the width of this Box, I'd prefer we go with a maxWidth
property so that the size is properly restrained on wider screens.
…ve numerical value to borderRadius
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested some changes to help out with width and spacing.
There's a few occurances of things like px: "0.5rem"
that would be better served using MUI's spacing system and numerical units. Would you mind updating those? My appologies if this is getting tedious.
Also requested a few width: 1/1
or width: "100%
s to make sure a Box or two are inhereting the width properly from their parent element. Thanks for removing the non-100% values!
…ock element and provided width 1/1
@spiteless hope you aren't asleep, review whenever you want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, looks good to me!
Fixes #1478
What changes did you make and why did you make them ?
Add a New User
button as per the designScreenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Visuals before changes are applied
Visuals after changes are applied