-
Notifications
You must be signed in to change notification settings - Fork 4
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
6 changed files
with
69 additions
and
13 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
39 changes: 39 additions & 0 deletions
39
src/components/TopBar/DeveloperUtility/Transliteration.tsx
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,39 @@ | ||
import React from 'react'; | ||
import AdjustmentWrapper from './AdjustmentWrapper'; | ||
import { shallow } from 'zustand/shallow'; | ||
import useSettings from '@stores/settingsStore'; | ||
|
||
type Props = {}; | ||
|
||
const Transliteration = (props: Props) => { | ||
const { transliteration, setTransliteration } = useSettings( | ||
(state) => ({ | ||
transliteration: state.transliteration, | ||
setTransliteration: state.setTransliteration, | ||
}), | ||
shallow | ||
); | ||
|
||
return ( | ||
<AdjustmentWrapper title="Transliterasi / Latin"> | ||
<label | ||
htmlFor="default-toggle" | ||
className="inline-flex relative items-center cursor-pointer" | ||
> | ||
<input | ||
defaultChecked={transliteration} | ||
type="checkbox" | ||
value="" | ||
id="default-toggle" | ||
className="sr-only peer" | ||
/> | ||
<div | ||
onClick={() => setTransliteration(!transliteration)} | ||
className="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-emerald-300 dark:peer-focus:ring-slate-500/50 rounded-full peer dark:bg-slate-500 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-emerald-500 after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-white dark:peer-checked:bg-emerald-100" | ||
></div> | ||
</label> | ||
</AdjustmentWrapper> | ||
); | ||
}; | ||
|
||
export default Transliteration; |
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