community-platform
community-platform copied to clipboard
[refactor] Remove direct usage of Theme from "EventsCreate.tsx"
Remove the following
// TODO: Remove direct usage of Theme
import { preciousPlasticTheme } from 'oa-themes'
const theme = preciousPlasticTheme.styles
At the moment we are importing the theme object directly and accessing its style properties. We should avoid doing this and instead make use of sx
property available on all ThemeUI components to load these values out of the theme definition.
Read more about it here:
The
sx
prop lets you add any valid CSS to an element, while using values from your theme to keep styles consistent. You can think of the style object that thesx
prop accepts as a superset of CSS. https://theme-ui.com/sx-prop
The aim should be for there to be no visual differences. However there may be circumstances where this would introduce better visual consistency across the UI. Feel free to reach out on Discord if you think you have found one of those scenarios.
Here's an example where the same change has been made, although I would call out that this specific file required more work than most 🤗 https://github.com/ONEARMY/community-platform/pull/2282
Hey @thisislawatts , I would like to work on this.
Great thanks @samyabrata-maji! Please go for it. Let me know if you have any further questions.
@samyabrata-maji how are you getting on with this one? would you like to stay assigned to the ticket?
can i complete this issue
@bagiyal that would be great
thanks @bagiyal, will assign you to the ticket 🚀
will try to work on it !!
@iSCJT can you check in pull request ✅
This was actually already handled in #2462 by @BaltacMihai