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

fix navigation sidebar being too wide for some phones - issue #421 #590

Merged
merged 10 commits into from
Dec 11, 2018
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