Skip to content
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

feat: Update sidebar, fix mobile responsiveness #5209

Merged
merged 36 commits into from
Jun 17, 2019

Conversation

mikemurray
Copy link
Member

Impact: minor
Type: feature

Issue

  • Sidebar design is out-of-date with current designs
  • Sidebar isn't closable on mobile

Solution

  • Update sidebar to current design spec
  • Fix mobile responsiveness
  • Make it easier to create toolbars without having to re-implement the same logic over and over

Breaking changes

uiState.isLeftSidebarOpen renamed to uiState.isPrimarySidebarOpen.

Testing

  1. Run the app, and login into the admin
  2. See the new sidebar
  3. Click around
  4. Resize to mobile
  5. Open / close sidebar
  6. With the sidebar open, click on a menu item
  7. The sidebar should close and navigate you to that page
  8. Resize back to desktop
  9. Continue to use the sidebar

Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
…unctions

Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
@mikemurray
Copy link
Member Author

Not quite done, but close.
image

Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
…AppBars

Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
@mikemurray
Copy link
Member Author

@rymorgan @cassytaylor Sort order for items:

  • The top-level items are sorted
  • Shop, Payment, Taxes, Shipping are manually sorted
  • Other items will in whatever order under the sorted ones

image

@mikemurray mikemurray marked this pull request as ready for review June 13, 2019 22:40
@mikemurray mikemurray changed the title [WIP] feat: Update sidebar, fix mobile responsiveness feat: Update sidebar, fix mobile responsiveness Jun 13, 2019
import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles";
import MenuIcon from "mdi-material-ui/Menu";
import { UIContext } from "../../context/UIContext";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this is something that will be used all over the app, should we do some sort of alias for UIContext?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but all of these dashboard components needs to be pulled out of this app a component library. Also, this context is not to be used as a MobX store to store random data. It's only meant for basic UI state to ensure the components for the operator-ui function where ever they may live.

For now, my logic is, only use this context for components of the operator experience (sidebar, main AppBars, core layouts, etc). Don't make use of this context in your components in other packages. Make a component in the in /imports/client/components that makes use of the context. At least until this is in a better home.

{({ isMobile, isPrimarySidebarOpen, onTogglePrimarySidebar }) => {
const toolbarClassName = classNames({
// Add padding to the right when the primary sidebar is open,
// only if we're on desktop. On Mobile the sidebar floats over
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lowercase mobile

"container": {
display: "flex"
},
"leftSidebarOpen": {
paddingLeft: 280 + (theme.spacing.unit * 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other comment, we should make 280 a variable

import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles";
import { i18next } from "/client/api";
import PrimaryAppBar from "../../../../../client/ui/components/PrimaryAppBar/PrimaryAppBar";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this "/imports/client/ui/components/PrimaryAppBar instead of all the ..'s?

Copy link
Member

@kieckhafer kieckhafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reactioncommerce/design @mikemurray Should there be some sort of down arrow here? It took me a few seconds to realize this was a drop down menu, I initially thought that the other settings hadn't loaded correctly.

This could be because I'm so used to the old version though.
Not-found

@kieckhafer
Copy link
Member

This isn't an issue with this PR, but I want to mention it here for further thought / discussion.

I feel the multiple save buttons are confusing, it's hard to know which button / buttons need to be clicked in order to save my changes.
Not-found

Copy link
Member

@kieckhafer kieckhafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few very minor comments, overall this looks / works great!

Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
@mikemurray
Copy link
Member Author

@kieckhafer I don't think it needs it. There are only a few links on the top level, and you'll know when it's open once you see all of the nested items. Also, this is an evolution of the menu, but the revolution may end up moving those options to their own menu altogether.

I defer to what @reactioncommerce/design ultimately wants though.

@mikemurray
Copy link
Member Author

@kieckhafer ready for a re-review

@rymorgan
Copy link
Contributor

rymorgan commented Jun 14, 2019

I don't think the settings expandable navigation needs the arrow.

This isn't an issue with this PR, but I want to mention it here for further thought / discussion.

I feel the multiple save buttons are confusing, it's hard to know which button / buttons need to be clicked in order to save my changes.
Not-found

I agree with the above but think we need to think about this as the system evolves. Maybe whenever it's in the card it needs to say 'update'. Also in general in the design system, the convention should buttons whose actions pertain to the overall view should be on the page or in the top bar. Buttons that pertain to only the info in the card should be in the card.

@kieckhafer kieckhafer merged commit 7157471 into develop Jun 17, 2019
@kieckhafer kieckhafer deleted the feat-mikemurray-update-sidebar-ui branch June 17, 2019 20:02
@jeffcorpuz jeffcorpuz mentioned this pull request Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants