feat: toggle switch

This commit is contained in:
2023-10-18 11:13:11 +01:00
parent a081f9655e
commit 0e0d768eec
5 changed files with 53 additions and 7 deletions

View File

@ -22,6 +22,7 @@ import { ZapTarget } from "Zapper";
import { useNoteCreator } from "State/NoteCreator";
import { NoteBroadcaster } from "./NoteBroadcaster";
import FileUploadProgress from "./FileUpload";
import { ToggleSwitch } from "Icons/Toggle";
export function NoteCreator() {
const { formatMessage } = useIntl();
@ -343,9 +344,6 @@ export function NoteCreator() {
function noteCreatorAdvanced() {
return (
<>
<button className="secondary" onClick={loadPreview}>
<FormattedMessage defaultMessage="Toggle Preview" />
</button>
<div>
<h4>
<FormattedMessage defaultMessage="Custom Relays" />
@ -468,6 +466,11 @@ export function NoteCreator() {
className={classNames("note-creator-icon", { active: note.advanced })}
/>
<FormattedMessage defaultMessage="Preview" />
<ToggleSwitch
onClick={() => loadPreview()}
size={40}
className={classNames({ active: Boolean(note.preview) })}
/>
</div>
<div className="flex g8">
<button className="secondary" onClick={cancel}>