mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-26 04:17:14 +00:00
Remove context for state management
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
import { AiOutlineControl } from 'react-icons/ai';
|
||||
import { useContext } from 'react';
|
||||
import { ThemeContext } from '../../contexts/ThemeContext';
|
||||
import { LoadingContext } from '../../contexts/LoadingContext';
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
import config from '../../ezprofile.config';
|
||||
|
||||
const ThemeChanger = () => {
|
||||
const { theme, setTheme } = useContext(ThemeContext);
|
||||
const { loading } = useContext(LoadingContext);
|
||||
|
||||
console.log(theme);
|
||||
|
||||
const ThemeChanger = ({ theme, setTheme, loading }) => {
|
||||
const changeTheme = (e, selectedTheme) => {
|
||||
e.preventDefault();
|
||||
document.querySelector('html').setAttribute('data-theme', selectedTheme);
|
||||
|
||||
Reference in New Issue
Block a user