Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ede9890

Browse files
committedApr 14, 2022
PROD-1607 #comment fix responsive header #time 30m
1 parent c4582db commit ede9890

File tree

2 files changed

+55
-54
lines changed

2 files changed

+55
-54
lines changed
 

‎src/components/NavBar/index.jsx

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,53 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
105105
</Link>
106106
)
107107

108+
const renderProfile = !isSelfService
109+
? (
110+
<>
111+
<NotificationsMenu />
112+
<UserMenu
113+
profileUrl={profileUrl}
114+
profile={auth.profile}
115+
hideSwitchTools={hideSwitchTools}
116+
/>
117+
</>
118+
)
119+
: (
120+
<ProfileSelector
121+
initialized={auth.isInitialized}
122+
profile={auth.profile}
123+
workPath={workPath}
124+
/>
125+
)
126+
127+
const renderLogin = (
128+
<a href={loginUrl} className="navbar-login">
129+
Log in
130+
</a>
131+
)
132+
133+
const renderSignup = (
134+
<Button
135+
href={signupUrl}
136+
className="navbar-signup"
137+
type={BUTTON_TYPE.SECONDARY}
138+
>
139+
SIGN UP
140+
</Button>
141+
)
142+
const renderNotLoggedIn = !isSelfService
143+
? renderLogin
144+
: (isMobile
145+
? renderSignup
146+
: (
147+
<>
148+
{renderLogin}
149+
{renderSignup}
150+
</>
151+
)
152+
)
153+
154+
108155
return (
109156
<div className="navbar">
110157
<div className="navbar-left">
@@ -134,22 +181,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
134181
{isMobile ? (
135182
<Fragment>
136183
{auth.isInitialized &&
137-
(auth.tokenV3 ? (
138-
auth.profile && (
139-
<Fragment>
140-
<NotificationsMenu />
141-
<UserMenu
142-
profileUrl={profileUrl}
143-
profile={auth.profile}
144-
hideSwitchTools={hideSwitchTools}
145-
/>
146-
</Fragment>
147-
)
148-
) : (
149-
<a href={loginUrl} className="navbar-login">
150-
Login
151-
</a>
152-
))}
184+
(auth.tokenV3 ? (auth.profile && (renderProfile)) : (renderNotLoggedIn))}
153185
</Fragment>
154186
) : (
155187
<Fragment>
@@ -160,44 +192,7 @@ const NavBar = ({ hideSwitchTools, profileUrl }) => {
160192
</Fragment>
161193
)}
162194
{auth.isInitialized &&
163-
(auth.tokenV3 ? (
164-
auth.profile && (
165-
<Fragment>
166-
{!isSelfService && (
167-
<>
168-
<NotificationsMenu />
169-
<UserMenu
170-
profileUrl={profileUrl}
171-
profile={auth.profile}
172-
hideSwitchTools={hideSwitchTools}
173-
/>
174-
</>
175-
)}
176-
{isSelfService && (
177-
<ProfileSelector
178-
initialized={auth.isInitialized}
179-
profile={auth.profile}
180-
workPath={workPath}
181-
/>
182-
)}
183-
</Fragment>
184-
)
185-
) : (
186-
<Fragment>
187-
<a href={loginUrl} className="navbar-login">
188-
Login
189-
</a>
190-
{isSelfService && (
191-
<Button
192-
href={signupUrl}
193-
className="navbar-signup"
194-
type={BUTTON_TYPE.SECONDARY}
195-
>
196-
SIGN UP
197-
</Button>
198-
)}
199-
</Fragment>
200-
))}
195+
(auth.tokenV3 ? (auth.profile && (renderProfile)) : (renderNotLoggedIn))}
201196
</Fragment>
202197
)}
203198
</div>

‎src/components/NavBar/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
margin-top: -3px;
1818
}
1919

20+
@media (max-width: 1023px) {
21+
.navbar .logo-no-link {
22+
margin-top: 0;
23+
}
24+
}
25+
2026
.navbar-left {
2127
display: flex;
2228
flex-direction: row;

0 commit comments

Comments
 (0)
This repository has been archived.