All files / header-navigation styled-components.js

50% Statements 6/12
0% Branches 0/4
33.33% Functions 1/3
50% Lines 6/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62                    1x 1x         1x 1x                   1x                     1x                                              
/*
Copyright (c) 2018-2019 Uber Technologies, Inc.
 
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
// @flow
import {styled} from '../styles/index.js';
import {ALIGN} from './index.js';
 
export const Root = styled<{}>('nav', props => {
  const {$theme} = props;
  const {
    sizing: {scale500},
    typography: {font400},
    colors: {border},
  } = $theme;
  return {
    ...font400,
    display: 'flex',
    paddingBottom: scale500,
    paddingTop: scale500,
    borderBottom: `1px solid ${border}`,
    backgroundColor: $theme.colors.headerNavigationFill,
  };
});
 
export const NavigationItem = styled<{}>('div', props => {
  const {$theme} = props;
  const {
    sizing: {scale800},
  } = $theme;
  return {
    alignSelf: 'center',
    paddingLeft: scale800,
  };
});
 
export const NavigationList = styled<{$align: $Values<typeof ALIGN>}>(
  'div',
  props => {
    const {$align, $theme} = props;
    const {
      sizing: {scale800},
    } = $theme;
    return {
      display: 'flex',
      ':first-child': {
        padding: 0,
      },
      ':last-child': {
        padding: 0,
      },
      flex: $align === ALIGN.right || $align === ALIGN.left ? 'none' : 1,
      paddingLeft: scale800,
      paddingRight: scale800,
      justifySelf: $align,
      justifyContent: $align,
    };
  },
);