mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-16 01:01:38 +00:00
Change dark mode button loading
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
|
import classNames from 'classnames';
|
||||||
import { useTheme } from 'next-themes';
|
import { useTheme } from 'next-themes';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { FiMoon, FiSun, FiHeart } from 'react-icons/fi';
|
import { FiMoon, FiSun } from 'react-icons/fi';
|
||||||
|
|
||||||
const DarkModeBtn = () => {
|
const DarkModeBtn = () => {
|
||||||
const [mounted, setMounted] = useState(false);
|
const [mounted, setMounted] = useState(false);
|
||||||
@ -13,7 +14,12 @@ const DarkModeBtn = () => {
|
|||||||
if (!mounted)
|
if (!mounted)
|
||||||
return (
|
return (
|
||||||
<button>
|
<button>
|
||||||
<FiHeart className="w-5 h-5" />
|
<div
|
||||||
|
className={classNames(
|
||||||
|
'w-5 h-5 rounded-md animate-pulse',
|
||||||
|
'bg-gray-300 dark:bg-gray-500'
|
||||||
|
)}
|
||||||
|
></div>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user