Skip to content

Commit

Permalink
chore(3000): remove main-app-content
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Dec 27, 2023
1 parent 885d319 commit 9bf54ca
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 162 deletions.
4 changes: 0 additions & 4 deletions frontend/src/layout/ErrorBoundary/ErrorBoundary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
background: var(--danger-highlight);
border-radius: var(--radius);

.main-app-content > & {
margin: 1.5rem 0;
}

h2 {
margin-bottom: 0.75rem;
font-weight: 600;
Expand Down
70 changes: 0 additions & 70 deletions frontend/src/layout/navigation/Navigation.stories.tsx

This file was deleted.

36 changes: 4 additions & 32 deletions frontend/src/layout/navigation/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,9 @@
import clsx from 'clsx'
import { BillingAlertsV2 } from 'lib/components/BillingAlertsV2'
import { ReactNode } from 'react'
import { SceneConfig } from 'scenes/sceneTypes'

import { ProjectNotice } from './ProjectNotice'
import { SideBar } from './SideBar/SideBar'

export function Navigation({
children,
sceneConfig,
}: {
children: ReactNode
sceneConfig: SceneConfig | null
}): JSX.Element {
export function Navigation(): JSX.Element {
return (
<div className="h-screen flex flex-col">
<SideBar>
<div
className={clsx(
'main-app-content',
sceneConfig?.layout === 'plain' && 'main-app-content--plain',
sceneConfig?.layout === 'app-container' && 'main-app-content--container'
)}
>
{sceneConfig?.layout !== 'plain' && (
<>
<BillingAlertsV2 />
{!sceneConfig?.hideProjectNotice && <ProjectNotice />}
</>
)}
{children}
</div>
</SideBar>
</div>
<SideBar>
<div />
</SideBar>
)
}
30 changes: 0 additions & 30 deletions frontend/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -452,36 +452,6 @@ input::-ms-clear {
}
}

.main-app-content {
position: relative; // So that scene-level <SpinnerOverlay /> is positioned correctly.
flex: 1;
width: 100%;
min-width: 0;
padding: 0 1rem 1rem;
background-color: var(--bg-light);

&.main-app-content--plain {
padding: 0;
}

&.main-app-content--container {
align-self: center;
max-width: 72rem;

@include screen($xxl) {
max-width: 108rem;
}
}

@include screen($sm) {
padding: 0 1rem 2rem;
}

@include screen($lg) {
padding: 0 2rem 4rem;
}
}

// AntD overrrides, placed inside `body` to increase specifity (nicely avoiding the need for !important)
body {
// Until we have 3000 rolled out we fallback to standard colors
Expand Down
2 changes: 1 addition & 1 deletion playwright/e2e-vrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ We're using Playwright to run visual regression tests against Storybook. To crea

- Suggested Storybook container elements:
- `#root` for components and
- `.main-app-content` for scenes
- `main` for scenes

3. Generate the reference images (you need to have Storybook running locally, i.e. on the Docker host machine):

Expand Down
19 changes: 0 additions & 19 deletions playwright/e2e-vrt/layout/Navigation.spec.ts

This file was deleted.

Binary file not shown.
Binary file not shown.
6 changes: 0 additions & 6 deletions playwright/pages/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ type ComponentScreenshotConfig = {

export class StorybookStoryPage {
readonly page: Page
readonly mainAppContent: Locator
readonly storyRoot: Locator

constructor(page: Page) {
this.page = page
this.mainAppContent = page.locator('.main-app-content')
this.storyRoot = page.locator('#storybook-root')
}

Expand All @@ -41,10 +39,6 @@ export class StorybookStoryPage {
await expect(this.page).toHaveScreenshot({ maxDiffPixelRatio: 0.01 })
}

async expectSceneScreenshot(): Promise<void> {
await expect(this.mainAppContent).toHaveScreenshot({ maxDiffPixelRatio: 0.01 })
}

async expectComponentScreenshot({ pseudo } = {} as ComponentScreenshotConfig): Promise<void> {
const pseudoClasses = Object.entries(pseudo || {}).flatMap(([state, enabled]) => {
return enabled ? `pseudo-${PSEUDO_STATES[state]}` : []
Expand Down

0 comments on commit 9bf54ca

Please sign in to comment.