From 32c3f6a9b648c3ede1ce820748a4a2f3fba41db3 Mon Sep 17 00:00:00 2001 From: Nathan <34570423+thisprojects@users.noreply.github.com> Date: Wed, 26 Apr 2023 23:31:23 +0100 Subject: [PATCH] fix: #2668 Page Vertical Spacing Issues (#2863) * fix: #2668 Page Vertical Spacing Issues * Update test to reflect mobile work * chore: refactor action buttons --------- Co-authored-by: thisProjects Co-authored-by: Gabe Kangas --- .../e2e/offline/01_offline_basic.cy.js | 4 +- .../ChatContainer/ChatContainer.module.scss | 2 + web/components/layouts/Main/Main.module.scss | 5 + web/components/layouts/Main/Main.tsx | 17 +- web/components/ui/Content/ActionButtons.tsx | 88 ++++++++ web/components/ui/Content/Content.module.scss | 130 +++--------- web/components/ui/Content/Content.tsx | 198 ++++++++---------- web/components/ui/Content/DesktopContent.tsx | 4 +- web/components/ui/Content/MobileContent.tsx | 71 +------ web/components/ui/Footer/Footer.module.scss | 11 +- web/components/ui/Header/Header.module.scss | 12 +- .../OfflineBanner/OfflineBanner.module.scss | 10 + web/components/ui/Sidebar/Sidebar.module.scss | 13 +- web/components/ui/Sidebar/Sidebar.tsx | 2 +- .../OwncastPlayer/OwncastPlayer.module.scss | 17 ++ web/styles/mixins.scss | 2 + 16 files changed, 282 insertions(+), 304 deletions(-) create mode 100644 web/components/ui/Content/ActionButtons.tsx diff --git a/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js b/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js index 202054f5e..dc69b8a96 100644 --- a/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js +++ b/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js @@ -15,8 +15,8 @@ describe(`Basic tests`, () => { // Verify the tags show up it('Has correct tags visible', () => { - cy.contains('#owncast').should('be.visible'); - cy.contains('#streaming').should('be.visible'); + cy.contains('#owncast').should('exist'); + cy.contains('#streaming').should('exist'); }); // it('Can open notify modal', () => { diff --git a/web/components/chat/ChatContainer/ChatContainer.module.scss b/web/components/chat/ChatContainer/ChatContainer.module.scss index d3437f6c0..484e4f85f 100644 --- a/web/components/chat/ChatContainer/ChatContainer.module.scss +++ b/web/components/chat/ChatContainer/ChatContainer.module.scss @@ -1,3 +1,5 @@ +@import '../../../styles/mixins.scss'; + // The button that is displayed to scroll to the bottom of the chat. .toBottomWrap { display: flex; diff --git a/web/components/layouts/Main/Main.module.scss b/web/components/layouts/Main/Main.module.scss index 768e2f623..f1f59a9a4 100644 --- a/web/components/layouts/Main/Main.module.scss +++ b/web/components/layouts/Main/Main.module.scss @@ -1,11 +1,16 @@ @import '../../../styles/mixins.scss'; .layout { + // this margin is for fixed header + margin-top: 55px; @include screen(tablet) { position: absolute; top: 0; left: 0; bottom: 0; right: 0; + // this one is for fixed footer + margin-bottom: 30px } + } diff --git a/web/components/layouts/Main/Main.tsx b/web/components/layouts/Main/Main.tsx index e2915843a..7875901d1 100644 --- a/web/components/layouts/Main/Main.tsx +++ b/web/components/layouts/Main/Main.tsx @@ -8,6 +8,7 @@ import { Layout } from 'antd'; import dynamic from 'next/dynamic'; import Script from 'next/script'; import { ErrorBoundary } from 'react-error-boundary'; +import { Footer } from '../../ui/Footer/Footer'; import { ClientConfigStore, isChatAvailableSelector, @@ -30,12 +31,6 @@ import { AppStateOptions } from '../../stores/application-state'; import { Noscript } from '../../ui/Noscript/Noscript'; import { ServerStatus } from '../../../interfaces/server-status.model'; -const lockBodyStyle = ` -body { - overflow: hidden; -} -`; - // Lazy loaded components const FatalErrorStateModal = dynamic( @@ -51,13 +46,13 @@ const FatalErrorStateModal = dynamic( export const Main: FC = () => { const clientConfig = useRecoilValue(clientConfigStateAtom); const clientStatus = useRecoilValue(serverStatusState); - const { name, customStyles } = clientConfig; + const { name } = clientConfig; const isChatAvailable = useRecoilValue(isChatAvailableSelector); const fatalError = useRecoilValue(fatalErrorStateAtom); const appState = useRecoilValue(appStateAtom); const layoutRef = useRef(null); - const { chatDisabled } = clientConfig; + const { chatDisabled, version } = clientConfig; const { videoAvailable } = appState; const { online, streamTitle } = clientStatus; @@ -96,11 +91,6 @@ export const Main: FC = () => { - - @@ -168,6 +158,7 @@ export const Main: FC = () => { {fatalError && ( )} +