feat: passcode lock in preferences (#644)
* feat: implement existing passcode lock in prefs * chore: cleanup commented code and unused imports * feat: improve design for passcode lock * fix: propert folder naming * feat: passcode lock form buttons margin
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { JSXInternal } from 'preact/src/jsx';
|
||||
import TargetedEvent = JSXInternal.TargetedEvent;
|
||||
import TargetedMouseEvent = JSXInternal.TargetedMouseEvent;
|
||||
|
||||
import { FunctionComponent } from 'preact';
|
||||
|
||||
const baseClass = `rounded px-4 py-1.75 font-bold text-sm fit-content`;
|
||||
@@ -14,7 +18,7 @@ export const Button: FunctionComponent<{
|
||||
className?: string;
|
||||
type: ButtonType;
|
||||
label: string;
|
||||
onClick: () => void;
|
||||
onClick: (event: TargetedEvent<HTMLFormElement> | TargetedMouseEvent<HTMLButtonElement>) => void;
|
||||
disabled?: boolean;
|
||||
}> = ({ type, label, className = '', onClick, disabled = false }) => {
|
||||
const buttonClass = buttonClasses[type];
|
||||
@@ -24,7 +28,7 @@ export const Button: FunctionComponent<{
|
||||
<button
|
||||
className={`${buttonClass} ${cursorClass} ${className}`}
|
||||
onClick={(e) => {
|
||||
onClick();
|
||||
onClick(e);
|
||||
e.preventDefault();
|
||||
}}
|
||||
disabled={disabled}
|
||||
|
||||
Reference in New Issue
Block a user