Skip to content

Commit

Permalink
Make page not jumpy on initial load
Browse files Browse the repository at this point in the history
By showing side nav even if scene has not loaded.

This fixes #3020
  • Loading branch information
macobo committed Feb 8, 2021
1 parent a997f3a commit 61603ad
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions frontend/src/scenes/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function _App(): JSX.Element | null {
) : null
}

if (!scene || sceneConfig.plain) {
if (sceneConfig.plain) {
return (
<Layout style={{ minHeight: '100vh' }}>
{!sceneConfig.hideTopNav && <TopNavigation />}
Expand All @@ -119,25 +119,27 @@ function _App(): JSX.Element | null {
<MainNavigation />
<Layout className={`${sceneConfig.dark ? 'bg-mid' : ''}`} style={{ minHeight: '100vh' }}>
{!sceneConfig.hideTopNav && <TopNavigation />}
<Layout.Content className="main-app-content" data-attr="layout-content">
{!sceneConfig.hideDemoWarnings && <DemoWarning />}
{scene ? (
<Layout.Content className="main-app-content" data-attr="layout-content">
{!sceneConfig.hideDemoWarnings && <DemoWarning />}

{!featureFlags['hide-billing-toolbar'] && <BillingToolbar />}
<BackTo />
{currentTeam && !sceneConfig.hideDemoWarnings && !currentTeam.ingested_event && (
<Alert
type="warning"
style={{ marginTop: '1rem' }}
message={
<>
You haven't sent any events to this project yet. Grab{' '}
<Link to="/project/settings">a snippet or library</Link> to get started!
</>
}
/>
)}
<SceneComponent user={user} {...params} />
</Layout.Content>
{!featureFlags['hide-billing-toolbar'] && <BillingToolbar />}
<BackTo />
{currentTeam && !sceneConfig.hideDemoWarnings && !currentTeam.ingested_event && (
<Alert
type="warning"
style={{ marginTop: '1rem' }}
message={
<>
You haven't sent any events to this project yet. Grab{' '}
<Link to="/project/settings">a snippet or library</Link> to get started!
</>
}
/>
)}
<SceneComponent user={user} {...params} />
</Layout.Content>
) : null}
</Layout>
{essentialElements}
</Layout>
Expand Down

0 comments on commit 61603ad

Please sign in to comment.