forked from weaigc/bingo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Switch } from '@headlessui/react'; | ||
import { useAtom } from 'jotai'; | ||
import { sydneyAtom } from '@/state'; | ||
|
||
export function AdvanceSwither({ disabled }: { disabled: boolean }) { | ||
const [enableSydney, switchSydney] = useAtom(sydneyAtom) | ||
return ( | ||
<div className="flex justify-center w-full pb-4"> | ||
<div className="flex gap-2"> | ||
<Switch | ||
disabled={disabled} | ||
checked={enableSydney} | ||
className={`${enableSydney ? 'bg-blue-600' : 'bg-gray-300'} ${disabled ? 'opacity-30 cursor-not-allowed' : ''} relative inline-flex h-6 w-11 items-center rounded-full`} | ||
onChange={(checked: boolean) => switchSydney(checked)} | ||
> | ||
<span | ||
className={`${enableSydney ? 'translate-x-6' : 'translate-x-1'} inline-block h-4 w-4 transform rounded-full bg-white transition`} | ||
/> | ||
</Switch> | ||
启用 Sydney 人格 | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters