biome
This commit is contained in:
@@ -41,10 +41,14 @@ export function GenericInput<T extends FieldValues>({
|
||||
render={({ field: { value, onChange, ...rest } }) => (
|
||||
<Input
|
||||
type={field.type == "password" && passwordShown ? "text" : field.type}
|
||||
action={field.type == "password" ? {
|
||||
icon: passwordShown ? EyeOff : Eye,
|
||||
onClick: togglePasswordVisiblity
|
||||
} : undefined}
|
||||
action={
|
||||
field.type == "password"
|
||||
? {
|
||||
icon: passwordShown ? EyeOff : Eye,
|
||||
onClick: togglePasswordVisiblity,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
step={field.properties?.step}
|
||||
value={field.type === "number" ? Number.parseFloat(value) : value}
|
||||
onChange={(e) => {
|
||||
|
||||
@@ -3,9 +3,9 @@ import type {
|
||||
GenericFormElementProps,
|
||||
} from "@components/Form/DynamicForm.js";
|
||||
import { Generator } from "@components/UI/Generator.js";
|
||||
import { Eye, EyeOff } from "lucide-react";
|
||||
import type { ChangeEventHandler, MouseEventHandler } from "react";
|
||||
import { useState } from "react";
|
||||
import { Eye, EyeOff } from "lucide-react";
|
||||
import { Controller, type FieldValues } from "react-hook-form";
|
||||
|
||||
export interface PasswordGeneratorProps<T> extends BaseFormBuilderProps<T> {
|
||||
@@ -23,7 +23,6 @@ export function PasswordGenerator<T extends FieldValues>({
|
||||
field,
|
||||
disabled,
|
||||
}: GenericFormElementProps<T, PasswordGeneratorProps<T>>) {
|
||||
|
||||
const [passwordShown, setPasswordShown] = useState(false);
|
||||
const togglePasswordVisiblity = () => {
|
||||
setPasswordShown(passwordShown ? false : true);
|
||||
@@ -36,10 +35,14 @@ export function PasswordGenerator<T extends FieldValues>({
|
||||
render={({ field: { value, ...rest } }) => (
|
||||
<Generator
|
||||
type={field.hide && !passwordShown ? "password" : "text"}
|
||||
action={field.hide ? {
|
||||
icon: passwordShown ? EyeOff : Eye,
|
||||
onClick: togglePasswordVisiblity
|
||||
} : undefined}
|
||||
action={
|
||||
field.hide
|
||||
? {
|
||||
icon: passwordShown ? EyeOff : Eye,
|
||||
onClick: togglePasswordVisiblity,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
devicePSKBitCount={field.devicePSKBitCount}
|
||||
bits={field.bits}
|
||||
inputChange={field.inputChange}
|
||||
|
||||
@@ -133,7 +133,7 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
|
||||
buttonClick: clickEvent,
|
||||
hide: true,
|
||||
properties: {
|
||||
value: pass
|
||||
value: pass,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
+1
-1
@@ -99,4 +99,4 @@
|
||||
img {
|
||||
-drag: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export const MessagesPage = (): JSX.Element => {
|
||||
chatType === "broadcast" && currentChannel
|
||||
? getChannelName(currentChannel)
|
||||
: chatType === "direct" && nodes.get(activeChat)
|
||||
? nodes.get(activeChat)?.user?.longName ?? nodeHex
|
||||
? (nodes.get(activeChat)?.user?.longName ?? nodeHex)
|
||||
: "Loading..."
|
||||
}`}
|
||||
actions={
|
||||
|
||||
Reference in New Issue
Block a user