Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PORTALS-3306: New Publications Component #1400

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

@kianamcc kianamcc marked this pull request as ready for review November 21, 2024 19:51
@nickgros
Copy link
Collaborator

My suggestion:

In the ELITE portal project, add the following component:

import { ThemeOptions, ThemeProvider, useTheme } from '@mui/material'
import { DeepPartial } from 'synapse-react-client'
import { deepmerge } from '@mui/utils' // <-- I think you might have to add this to package.json

export function HomePageThemeProvider({ children }: React.PropsWithChildren) {
  const theme = useTheme()
  const homePageOverrides: DeepPartial<ThemeOptions> = {
    typography: {
      headline1: {
        fontFamily: "'Merriweather', serif",
      },
      headline2: {
        fontFamily: "'Merriweather', serif",
      },
    },
  }
  const mergedTheme = deepmerge(theme, homePageOverrides)

  return <ThemeProvider theme={mergedTheme}>{children}</ThemeProvider>
}

Then in the ELITE portal home page route, you can do:

      { index: true, element: <HomePageThemeProvider><HomePage /></HomePageThemeProvider> },

I'm ok with adding new typography variants homepageHeadline1 etc. if they actually need to be different on the home page. But if we just need a drop-in replacement, then I think this would work fine and look as expected on other portals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants