Skip to content

Commit

Permalink
fix: center svg and fix scrolling behavior closes #165 (#171)
Browse files Browse the repository at this point in the history
* fix: center svg and fix scrolling behavior closes #165

* chore: align other button
  • Loading branch information
vpicone authored Jun 14, 2019
1 parent 2fef9cc commit 18257db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
@import '~carbon-components/scss/globals/scss/vars';
@import '~carbon-components/scss/globals/scss/layout';

header.header button {
display: flex;
justify-content: center;
align-items: center;
svg {
margin-top: 0;
}
}

header.header {
transition: top $duration--fast-02;
background-color: $ui-05;
Expand All @@ -12,6 +21,8 @@ header.header {
top: -48px;
}

.icon svg {
margin-top: 2px;
button.icon {
display: flex;
justify-content: center;
align-items: center;
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import React, { useContext } from 'react';
import cx from 'classnames';
import NavContext from '../../util/context/NavContext';
import { useScrollDirection } from '../../util/hooks';
import { nav, open, divider, link, linkDisabled } from './Switcher.module.scss';

const Switcher = ({ children }) => {
const { switcherIsOpen, toggleNavState } = useContext(NavContext);
const direction = useScrollDirection();

if (direction === 'down' && switcherIsOpen) {
toggleNavState('switcherIsOpen', 'close');
}
const { switcherIsOpen } = useContext(NavContext);

return (
<nav
Expand Down

1 comment on commit 18257db

@vercel
Copy link

@vercel vercel bot commented on 18257db Jun 14, 2019

Choose a reason for hiding this comment

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

Please sign in to comment.