konstantinmuenster / gatsby-theme-portfolio-minimal

A Gatsby Theme to create modern one-page portfolios with a clean yet expressive design.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making a toggle switch button for dark theme/light theme constant in the footer

bhuwan1998 opened this issue · comments

I want to create a toggle switch using a component and add it to the footer so its easier to switch between the themes. Can someone suggest anyway it can implemented in this gatsby theme

Hey @bhuwan1998, you'd have to override the Footer component which you find here: https://github.com/konstantinmuenster/gatsby-theme-portfolio-minimal/blob/main/gatsby-theme-portfolio-minimal/src/components/Footer/index.tsx

You can learn more about theme shadowing and overriding components in Gatsby's documentation: https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/shadowing

Hey @bhuwan1998, you'd have to override the Footer component which you find here: https://github.com/konstantinmuenster/gatsby-theme-portfolio-minimal/blob/main/gatsby-theme-portfolio-minimal/src/components/Footer/index.tsx

You can learn more about theme shadowing and overriding components in Gatsby's documentation: https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/shadowing

Thanks I will try that

Anyone got the code for this implementation? I know how to shadow it, but I don't know all the files needed to change to make this work, I'm new to JS and react

@hnsmchl If you want to include the toggle in the Footer, you'd only need to shadow and adapt the Footer component 👍