UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

90 lines (80 loc) 2.86 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var React = require('react'); var React__default = _interopDefault(React); var styled = require('styled-components'); var styled__default = _interopDefault(styled); var useScrollPosition = require('../../../../hooks/useScrollPosition.js'); /** * @file index.tsx * * @fileoverview Main navigation for the website / header. */ const StyledFixedNavblock = styled__default.div ` width: 100%; border-bottom-width: ${props => props.theme.navigation.borderWidth}; border-bottom-style: ${props => props.theme.navigation.borderStyle}; border-bottom-color: ${props => props.theme.navigation.borderColor}; box-shadow: ${props => props.theme.navigation.boxShadow}; background: ${props => props.theme.navigation.background}; ${props => props.theme.mediaQueries.small} { border-width: 0; box-shadow: none; background: transparent; position: absolute; top: 0; left: 0; z-index: 100; ${props => props.scrollPosition > props.theme.navigation.fixed.scrollingShowHeader ? ` position: fixed; border-bottom-width: ${props.theme.navigation.borderWidth}; border-bottom-style: ${props.theme.navigation.borderStyle}; border-bottom-color: ${props.theme.navigation.borderColor}; box-shadow: ${props.theme.navigation.boxShadow}; background: ${props.theme.navigation.background}; ` : ` a { color: ${props.theme.navigation.fixed.linksColor}; } `}; } img { max-height: ${props => props.theme.navigation.logoMaxHeight}; width: auto; } a { margin-left: 0.5rem; margin-right: 0.5rem; } `; const StyledFixedNavContainer = styled__default.div ` align-items: center; display: flex; justify-content: space-between; margin: 0px auto; padding: ${props => props.theme.navigation.paddingMobile}; ${props => props.theme.mediaQueries.small} { padding: ${props => props.theme.navigation.padding}; } max-width: ${props => props.theme.navigation.maxWidth ? props.theme.layout.maxWidth[props.theme.navigation.maxWidth] : 'none'}; position: relative; z-index: 2; @media (min-width: ${props => props.theme.layout.maxWidth}) { flex-direction: row; } `; /** * Main site navigation / header. Should be used to include the main navigation for the site and * branding of the website. */ const FixedNavbar = ({ children }) => { const scrollY = useScrollPosition.useScrollYPosition(); return (React__default.createElement(StyledFixedNavblock, { scrollPosition: scrollY, "data-testid": "fixed-navbar" }, React__default.createElement(StyledFixedNavContainer, null, children))); }; exports.FixedNavbar = FixedNavbar;