Skip to content

Commit

Permalink
fix: remove airdrop toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Sep 24, 2024
1 parent a0cfd58 commit 49226e8
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions src/containers/Airdrop/Settings/ToggleAirdropUi.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
import { ToggleSwitch } from '@app/components/elements/ToggleSwitch';
// import { ToggleSwitch } from '@app/components/elements/ToggleSwitch';
import { Wrapper } from './styles';
import { useAirdropStore } from '@app/store/useAirdropStore';
import { useCallback, useRef, useState } from 'react';
// import { useAirdropStore } from '@app/store/useAirdropStore';
// import { useCallback, useRef, useState } from 'react';

export const ToggleAirdropUi = () => {
const { wipUI, setWipUI } = useAirdropStore();
const [disabled, setDisabled] = useState(!wipUI);
const clickCountRef = useRef(0);
// const { wipUI, setWipUI } = useAirdropStore();
// const [disabled, setDisabled] = useState(!wipUI);
// const clickCountRef = useRef(0);

const toggleWipUI = useCallback(() => {
if (disabled) {
if (clickCountRef.current > 9) {
setDisabled(false);
} else {
clickCountRef.current = clickCountRef.current + 1;
return;
}
}
setWipUI(!wipUI);
}, [disabled, setWipUI, wipUI]);
// const toggleWipUI = useCallback(() => {
// if (disabled) {
// if (clickCountRef.current > 9) {
// setDisabled(false);
// } else {
// clickCountRef.current = clickCountRef.current + 1;
// return;
// }
// }
// setWipUI(!wipUI);
// }, [disabled, setWipUI, wipUI]);

return (
<Wrapper>
<ToggleSwitch label="Enable Airdrop UI" checked={wipUI} onChange={toggleWipUI} />
</Wrapper>
);
return <Wrapper>{/* <ToggleSwitch label="Enable Airdrop UI" checked={wipUI} onChange={toggleWipUI} /> */}</Wrapper>;
};

0 comments on commit 49226e8

Please sign in to comment.