Skip to content

Commit

Permalink
fix navigation sidebar being too wide for some phones - issue #421 (#590
Browse files Browse the repository at this point in the history
)

* fix navigation sidebar being too wide for some phones, fix bug which caused back method/titles on nav to be wrong after creating account and signing in

* alphabetize consts

* prettier pass
  • Loading branch information
JStein92 authored and zetlen committed Dec 11, 2018
1 parent 661d724 commit 7d4bae2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.createAccountButton {
text-align: center;
margin-top: 2em;
margin: 1rem 0;
}

.rewards {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
transition-property: opacity, transform, visibility;
visibility: hidden;
width: 360px;
width: 100%;
max-width: 360px;
z-index: 3;
}

Expand Down Expand Up @@ -85,6 +86,7 @@
position: absolute;
right: 0;
top: 0;
overflow-y: auto;
}

.signIn_open {
Expand Down
34 changes: 21 additions & 13 deletions packages/venia-concept/src/components/Navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,31 @@ class Navigation extends PureComponent {
} = this;

const { isCreateAccountOpen, isSignInOpen, rootNodeId } = state;
const { classes, closeDrawer, isOpen, rootCategoryId } = props;
const {
classes,
closeDrawer,
isOpen,
isSignedIn,
rootCategoryId
} = props;
const className = isOpen ? classes.root_open : classes.root;
const isTopLevel = !rootNodeId || rootNodeId === rootCategoryId;

const handleBack = isCreateAccountOpen
? hideCreateAccountForm
: isSignInOpen
? hideSignInForm
: isTopLevel
? closeDrawer
: setRootNodeIdToParent;
const handleBack =
isCreateAccountOpen && !isSignedIn
? hideCreateAccountForm
: isSignInOpen && !isSignedIn
? hideSignInForm
: isTopLevel
? closeDrawer
: setRootNodeIdToParent;

const title = isCreateAccountOpen
? 'Create Account'
: isSignInOpen
? 'Sign In'
: 'Main Menu';
const title =
isCreateAccountOpen && !isSignedIn
? 'Create Account'
: isSignInOpen && !isSignedIn
? 'Sign In'
: 'Main Menu';

return (
<aside className={className}>
Expand Down
2 changes: 1 addition & 1 deletion packages/venia-concept/src/components/SignIn/signIn.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.signInButton,
.showCreateAccountButton {
text-align: center;
margin: 1rem 0 0;
margin: 1rem 0;
}

.forgotPassword {
Expand Down

0 comments on commit 7d4bae2

Please sign in to comment.