11import styled , { css } from 'styled-components' ;
22import Link from 'src/components/link' ;
3- import { Transition , FlexRow , hexa , zIndex } from '../../components/globals' ;
4- import Avatar from '../../components/avatar' ;
3+ import { Transition , FlexRow , hexa , zIndex } from 'src/components/globals' ;
4+ import Avatar from 'src/components/avatar' ;
5+ import { isDesktopApp } from 'src/helpers/is-desktop-app' ;
56
67export const Nav = styled . nav `
78 display: grid;
89 grid-template-columns: repeat(4, auto) 1fr repeat(2, auto);
910 grid-template-rows: 1fr;
1011 grid-template-areas: 'logo home messages explore . notifications profile';
1112 align-items: stretch;
12- padding: 0 32px;
1313 width: 100%;
14- flex: 0 0 48px;
14+ flex: 0 0 ${ isDesktopApp ( ) ? '38px' : ' 48px' } ;
1515 padding: 0 16px;
1616 line-height: 1;
1717 box-shadow: 0 4px 8px ${ ( { theme } ) => hexa ( theme . bg . reverse , 0.15 ) } ;
1818 z-index: ${ zIndex . navBar } ;
19+ ${ isDesktopApp ( ) &&
20+ css `
21+ -webkit-app-region: drag;
22+ user-select: none;
23+ ` }
1924 background: ${ ( { theme } ) =>
2025 process . env . NODE_ENV === 'production' ? theme . bg . reverse : theme . warn . alt } ;
2126
@@ -51,17 +56,17 @@ export const Nav = styled.nav`
5156 grid-template-areas: 'home explore support pricing';
5257 }
5358 ` } ${ props =>
54- props . hideOnMobile &&
55- css `
56- @media (max-width: 768px) {
57- display: none;
58- }
59- ` } ;
59+ props . hideOnMobile &&
60+ css `
61+ @media (max-width: 768px) {
62+ display: none;
63+ }
64+ ` } ;
6065` ;
6166
6267export const Label = styled . span `
6368 font-size: 14px;
64- font-weight: 700;
69+ font-weight: ${ isDesktopApp ( ) ? '500' : ' 700' } ;
6570 margin-left: 12px;
6671
6772 ${ props =>
@@ -87,7 +92,7 @@ export const Tab = styled(Link)`
8792 grid-template-areas: 'icon label';
8893 align-items: center;
8994 justify-items: center;
90- padding: 0 16px;
95+ padding: ${ isDesktopApp ( ) ? '0 12px' : '0 16px' } ;
9196 color: ${ ( { theme } ) =>
9297 process . env . NODE_ENV === 'production'
9398 ? theme . text . placeholder
@@ -104,20 +109,26 @@ export const Tab = styled(Link)`
104109
105110 @media (min-width: 768px) {
106111 &[data-active~='true'] {
107- box-shadow: inset 0 -4px 0 ${ ( { theme } ) => theme . text . reverse } ;
112+ box-shadow: inset 0 ${ isDesktopApp ( ) ? '-2px' : '-4px' } 0
113+ ${ ( { theme } ) => theme . text . reverse } ;
108114 color: ${ props => props . theme . text . reverse } ;
109115 transition: ${ Transition . hover . on } ;
110116
111117 &:hover,
112118 &:focus {
113- box-shadow: inset 0 -6px 0 ${ ( { theme } ) => theme . text . reverse } ;
119+ box-shadow: inset 0 ${ isDesktopApp ( ) ? '-2px' : '-4px' } 0
120+ ${ ( { theme } ) => theme . text . reverse } ;
114121 transition: ${ Transition . hover . on } ;
115122 }
116123 }
117124
118125 &:hover,
119126 &:focus {
120- box-shadow: inset 0 -4px 0 ${ ( { theme } ) => ( process . env . NODE_ENV === 'production' ? theme . text . placeholder : theme . warn . border ) } ;
127+ box-shadow: inset 0 ${ isDesktopApp ( ) ? '-2px' : '-4px' } 0
128+ ${ ( { theme } ) =>
129+ process . env . NODE_ENV === 'production'
130+ ? theme . text . placeholder
131+ : theme . warn . border } ;
121132 color: ${ props => props . theme . text . reverse } ;
122133 transition: ${ Transition . hover . on } ;
123134 }
@@ -200,11 +211,14 @@ export const DropTab = styled(FlexRow)`
200211
201212export const Logo = styled ( Tab ) `
202213 grid-area: logo;
203- padding: 0 24px 0 4px;
214+ padding: ${ isDesktopApp ( ) ? '0 32px 0 4px' : '0 24px 0 4px' } ;
204215 color: ${ ( { theme } ) => theme . text . reverse } ;
205216 opacity: 1;
206217
207- &:hover {
218+ ${ isDesktopApp ( ) &&
219+ css `
220+ visibility: hidden;
221+ ` } &:hover {
208222 box-shadow: none;
209223 }
210224
0 commit comments