siddharthkp / react-ui

Customisable components and primitives based on design tokens
https://react-ui.dev/
418 stars 53 forks source link

Persist theme in localstrorage #91

Open jsrikrishna11 opened 4 years ago

jsrikrishna11 commented 4 years ago

After choosing a theme other than the default theme which is 'light'. If I refresh the page, the page theme is being reset to 'light'. This is because, on reload it is calling useState('light')again.

Is it even an issue?

rubenmoya commented 4 years ago

It would be nice if it kept the configuration that the user chose.

Go for it!

iamdarshshah commented 4 years ago

Yes, We can store the current theme in local-storage (when a user visits the website it will be set tolight by default) and we can update it as per the user convenience.

Thus, When a user visits the site theme will be set as per the user's selected theme (by default it will be set to light).

jsrikrishna11 commented 4 years ago

I would like to work on it, unless some else took it up. Let me know :)

siddharthkp commented 4 years ago

@jsrikrishna11 Go for it :)