mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
20 lines
No EOL
730 B
TypeScript
20 lines
No EOL
730 B
TypeScript
import { faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons"
|
|
import { useTranslation } from "next-i18next"
|
|
import { useDefinedContext } from "../../utils/definedContext"
|
|
import { FestaIcon } from "../extensions/FestaIcon"
|
|
import { PostcardContext } from "../postcard/PostcardContext"
|
|
|
|
export function ToolToggleVisible() {
|
|
const {t} = useTranslation()
|
|
const {visible, setVisible} = useDefinedContext(PostcardContext)
|
|
|
|
return (
|
|
<button
|
|
aria-label={visible ? t("toggleVisibleHide") : t("toggleVisibleShow")}
|
|
onClick={() => setVisible(!visible)}
|
|
className="toolbar-tool"
|
|
>
|
|
<FestaIcon icon={visible ? faEyeSlash : faEye}/>
|
|
</button>
|
|
)
|
|
} |