GSoC 2022 | Score Lab | Week 10 | React Email project updates
Hi, welcome to the GSoC’22 Blogs Index 9 - the tenth blog of the series where I am documenting my complete journey as a contributor (Student Developer) from Day zero to the end date for Google Summer of Code 2022. Hope you will like the series, so let’s get started.
By the way, if you haven’t checked out the previous blog, then you can go through it here: Week 9 Blog
Today I’m going to share the work which I have done this week and the overall project updates from 15th August to 21st August (week 10, Sprint J).
Provide support for default and custom Theme
Setting up a way to provide users to use dynamic customized theme was one of the toughest tasks of the whole project. Material UI provides a way to configure your theme and use the ThemeProvider
to pass your custom theme object which will be applied to the whole application. All of the components and layout will then pick up and adopt the styles according to the given theme. We also needed something which will serve the same approach.
To solve this, initially, I thought of different approaches. But finally, I went with using the React Context to pass the theme configurations to the components which will be available throughout the layout.
Now you can define your own custom theme for the different components and pass that to the Email component using the theme prop. You can also use the useTheme
hook to get the theme options for any particular component. You’ll also get the ThemeOptions
interface for the theme object.
This task also helped to introduce styled-components. There is one predefined styling (defaultTheme) already available which can be overwritten as per the users’ needs.
Related issue: #88
Merged Pull Request: #89
Tasks for the upcoming week:
- Add snapshot testing using storybookjs/test-runner
- Add Docusaurus for docs
- Add deploy config and scripts
- Implement default styles for styled components
- Validate the compatibility of the generated HTML
That’s it for this week’s updates. Thanks for being there till now, hope you’re enjoying the blogs. I’ll try to improve my blogs and add more and more information in very simple ways in the future, so please stay tuned and follow me on Medium.
Also, don’t forget to drop a star on the project GitHub repo! ⭐
You can connect with me on LinkedIn, also don’t forget to give this blog a clap if you have liked it.
Additionally, you can follow me on GitHub and Twitter, it will be appreciated.