community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

[refactor] Remove direct usage of Theme from "EventsCreate.tsx"

Open thisislawatts opened this issue 1 year ago • 3 comments

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 the sx 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

thisislawatts avatar May 02 '23 18:05 thisislawatts

Hey @thisislawatts , I would like to work on this.

sammaji avatar May 12 '23 08:05 sammaji

Great thanks @samyabrata-maji! Please go for it. Let me know if you have any further questions.

thisislawatts avatar May 13 '23 20:05 thisislawatts

@samyabrata-maji how are you getting on with this one? would you like to stay assigned to the ticket?

iSCJT avatar Jun 22 '23 11:06 iSCJT

can i complete this issue

bagiyal avatar Jun 24 '23 04:06 bagiyal

@bagiyal that would be great

sammaji avatar Jun 24 '23 07:06 sammaji

thanks @bagiyal, will assign you to the ticket 🚀

iSCJT avatar Jun 24 '23 09:06 iSCJT

will try to work on it !!

bagiyal avatar Jun 25 '23 06:06 bagiyal

@iSCJT can you check in pull request ✅

bagiyal avatar Jun 26 '23 09:06 bagiyal

This was actually already handled in #2462 by @BaltacMihai

AlfonsoGhislieri avatar Jun 29 '23 11:06 AlfonsoGhislieri