From f5e23af37fbb0d36f9f6c3027054a7f52a3c2c0e Mon Sep 17 00:00:00 2001 From: Fran McDade Date: Thu, 19 Sep 2024 16:42:44 +1000 Subject: [PATCH 1/2] fix: fix brc theme and page styles (#72) --- .../SectionAbout/sectionAbout.styles.ts | 9 +++- .../components/SectionAbout/sectionAbout.tsx | 6 +-- .../components/Section/section.styles.ts | 44 +----------------- .../AnalyticsTools/analyticsTools.styles.ts | 5 ++ .../sectionAnalytics.styles.ts | 5 +- .../SectionBranding/sectionBranding.styles.ts | 8 ---- .../SectionBranding/sectionBranding.tsx | 10 ---- .../components/Questions/questions.styles.ts | 9 ---- .../SectionHelp/sectionHelp.styles.ts | 14 ++---- .../components/Hero/hero.styles.ts | 6 +++ .../components/Hero/hero.tsx | 5 +- .../SectionHero/sectionHero.styles.ts | 19 ++++++-- .../components/SectionHero/sectionHero.tsx | 4 +- .../SectionSubHero/sectionSubHero.styles.ts | 5 +- .../Section/components/Chip/chip.styles.ts | 10 ---- .../SectionBranding/sectionBranding.styles.ts | 9 ---- .../SectionBranding/sectionBranding.tsx | 10 ---- .../components/Hero/hero.styles.ts | 6 +++ .../components/Hero/hero.tsx | 5 +- .../SectionHero/sectionHero.styles.ts | 36 +++++++++++---- .../components/SectionHero/sectionHero.tsx | 4 +- .../components/Section/section.styles.ts | 41 ++++++----------- .../SectionRoadmap/sectionRoadmap.styles.ts | 46 ++++++++++++++----- .../SectionRoadmap/sectionRoadmap.tsx | 20 ++++---- .../SectionSubhero/sectionSubhero.styles.ts | 19 +++----- .../SectionSubhero/sectionSubhero.tsx | 11 +++-- .../components/Section/section.styles.ts | 6 +++ app/theme/common/components.ts | 30 ++++++------ app/theme/theme.ts | 45 +++++++++++------- app/views/AboutView/aboutView.tsx | 2 - app/views/HomeView/homeView.tsx | 2 - app/views/RoadmapView/roadmapView.tsx | 2 - package-lock.json | 6 +-- pages/_app.tsx | 16 +++++-- pages/about/index.tsx | 4 ++ pages/index.tsx | 18 ++++++++ pages/roadmap/index.tsx | 4 ++ types/theme.d.ts | 3 ++ 38 files changed, 255 insertions(+), 249 deletions(-) delete mode 100644 app/components/Home/components/Section/components/SectionBranding/sectionBranding.styles.ts delete mode 100644 app/components/Home/components/Section/components/SectionBranding/sectionBranding.tsx create mode 100644 app/components/Home/components/Section/components/SectionHero/components/Hero/hero.styles.ts rename app/components/Home/components/Section/components/{SectionBranding => SectionHero}/components/Hero/hero.tsx (97%) delete mode 100644 app/components/Layout/components/AppLayout/components/Section/components/Chip/chip.styles.ts delete mode 100644 app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.styles.ts delete mode 100644 app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.tsx create mode 100644 app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.styles.ts rename app/components/Layout/components/AppLayout/components/Section/components/{SectionBranding => SectionHero}/components/Hero/hero.tsx (96%) create mode 100644 app/components/Roadmap/components/Section/section.styles.ts diff --git a/app/components/About/components/Section/components/SectionAbout/sectionAbout.styles.ts b/app/components/About/components/Section/components/SectionAbout/sectionAbout.styles.ts index 8d55f80..f18fe59 100644 --- a/app/components/About/components/Section/components/SectionAbout/sectionAbout.styles.ts +++ b/app/components/About/components/Section/components/SectionAbout/sectionAbout.styles.ts @@ -1,7 +1,12 @@ import styled from "@emotion/styled"; -import { SectionLayout } from "../../section.styles"; +import { + sectionGrid, + sectionLayout, +} from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; -export const StyledSectionLayout = styled(SectionLayout)` +export const SectionLayout = styled.div` + ${sectionLayout}; + ${sectionGrid}; grid-template-columns: 1fr; padding: 98px 16px; diff --git a/app/components/About/components/Section/components/SectionAbout/sectionAbout.tsx b/app/components/About/components/Section/components/SectionAbout/sectionAbout.tsx index 1cd0f3a..e6f292e 100644 --- a/app/components/About/components/Section/components/SectionAbout/sectionAbout.tsx +++ b/app/components/About/components/Section/components/SectionAbout/sectionAbout.tsx @@ -1,13 +1,13 @@ import { AboutContent } from "../../../../content"; import { Section } from "../../section.styles"; -import { StyledSectionLayout } from "./sectionAbout.styles"; +import { SectionLayout } from "./sectionAbout.styles"; export const SectionAbout = (): JSX.Element => { return (
- + - +
); }; diff --git a/app/components/About/components/Section/section.styles.ts b/app/components/About/components/Section/section.styles.ts index f2c5bb8..bad4b62 100644 --- a/app/components/About/components/Section/section.styles.ts +++ b/app/components/About/components/Section/section.styles.ts @@ -1,46 +1,6 @@ -import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints"; -import { white } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import styled from "@emotion/styled"; -import { - sectionGrid, - SectionLayout as DefaultLayout, -} from "../../../Layout/components/AppLayout/components/Section/section.styles"; +import { sectionSubHero } from "../../../Layout/components/AppLayout/components/Section/section.styles"; export const Section = styled.section` - background-color: ${white}; - position: relative; - width: 100%; - z-index: 1; -`; - -export const SectionLayout = styled(DefaultLayout)` - ${sectionGrid}; -`; - -export const SubHeadline = styled.div` - display: flex; - flex-direction: column; - gap: 8px; - grid-column: 1 / -1; - - ${mediaTabletUp} { - grid-column: 1 / 6; - } -`; - -export const Subhead = styled.h2` - font-size: 40px; - font-weight: 500; - grid-column: 1 / -1; - letter-spacing: -0.4px; - line-height: 48px; - margin: 0; -`; - -export const SectionContent = styled.div` - grid-column: 1 / -1; - - ${mediaTabletUp} { - grid-column: 7 / -1; - } + ${sectionSubHero}; `; diff --git a/app/components/Home/components/Section/components/SectionAnalytics/components/AnalyticsTools/analyticsTools.styles.ts b/app/components/Home/components/Section/components/SectionAnalytics/components/AnalyticsTools/analyticsTools.styles.ts index 392a5f0..5ff26ee 100644 --- a/app/components/Home/components/Section/components/SectionAnalytics/components/AnalyticsTools/analyticsTools.styles.ts +++ b/app/components/Home/components/Section/components/SectionAnalytics/components/AnalyticsTools/analyticsTools.styles.ts @@ -55,6 +55,11 @@ export const StyledCardActions = styled.div` .MuiLink-root { ${textBody500}; color: #035c94; + text-decoration: none; + + &:hover { + text-decoration: underline; + } } `; diff --git a/app/components/Home/components/Section/components/SectionAnalytics/sectionAnalytics.styles.ts b/app/components/Home/components/Section/components/SectionAnalytics/sectionAnalytics.styles.ts index 3e267bf..7bfb6e8 100644 --- a/app/components/Home/components/Section/components/SectionAnalytics/sectionAnalytics.styles.ts +++ b/app/components/Home/components/Section/components/SectionAnalytics/sectionAnalytics.styles.ts @@ -3,7 +3,7 @@ import { smokeMain, } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import styled from "@emotion/styled"; -import { SectionLayout as DefaultLayout } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; +import { sectionLayout } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; import { SectionHeadline } from "../../section.styles"; export const Section = styled.section` @@ -13,7 +13,8 @@ export const Section = styled.section` width: 100%; `; -export const SectionLayout = styled(DefaultLayout)` +export const SectionLayout = styled.div` + ${sectionLayout}; display: flex; flex-direction: column; gap: 48px 16px; diff --git a/app/components/Home/components/Section/components/SectionBranding/sectionBranding.styles.ts b/app/components/Home/components/Section/components/SectionBranding/sectionBranding.styles.ts deleted file mode 100644 index 878a234..0000000 --- a/app/components/Home/components/Section/components/SectionBranding/sectionBranding.styles.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { smokeLightest } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; -import styled from "@emotion/styled"; - -export const Section = styled.section` - background-color: ${smokeLightest}; - position: fixed; - z-index: -1; -`; diff --git a/app/components/Home/components/Section/components/SectionBranding/sectionBranding.tsx b/app/components/Home/components/Section/components/SectionBranding/sectionBranding.tsx deleted file mode 100644 index 4f79d02..0000000 --- a/app/components/Home/components/Section/components/SectionBranding/sectionBranding.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Hero } from "./components/Hero/hero"; -import { Section } from "./sectionBranding.styles"; - -export const SectionBranding = (): JSX.Element => { - return ( -
- -
- ); -}; diff --git a/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts b/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts index d6161e9..b3e0276 100644 --- a/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts +++ b/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts @@ -42,14 +42,5 @@ export const StyledAccordion = styled(MAccordion)` color: ${inkLight}; margin: 0; padding: 0 20px 8px; - - .MuiLink-root { - color: #28285b; - text-decoration: underline; - - &:hover { - text-decoration: none; - } - } } ` as typeof MAccordion; diff --git a/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts b/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts index b10b064..f4a3d9f 100644 --- a/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts +++ b/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts @@ -6,7 +6,7 @@ import { import styled from "@emotion/styled"; import { sectionGrid, - SectionLayout as DefaultLayout, + sectionLayout, } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; import { SectionHeadline, @@ -20,7 +20,8 @@ export const Section = styled.section` width: 100%; `; -export const SectionLayout = styled(DefaultLayout)` +export const SectionLayout = styled.div` + ${sectionLayout}; ${sectionGrid}; padding: 85px 16px 150px; `; @@ -42,13 +43,4 @@ export const StyledSectionTitle = styled(SectionTitle)` export const StyledSectionSubTitle = styled(SectionSubtitle)` line-height: 28px; - - .MuiLink-root { - color: #28285b; - text-decoration: underline; - - &:hover { - text-decoration: none; - } - } `; diff --git a/app/components/Home/components/Section/components/SectionHero/components/Hero/hero.styles.ts b/app/components/Home/components/Section/components/SectionHero/components/Hero/hero.styles.ts new file mode 100644 index 0000000..a750eab --- /dev/null +++ b/app/components/Home/components/Section/components/SectionHero/components/Hero/hero.styles.ts @@ -0,0 +1,6 @@ +import styled from "@emotion/styled"; + +export const SVG = styled.svg` + position: absolute; + z-index: -1; +`; diff --git a/app/components/Home/components/Section/components/SectionBranding/components/Hero/hero.tsx b/app/components/Home/components/Section/components/SectionHero/components/Hero/hero.tsx similarity index 97% rename from app/components/Home/components/Section/components/SectionBranding/components/Hero/hero.tsx rename to app/components/Home/components/Section/components/SectionHero/components/Hero/hero.tsx index d495976..17fd3fe 100644 --- a/app/components/Home/components/Section/components/SectionBranding/components/Hero/hero.tsx +++ b/app/components/Home/components/Section/components/SectionHero/components/Hero/hero.tsx @@ -18,6 +18,7 @@ import { CoralPinkCircle } from "../../../../../../../Layout/components/Hero/com import { SmokeCircle } from "../../../../../../../Layout/components/Hero/components/Defs/SmokeCircle/smokeCircle"; import { SmokeRect } from "../../../../../../../Layout/components/Hero/components/Defs/SmokeRect/smokeRect"; import { YellowRect } from "../../../../../../../Layout/components/Hero/components/Defs/YellowRect/yellowRect"; +import { SVG } from "./hero.styles"; export interface HeroProps { gridSize?: number; @@ -29,7 +30,7 @@ export const Hero = ({ height = GRID_SIZE * 3, }: HeroProps): JSX.Element => { return ( - */} - + ); }; diff --git a/app/components/Home/components/Section/components/SectionHero/sectionHero.styles.ts b/app/components/Home/components/Section/components/SectionHero/sectionHero.styles.ts index 071cc85..d2a3fc9 100644 --- a/app/components/Home/components/Section/components/SectionHero/sectionHero.styles.ts +++ b/app/components/Home/components/Section/components/SectionHero/sectionHero.styles.ts @@ -2,15 +2,28 @@ import { mediaDesktopSmallUp, mediaTabletUp, } from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints"; -import { inkLight } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; +import { + inkLight, + smokeLightest, +} from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import { textBodyLarge400 } from "@databiosphere/findable-ui/lib/styles/common/mixins/fonts"; import styled from "@emotion/styled"; import { + section, sectionGrid, - SectionLayout as DefaultLayout, + sectionLayout, } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; -export const SectionLayout = styled(DefaultLayout)` +export const Section = styled.section` + ${section}; + background-color: ${smokeLightest}; + overflow: hidden; + position: relative; /* positions svg */ + z-index: 0; /* section content above svg */ +`; + +export const SectionLayout = styled.div` + ${sectionLayout}; ${sectionGrid}; align-content: flex-end; min-height: 400px; diff --git a/app/components/Home/components/Section/components/SectionHero/sectionHero.tsx b/app/components/Home/components/Section/components/SectionHero/sectionHero.tsx index 9e1100f..a098c2a 100644 --- a/app/components/Home/components/Section/components/SectionHero/sectionHero.tsx +++ b/app/components/Home/components/Section/components/SectionHero/sectionHero.tsx @@ -1,9 +1,10 @@ import { ANCHOR_TARGET } from "@databiosphere/findable-ui/lib/components/Links/common/entities"; import { Button } from "@mui/material"; -import { Section } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; +import { Hero } from "./components/Hero/hero"; import { Head, Headline, + Section, SectionLayout, Subhead, SubHeadline, @@ -13,6 +14,7 @@ import { export const SectionHero = (): JSX.Element => { return (
+ diff --git a/app/components/Home/components/Section/components/SectionSubHero/sectionSubHero.styles.ts b/app/components/Home/components/Section/components/SectionSubHero/sectionSubHero.styles.ts index a8fca09..a02ec0f 100644 --- a/app/components/Home/components/Section/components/SectionSubHero/sectionSubHero.styles.ts +++ b/app/components/Home/components/Section/components/SectionSubHero/sectionSubHero.styles.ts @@ -5,7 +5,7 @@ import { import styled from "@emotion/styled"; import { sectionGrid, - SectionLayout as DefaultLayout, + sectionLayout, } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; export const Section = styled.section` @@ -14,7 +14,8 @@ export const Section = styled.section` width: 100%; `; -export const SectionLayout = styled(DefaultLayout)` +export const SectionLayout = styled.div` + ${sectionLayout}; ${sectionGrid}; grid-template-columns: 1fr; justify-items: center; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/Chip/chip.styles.ts b/app/components/Layout/components/AppLayout/components/Section/components/Chip/chip.styles.ts deleted file mode 100644 index 3356934..0000000 --- a/app/components/Layout/components/AppLayout/components/Section/components/Chip/chip.styles.ts +++ /dev/null @@ -1,10 +0,0 @@ -import styled from "@emotion/styled"; -import { Chip as MChip } from "@mui/material"; - -export const StyledChip = styled(MChip)` - .MuiChip-label { - font-weight: 500; - line-height: 24px; - padding: 0 10px; - } -`; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.styles.ts b/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.styles.ts deleted file mode 100644 index a1ec4f4..0000000 --- a/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.styles.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { smokeLightest } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; -import styled from "@emotion/styled"; - -export const Section = styled.section` - background-color: ${smokeLightest}; - position: fixed; - width: 100%; - z-index: 0; -`; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.tsx b/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.tsx deleted file mode 100644 index 4f79d02..0000000 --- a/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Hero } from "./components/Hero/hero"; -import { Section } from "./sectionBranding.styles"; - -export const SectionBranding = (): JSX.Element => { - return ( -
- -
- ); -}; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.styles.ts b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.styles.ts new file mode 100644 index 0000000..a750eab --- /dev/null +++ b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.styles.ts @@ -0,0 +1,6 @@ +import styled from "@emotion/styled"; + +export const SVG = styled.svg` + position: absolute; + z-index: -1; +`; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/components/Hero/hero.tsx b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.tsx similarity index 96% rename from app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/components/Hero/hero.tsx rename to app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.tsx index 169f590..b418239 100644 --- a/app/components/Layout/components/AppLayout/components/Section/components/SectionBranding/components/Hero/hero.tsx +++ b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/components/Hero/hero.tsx @@ -10,6 +10,7 @@ import { CoralPinkCircle } from "../../../../../../../Hero/components/Defs/Coral import { SmokeCircle } from "../../../../../../../Hero/components/Defs/SmokeCircle/smokeCircle"; import { SmokeRect } from "../../../../../../../Hero/components/Defs/SmokeRect/smokeRect"; import { YellowRect } from "../../../../../../../Hero/components/Defs/YellowRect/yellowRect"; +import { SVG } from "./hero.styles"; export interface HeroProps { gridSize?: number; @@ -21,7 +22,7 @@ export const Hero = ({ height = GRID_SIZE * 1.5, }: HeroProps): JSX.Element => { return ( - ))} - + ); }; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.styles.ts b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.styles.ts index 0e3d228..5e97aad 100644 --- a/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.styles.ts +++ b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.styles.ts @@ -1,19 +1,22 @@ import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints"; -import { inkLight } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; +import { + inkLight, + smokeLightest, +} from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import { textBodyLarge400 } from "@databiosphere/findable-ui/lib/styles/common/mixins/fonts"; import styled from "@emotion/styled"; -import { - sectionGrid, - SectionLayout as DefaultLayout, -} from "../../section.styles"; +import { section, sectionGrid, sectionLayout } from "../../section.styles"; export const Section = styled.section` - position: relative; /* Position relative to allow for z-index stacking */ - width: 100%; - z-index: 1; /* Above the background */ + ${section}; + background-color: ${smokeLightest}; + overflow: hidden; + position: relative; /* positions svg */ + z-index: 0; /* section content above svg */ `; -export const SectionLayout = styled(DefaultLayout)` +export const SectionLayout = styled.div` + ${sectionLayout}; ${sectionGrid}; min-height: 184px; padding: 56px 16px; @@ -26,6 +29,21 @@ export const Headline = styled.div` grid-column: 1 / -1; `; +export const Head = styled.h1` + font-family: "Inter Tight", sans-serif; + font-size: 64px; + font-weight: 500; + letter-spacing: -0.4px; + line-height: 72px; + margin: 0; + + ${mediaTabletUp} { + span { + display: block; + } + } +`; + export const SubHeadline = styled.div` grid-column: 1 / -1; diff --git a/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.tsx b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.tsx index 4bc24c1..aff6432 100644 --- a/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.tsx +++ b/app/components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero.tsx @@ -3,8 +3,9 @@ import { Breadcrumbs, } from "@databiosphere/findable-ui/lib/components/common/Breadcrumbs/breadcrumbs"; import { ReactNode } from "react"; -import { Head } from "../../section.styles"; +import { Hero } from "./components/Hero/hero"; import { + Head, Headline, Section, SectionLayout, @@ -25,6 +26,7 @@ export const SectionHero = ({ }: SectionHeroProps): JSX.Element => { return (
+ diff --git a/app/components/Layout/components/AppLayout/components/Section/section.styles.ts b/app/components/Layout/components/AppLayout/components/Section/section.styles.ts index 5da263b..a4b8b55 100644 --- a/app/components/Layout/components/AppLayout/components/Section/section.styles.ts +++ b/app/components/Layout/components/AppLayout/components/Section/section.styles.ts @@ -1,7 +1,13 @@ -import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints"; +import { + smokeMain, + white, +} from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; +import { ThemeProps } from "@databiosphere/findable-ui/lib/theme/theme"; import { css } from "@emotion/react"; -import styled from "@emotion/styled"; -import { Divider as MDivider } from "@mui/material"; + +export const section = css` + width: 100%; +`; export const sectionGrid = css` display: grid; @@ -9,33 +15,14 @@ export const sectionGrid = css` grid-template-columns: repeat(12, 1fr); `; -export const Section = styled.section` - width: 100%; -`; - -export const SectionLayout = styled.div` +export const sectionLayout = css` box-sizing: content-box; margin: 0 auto; max-width: 1136px; `; -export const Head = styled.h1` - font-family: "Inter Tight", sans-serif; - font-size: 64px; - font-weight: 500; - letter-spacing: -0.4px; - line-height: 72px; - margin: 0; - - ${mediaTabletUp} { - span { - display: block; - } - } -`; - -export const StyledDivider = styled(MDivider)` - margin: 0 auto; - max-width: 1136px; - width: 100%; +export const sectionSubHero = (props: ThemeProps) => css` + ${section}; + background-color: ${white(props)}; + border-top: 1px solid ${smokeMain(props)}; `; diff --git a/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.styles.ts b/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.styles.ts index e08d076..a268baf 100644 --- a/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.styles.ts +++ b/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.styles.ts @@ -1,7 +1,5 @@ -import { - inkLight, - smokeMain, -} from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; +import { mediaTabletUp } from "@databiosphere/findable-ui/lib/styles/common/mixins/breakpoints"; +import { inkLight } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import { textBody500, textBodyLarge4002Lines, @@ -9,16 +7,42 @@ import { } from "@databiosphere/findable-ui/lib/styles/common/mixins/fonts"; import styled from "@emotion/styled"; import { - Section, - SectionLayout, -} from "../../../../../About/components/Section/section.styles"; + sectionGrid, + sectionLayout, +} from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; -export const StyledSection = styled(Section)` - border-top: 1px solid ${smokeMain}; +export const SectionLayout = styled.div` + ${sectionLayout} + ${sectionGrid}; + padding: 96px 16px 98px; `; -export const StyledSectionLayout = styled(SectionLayout)` - padding: 96px 16px 98px; +export const SubHeadline = styled.div` + display: flex; + flex-direction: column; + gap: 8px; + grid-column: 1 / -1; + + ${mediaTabletUp} { + grid-column: 1 / 6; + } +`; + +export const Subhead = styled.h2` + font-size: 40px; + font-weight: 500; + grid-column: 1 / -1; + letter-spacing: -0.4px; + line-height: 48px; + margin: 0; +`; + +export const SectionContent = styled.div` + grid-column: 1 / -1; + + ${mediaTabletUp} { + grid-column: 7 / -1; + } `; export const Category = styled.div` diff --git a/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.tsx b/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.tsx index 1c3e972..011681c 100644 --- a/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.tsx +++ b/app/components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap.tsx @@ -1,22 +1,20 @@ import { Link } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link"; -import { - SectionContent, - Subhead, - SubHeadline, -} from "../../../../../About/components/Section/section.styles"; +import { Section } from "../../section.styles"; import { Category, CategorySubTitle, CategoryText, CategoryTitle, - StyledSection, - StyledSectionLayout, + SectionContent, + SectionLayout, + Subhead, + SubHeadline, } from "./sectionRoadmap.styles"; export const SectionRoadmap = (): JSX.Element => { return ( - - +
+ Development Plan @@ -90,7 +88,7 @@ export const SectionRoadmap = (): JSX.Element => { - - + +
); }; diff --git a/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.styles.ts b/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.styles.ts index 047e82f..1dc190f 100644 --- a/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.styles.ts +++ b/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.styles.ts @@ -1,19 +1,14 @@ -import { - inkLight, - smokeMain, -} from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; +import { inkLight } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import { textBodyLarge4002Lines } from "@databiosphere/findable-ui/lib/styles/common/mixins/fonts"; import styled from "@emotion/styled"; import { - Section, - SectionLayout, -} from "../../../../../About/components/Section/section.styles"; - -export const StyledSection = styled(Section)` - border-top: 1px solid ${smokeMain}; -`; + sectionGrid, + sectionLayout, +} from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; -export const StyledSectionLayout = styled(SectionLayout)` +export const SectionLayout = styled.div` + ${sectionLayout}; + ${sectionGrid}; grid-template-columns: 1fr; padding: 98px 16px; diff --git a/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.tsx b/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.tsx index 129c058..a5539c4 100644 --- a/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.tsx +++ b/app/components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero.tsx @@ -1,10 +1,11 @@ import { StaticImage } from "@databiosphere/findable-ui/lib/components/common/StaticImage/staticImage"; -import { StyledSection, StyledSectionLayout } from "./sectionSubhero.styles"; +import { Section } from "../../section.styles"; +import { SectionLayout } from "./sectionSubhero.styles"; export const SectionSubhero = (): JSX.Element => { return ( - - +
+
The Data integration component will include utilization of existing @@ -24,7 +25,7 @@ export const SectionSubhero = (): JSX.Element => { interactive tutorials that can be used by users of all skill levels from computationally naive experimentalists to system engineers.
- - +
+
); }; diff --git a/app/components/Roadmap/components/Section/section.styles.ts b/app/components/Roadmap/components/Section/section.styles.ts new file mode 100644 index 0000000..bad4b62 --- /dev/null +++ b/app/components/Roadmap/components/Section/section.styles.ts @@ -0,0 +1,6 @@ +import styled from "@emotion/styled"; +import { sectionSubHero } from "../../../Layout/components/AppLayout/components/Section/section.styles"; + +export const Section = styled.section` + ${sectionSubHero}; +`; diff --git a/app/theme/common/components.ts b/app/theme/common/components.ts index cc20841..b09ed71 100644 --- a/app/theme/common/components.ts +++ b/app/theme/common/components.ts @@ -8,25 +8,22 @@ import { Components, Theme } from "@mui/material"; */ export const MuiButton = (theme: Theme): Components["MuiButton"] => { return { - variants: [ - { - props: { color: "hero", variant: "contained" }, - style: { + styleOverrides: { + containedHero: { + boxShadow: `0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`, + color: theme.palette.common.white, + // eslint-disable-next-line sort-keys -- disabling key order for readability + "&:hover": { + backgroundColor: theme.palette.hero.main, boxShadow: `0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`, - color: theme.palette.common.white, - // eslint-disable-next-line sort-keys -- disabling key order for readability - "&:hover": { - backgroundColor: theme.palette.hero.main, - boxShadow: `0px 1px 0px 0px rgba(0, 0, 0, 0.08), 0px -1px 0px 0px rgba(0, 0, 0, 0.20) inset`, - }, - // eslint-disable-next-line sort-keys -- disabling key order for readability - "&:active": { - backgroundColor: theme.palette.hero.main, - boxShadow: "none", - }, + }, + // eslint-disable-next-line sort-keys -- disabling key order for readability + "&:active": { + backgroundColor: theme.palette.hero.main, + boxShadow: "none", }, }, - ], + }, }; }; @@ -40,7 +37,6 @@ export const MuiCssBaseline = (theme: Theme): Components["MuiCssBaseline"] => { styleOverrides: { body: { ...theme.typography[TEXT_BODY_LARGE_400_2_LINES], - backgroundColor: theme.palette.smoke.lightest, }, }, }; diff --git a/app/theme/theme.ts b/app/theme/theme.ts index 5f19de2..4aa16f5 100644 --- a/app/theme/theme.ts +++ b/app/theme/theme.ts @@ -1,24 +1,37 @@ -import { createTheme, Theme } from "@mui/material"; +import { createAppTheme } from "@databiosphere/findable-ui/lib/theme/theme"; +import { createTheme, Theme, ThemeOptions } from "@mui/material"; import { deepmerge } from "@mui/utils"; import * as C from "./common/components"; -import * as P from "./common/palette"; /** * Returns BRC customized theme. - * @param theme -- Base theme + * @param baseThemeOptions - Base theme options. + * @param themeOptions - Custom theme option overrides. * @returns theme with custom theme overrides. */ -export function mergeAppTheme(theme: Theme): Theme { - const appTheme = { ...theme }; - - // Merge palette with hero color. - appTheme.palette = { ...appTheme.palette, hero: P.hero }; - - // Marge custom components. - const components = { - MuiButton: C.MuiButton(appTheme), - MuiCssBaseline: C.MuiCssBaseline(appTheme), - }; - - return createTheme(deepmerge(appTheme, components)); +export function mergeAppTheme( + baseThemeOptions?: ThemeOptions, + themeOptions?: ThemeOptions +): Theme { + // Merge custom options (palette, shadows, typography). + const customOptions = deepmerge(baseThemeOptions, { ...themeOptions }); + // Create base app theme with custom options. + const baseAppTheme = createAppTheme(customOptions); + // Merge app components with base app theme. + const appTheme = createTheme(baseAppTheme, { + components: { + MuiButton: C.MuiButton(baseAppTheme), + MuiCssBaseline: C.MuiCssBaseline(baseAppTheme), + }, + }); + if (themeOptions?.components) { + // Return app theme - with custom component overrides. + return createTheme( + deepmerge(appTheme, { + components: themeOptions.components, + }) + ); + } + // Return app theme. + return appTheme; } diff --git a/app/views/AboutView/aboutView.tsx b/app/views/AboutView/aboutView.tsx index fbb914d..92d8800 100644 --- a/app/views/AboutView/aboutView.tsx +++ b/app/views/AboutView/aboutView.tsx @@ -1,7 +1,6 @@ import { Link } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link"; import { Fragment } from "react"; import { SectionAbout } from "../../components/About/components/Section/components/SectionAbout/sectionAbout"; -import { SectionBranding } from "../../components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding"; import { SectionHero } from "../../components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero"; import { BREADCRUMBS } from "./common/constants"; @@ -25,7 +24,6 @@ export const AboutView = (): JSX.Element => { } /> - ); }; diff --git a/app/views/HomeView/homeView.tsx b/app/views/HomeView/homeView.tsx index b950ff0..16b4d58 100644 --- a/app/views/HomeView/homeView.tsx +++ b/app/views/HomeView/homeView.tsx @@ -1,6 +1,5 @@ import { Fragment } from "react"; import { SectionAnalytics } from "../../components/Home/components/Section/components/SectionAnalytics/sectionAnalytics"; -import { SectionBranding } from "../../components/Home/components/Section/components/SectionBranding/sectionBranding"; import { SectionHelp } from "../../components/Home/components/Section/components/SectionHelp/sectionHelp"; import { SectionHero } from "../../components/Home/components/Section/components/SectionHero/sectionHero"; import { SectionSubHero } from "../../components/Home/components/Section/components/SectionSubHero/sectionSubHero"; @@ -12,7 +11,6 @@ export const HomeView = (): JSX.Element => { - ); }; diff --git a/app/views/RoadmapView/roadmapView.tsx b/app/views/RoadmapView/roadmapView.tsx index 578d903..3bb7de3 100644 --- a/app/views/RoadmapView/roadmapView.tsx +++ b/app/views/RoadmapView/roadmapView.tsx @@ -1,5 +1,4 @@ import { Fragment } from "react"; -import { SectionBranding } from "../../components/Layout/components/AppLayout/components/Section/components/SectionBranding/sectionBranding"; import { SectionHero } from "../../components/Layout/components/AppLayout/components/Section/components/SectionHero/sectionHero"; import { SectionRoadmap } from "../../components/Roadmap/components/Section/components/SectionRoadmap/sectionRoadmap"; import { SectionSubhero } from "../../components/Roadmap/components/Section/components/SectionSubhero/sectionSubhero"; @@ -15,7 +14,6 @@ export const RoadmapView = (): JSX.Element => { /> - ); }; diff --git a/package-lock.json b/package-lock.json index f917788..54090c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,14 @@ { - "name": "brc-analytics-catalog", + "name": "brc-analytics", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "brc-analytics-catalog", + "name": "brc-analytics", "version": "0.1.0", "dependencies": { - "@databiosphere/findable-ui": "^10.2.0", + "@databiosphere/findable-ui": "10.2.0", "@emotion/react": "11.11.1", "@emotion/styled": "11.11.0", "@mdx-js/loader": "^3.0.1", diff --git a/pages/_app.tsx b/pages/_app.tsx index d2134b7..3e99414 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -11,7 +11,6 @@ import { ConfigProvider as DXConfigProvider } from "@databiosphere/findable-ui/l import { ExploreStateProvider } from "@databiosphere/findable-ui/lib/providers/exploreState"; import { LayoutStateProvider } from "@databiosphere/findable-ui/lib/providers/layoutState"; import { SystemStatusProvider } from "@databiosphere/findable-ui/lib/providers/systemStatus"; -import { createAppTheme } from "@databiosphere/findable-ui/lib/theme/theme"; import { DataExplorerError } from "@databiosphere/findable-ui/lib/types/error"; import { ThemeProvider as EmotionThemeProvider } from "@emotion/react"; import { CssBaseline, ThemeProvider } from "@mui/material"; @@ -40,11 +39,18 @@ export type AppPropsWithComponent = AppProps & { function MyApp({ Component, pageProps }: AppPropsWithComponent): JSX.Element { // Set up the site configuration, layout and theme. const appConfig = config(); - const { layout, redirectRootToPath, themeOptions } = appConfig; + const { + layout, + redirectRootToPath, + themeOptions: baseThemeOptions, + } = appConfig; const { floating, footer, header } = layout || {}; - const defaultTheme = createAppTheme(themeOptions); - const appTheme = mergeAppTheme(defaultTheme); - const { entityListType = DEFAULT_ENTITY_LIST_TYPE, pageTitle } = pageProps; + const { + entityListType = DEFAULT_ENTITY_LIST_TYPE, + pageTitle, + themeOptions, + } = pageProps; + const appTheme = mergeAppTheme(baseThemeOptions, themeOptions); const AppLayout = Component.AppLayout || DXAppLayout; const Main = Component.Main || DXMain; return ( diff --git a/pages/about/index.tsx b/pages/about/index.tsx index 142e3c2..06cddc8 100644 --- a/pages/about/index.tsx +++ b/pages/about/index.tsx @@ -1,3 +1,4 @@ +import { smokeLightest } from "@databiosphere/findable-ui/lib/theme/common/palette"; import { GetStaticProps } from "next"; import { StyledPagesMain } from "../../app/components/Layout/components/Main/main.styles"; import { AboutView } from "../../app/views/AboutView/aboutView"; @@ -10,6 +11,9 @@ export const getStaticProps: GetStaticProps = async () => { return { props: { pageTitle: "About", + themeOptions: { + palette: { background: { default: smokeLightest } }, + }, }, }; }; diff --git a/pages/index.tsx b/pages/index.tsx index 4c4a882..6e325d2 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,3 +1,4 @@ +import { smokeLightest } from "@databiosphere/findable-ui/lib/theme/common/palette"; import { GetStaticProps } from "next"; import { StyledMain } from "../app/components/Layout/components/Main/main.styles"; import { HomeView } from "../app/views/HomeView/homeView"; @@ -10,6 +11,23 @@ export const getStaticProps: GetStaticProps = async () => { return { props: { pageTitle: "BRC Analytics", + themeOptions: { + components: { + MuiLink: { + styleOverrides: { + root: { + color: "#28285b", + textDecoration: "underline", + // eslint-disable-next-line sort-keys -- disabling key order for readability + "&:hover": { textDecoration: "none" }, + }, + }, + }, + }, + palette: { + background: { default: smokeLightest }, + }, + }, }, }; }; diff --git a/pages/roadmap/index.tsx b/pages/roadmap/index.tsx index 2973e0d..7c8895f 100644 --- a/pages/roadmap/index.tsx +++ b/pages/roadmap/index.tsx @@ -1,3 +1,4 @@ +import { smokeLightest } from "@databiosphere/findable-ui/lib/theme/common/palette"; import { GetStaticProps } from "next"; import { StyledPagesMain } from "../../app/components/Layout/components/Main/main.styles"; import { RoadmapView } from "../../app/views/RoadmapView/roadmapView"; @@ -10,6 +11,9 @@ export const getStaticProps: GetStaticProps = async () => { return { props: { pageTitle: "Roadmap", + themeOptions: { + palette: { background: { default: smokeLightest } }, + }, }, }; }; diff --git a/types/theme.d.ts b/types/theme.d.ts index 257522a..032f41d 100644 --- a/types/theme.d.ts +++ b/types/theme.d.ts @@ -18,6 +18,9 @@ declare module "@mui/material/styles/createPalette" { * Button prop options. */ declare module "@mui/material/Button" { + interface ButtonClasses { + containedHero: true; + } interface ButtonPropsColorOverrides { hero: true; } From ad5c909d7199cbc2a019b02f6eeca8340d73f4ba Mon Sep 17 00:00:00 2001 From: Fran McDade Date: Thu, 19 Sep 2024 16:58:02 +1000 Subject: [PATCH 2/2] feat: reverted home page link style (#72) --- .../components/Questions/questions.styles.ts | 2 ++ .../components/SectionHelp/sectionHelp.styles.ts | 2 ++ .../Home/components/Section/section.styles.ts | 12 ++++++++++++ pages/index.tsx | 12 ------------ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts b/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts index b3e0276..2896901 100644 --- a/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts +++ b/app/components/Home/components/Section/components/SectionHelp/components/Questions/questions.styles.ts @@ -8,6 +8,7 @@ import { elevation01 } from "@databiosphere/findable-ui/lib/theme/common/shadows import styled from "@emotion/styled"; import { Accordion as MAccordion } from "@mui/material"; import { sectionGrid } from "../../../../../../../Layout/components/AppLayout/components/Section/section.styles"; +import { muiLink } from "../../../../section.styles"; export const Grid = styled.div` ${sectionGrid}; @@ -21,6 +22,7 @@ export const Grid = styled.div` `; export const StyledAccordion = styled(MAccordion)` + ${muiLink}; box-shadow: ${elevation01} !important; display: grid; grid-column: 1 / -1; diff --git a/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts b/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts index f4a3d9f..5351303 100644 --- a/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts +++ b/app/components/Home/components/Section/components/SectionHelp/sectionHelp.styles.ts @@ -9,6 +9,7 @@ import { sectionLayout, } from "../../../../../Layout/components/AppLayout/components/Section/section.styles"; import { + muiLink, SectionHeadline, SectionSubtitle, SectionTitle, @@ -42,5 +43,6 @@ export const StyledSectionTitle = styled(SectionTitle)` `; export const StyledSectionSubTitle = styled(SectionSubtitle)` + ${muiLink}; line-height: 28px; `; diff --git a/app/components/Home/components/Section/section.styles.ts b/app/components/Home/components/Section/section.styles.ts index f0f2610..76ddcac 100644 --- a/app/components/Home/components/Section/section.styles.ts +++ b/app/components/Home/components/Section/section.styles.ts @@ -1,7 +1,19 @@ import { inkLight } from "@databiosphere/findable-ui/lib/styles/common/mixins/colors"; import { textBodyLarge400 } from "@databiosphere/findable-ui/lib/styles/common/mixins/fonts"; +import { css } from "@emotion/react"; import styled from "@emotion/styled"; +export const muiLink = css` + .MuiLink-root { + color: #28285b; + text-decoration: underline; + + &:hover { + text-decoration: none; + } + } +`; + export const SectionHeadline = styled.div` display: grid; gap: 16px; diff --git a/pages/index.tsx b/pages/index.tsx index 6e325d2..19d2c4d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -12,18 +12,6 @@ export const getStaticProps: GetStaticProps = async () => { props: { pageTitle: "BRC Analytics", themeOptions: { - components: { - MuiLink: { - styleOverrides: { - root: { - color: "#28285b", - textDecoration: "underline", - // eslint-disable-next-line sort-keys -- disabling key order for readability - "&:hover": { textDecoration: "none" }, - }, - }, - }, - }, palette: { background: { default: smokeLightest }, },