Second round of formatting
This commit is contained in:
@@ -360,28 +360,27 @@ export const CommandPalette = (): JSX.Element => {
|
||||
<CommandInput placeholder="Type a command or search..." />
|
||||
<CommandList>
|
||||
<CommandEmpty>No results found.</CommandEmpty>
|
||||
{groups.map((group, index) => (
|
||||
<CommandGroup key={index} heading={group.label}>
|
||||
{group.commands.map((command, index) => (
|
||||
<div key={index}>
|
||||
{groups.map((group) => (
|
||||
<CommandGroup key={group.label} heading={group.label}>
|
||||
{group.commands.map((command) => (
|
||||
<div key={command.label}>
|
||||
<CommandItem
|
||||
onSelect={() => {
|
||||
command.action && command.action();
|
||||
command.action?.();
|
||||
setCommandPaletteOpen(false);
|
||||
}}
|
||||
>
|
||||
<command.icon size={16} className="mr-2" />
|
||||
{command.label}
|
||||
</CommandItem>
|
||||
{command.subItems &&
|
||||
command.subItems.map((subItem, index) => (
|
||||
<SubItem
|
||||
key={index}
|
||||
label={subItem.label}
|
||||
icon={subItem.icon}
|
||||
action={subItem.action}
|
||||
/>
|
||||
))}
|
||||
{command.subItems?.map((subItem) => (
|
||||
<SubItem
|
||||
key={subItem.label}
|
||||
label={subItem.label}
|
||||
icon={subItem.icon}
|
||||
action={subItem.action}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</CommandGroup>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { useAppStore } from "@app/core/stores/appStore.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import {
|
||||
PlusIcon,
|
||||
ListPlusIcon,
|
||||
UsersIcon,
|
||||
MapPinIcon,
|
||||
CalendarIcon,
|
||||
BluetoothIcon,
|
||||
UsbIcon,
|
||||
NetworkIcon,
|
||||
} from "lucide-react";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import { H3 } from "@components/UI/Typography/H3.js";
|
||||
import { useDeviceStore } from "@app/core/stores/deviceStore.js";
|
||||
import { useMemo } from "react";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Separator } from "@components/UI/Seperator.js";
|
||||
import { H3 } from "@components/UI/Typography/H3.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import {
|
||||
BluetoothIcon,
|
||||
CalendarIcon,
|
||||
ListPlusIcon,
|
||||
MapPinIcon,
|
||||
NetworkIcon,
|
||||
PlusIcon,
|
||||
UsbIcon,
|
||||
UsersIcon,
|
||||
} from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
|
||||
export const Dashboard = () => {
|
||||
const { setConnectDialogOpen } = useAppStore();
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { DeviceSelectorButton } from "./DeviceSelectorButton.js";
|
||||
import { Separator } from "@components/UI/Seperator.js";
|
||||
import { Code } from "@components/UI/Typography/Code.js";
|
||||
import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||
import {
|
||||
PlusIcon,
|
||||
GithubIcon,
|
||||
HomeIcon,
|
||||
LanguagesIcon,
|
||||
SunIcon,
|
||||
MoonIcon,
|
||||
GithubIcon,
|
||||
PlusIcon,
|
||||
SunIcon,
|
||||
TerminalIcon,
|
||||
} from "lucide-react";
|
||||
import { Separator } from "@components/UI/Seperator.js";
|
||||
import { Code } from "@components/UI/Typography/Code.js";
|
||||
import { DeviceSelectorButton } from "./DeviceSelectorButton.js";
|
||||
|
||||
export const DeviceSelector = (): JSX.Element => {
|
||||
const { getDevices } = useDeviceStore();
|
||||
@@ -53,6 +53,7 @@ export const DeviceSelector = (): JSX.Element => {
|
||||
))}
|
||||
<Separator />
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setConnectDialogOpen(true)}
|
||||
className="transition-all duration-300 hover:text-accent"
|
||||
>
|
||||
@@ -62,18 +63,20 @@ export const DeviceSelector = (): JSX.Element => {
|
||||
</div>
|
||||
<div className="flex w-20 flex-col items-center space-y-5 bg-transparent px-5 pb-5">
|
||||
<button
|
||||
type="button"
|
||||
className="transition-all hover:text-accent"
|
||||
onClick={() => setDarkMode(!darkMode)}
|
||||
>
|
||||
{darkMode ? <SunIcon /> : <MoonIcon />}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="transition-all hover:text-accent"
|
||||
onClick={() => setCommandPaletteOpen(true)}
|
||||
>
|
||||
<TerminalIcon />
|
||||
</button>
|
||||
<button className="transition-all hover:text-accent">
|
||||
<button type="button" className="transition-all hover:text-accent">
|
||||
<LanguagesIcon />
|
||||
</button>
|
||||
<Separator />
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -7,11 +8,10 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { Label } from "@components/UI/Label.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { useForm } from "react-hook-form";
|
||||
|
||||
export interface User {
|
||||
longName: string;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { DeviceNameDialog } from "./DeviceNameDialog.js";
|
||||
import { ImportDialog } from "@components/Dialog/ImportDialog.js";
|
||||
import { QRDialog } from "@components/Dialog/QRDialog.js";
|
||||
import { RebootDialog } from "@components/Dialog/RebootDialog.js";
|
||||
import { ShutdownDialog } from "@components/Dialog/ShutdownDialog.js";
|
||||
import { ImportDialog } from "@components/Dialog/ImportDialog.js";
|
||||
import { DeviceNameDialog } from "./DeviceNameDialog.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
|
||||
export const DialogManager = (): JSX.Element => {
|
||||
const { channels, config, dialog, setDialogOpen } = useDevice();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { toByteArray } from "base64-js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Checkbox } from "@components/UI/Checkbox.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -10,11 +8,13 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { Switch } from "@components/UI/Switch.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { Label } from "@components/UI/Label.js";
|
||||
import { Switch } from "@components/UI/Switch.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { toByteArray } from "base64-js";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export interface ImportDialogProps {
|
||||
open: boolean;
|
||||
@@ -120,14 +120,14 @@ export const ImportDialog = ({
|
||||
Channels:
|
||||
</span>
|
||||
<div className="flex w-40 flex-col gap-1">
|
||||
{channelSet?.settings.map((channel, index) => (
|
||||
<div className="flex justify-between" key={index}>
|
||||
{channelSet?.settings.map((channel) => (
|
||||
<div className="flex justify-between" key={channel.id}>
|
||||
<Label>
|
||||
{channel.name.length
|
||||
? channel.name
|
||||
: `Channel: ${channel.id}`}
|
||||
</Label>
|
||||
<Checkbox key={index} />
|
||||
<Checkbox key={channel.id} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { BLE } from "../PageComponents/Connect/BLE.js";
|
||||
import { HTTP } from "../PageComponents/Connect/HTTP.js";
|
||||
import { Serial } from "../PageComponents/Connect/Serial.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -11,11 +14,8 @@ import {
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
} from "@components/UI/Tabs.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import { Link } from "@components/UI/Typography/Link.js";
|
||||
import { HTTP } from "../PageComponents/Connect/HTTP.js";
|
||||
import { BLE } from "../PageComponents/Connect/BLE.js";
|
||||
import { Serial } from "../PageComponents/Connect/Serial.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { fromByteArray } from "base64-js";
|
||||
import { QRCode } from "react-qrcode-logo";
|
||||
import { Checkbox } from "@components/UI/Checkbox.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -11,9 +7,13 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
import { ClipboardIcon } from "lucide-react";
|
||||
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { Label } from "@components/UI/Label.js";
|
||||
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
||||
import { fromByteArray } from "base64-js";
|
||||
import { ClipboardIcon } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { QRCode } from "react-qrcode-logo";
|
||||
|
||||
export interface QRDialogProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -8,9 +7,10 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
import { ClockIcon, RefreshCwIcon } from "lucide-react";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { ClockIcon, RefreshCwIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
export interface RebootDialogProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -7,9 +6,10 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
import { ClockIcon, PowerIcon } from "lucide-react";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { ClockIcon, PowerIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
export interface ShutdownDialogProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import { Button } from "../UI/Button.js";
|
||||
import { DynamicFormField, FieldProps } from "./DynamicFormField.js";
|
||||
import { FieldWrapper } from "./FormWrapper.js";
|
||||
import { H4 } from "@components/UI/Typography/H4.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import {
|
||||
Control,
|
||||
DeepPartial,
|
||||
@@ -6,11 +11,6 @@ import {
|
||||
SubmitHandler,
|
||||
useForm,
|
||||
} from "react-hook-form";
|
||||
import { H4 } from "@components/UI/Typography/H4.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import { DynamicFormField, FieldProps } from "./DynamicFormField.js";
|
||||
import { FieldWrapper } from "./FormWrapper.js";
|
||||
import { Button } from "../UI/Button.js";
|
||||
|
||||
interface DisabledBy<T> {
|
||||
fieldName: Path<T>;
|
||||
@@ -79,9 +79,9 @@ export function DynamicForm<T extends FieldValues>({
|
||||
onChange: handleSubmit(onSubmit),
|
||||
})}
|
||||
>
|
||||
{fieldGroups.map((fieldGroup, index) => (
|
||||
{fieldGroups.map((fieldGroup) => (
|
||||
<div
|
||||
key={index}
|
||||
key={fieldGroup.label}
|
||||
className="space-y-8 divide-y divide-gray-200 sm:space-y-5"
|
||||
>
|
||||
<div>
|
||||
@@ -89,10 +89,10 @@ export function DynamicForm<T extends FieldValues>({
|
||||
<Subtle>{fieldGroup.description}</Subtle>
|
||||
</div>
|
||||
|
||||
{fieldGroup.fields.map((field, index) => (
|
||||
{fieldGroup.fields.map((field) => (
|
||||
<FieldWrapper label={field.label} description={field.description}>
|
||||
<DynamicFormField
|
||||
key={index}
|
||||
key={field.label}
|
||||
field={field}
|
||||
control={control}
|
||||
disabled={isDisabled(field.disabledBy)}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Control, FieldValues } from "react-hook-form";
|
||||
import { GenericInput, InputFieldProps } from "./FormInput.js";
|
||||
import { ToggleFieldProps, ToggleInput } from "./FormToggle.js";
|
||||
import { SelectFieldProps, SelectInput } from "./FormSelect.js";
|
||||
import { ToggleFieldProps, ToggleInput } from "./FormToggle.js";
|
||||
import type { Control, FieldValues } from "react-hook-form";
|
||||
|
||||
export type FieldProps<T> =
|
||||
| InputFieldProps<T>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
import { Input } from "../UI/Input.js";
|
||||
import type {
|
||||
BaseFormBuilderProps,
|
||||
GenericFormElementProps,
|
||||
} from "./DynamicForm.js";
|
||||
import { Input } from "../UI/Input.js";
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
import { Controller, FieldValues } from "react-hook-form";
|
||||
|
||||
export interface InputFieldProps<T> extends BaseFormBuilderProps<T> {
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
import type {
|
||||
BaseFormBuilderProps,
|
||||
GenericFormElementProps,
|
||||
} from "./DynamicForm.js";
|
||||
import { Controller, FieldValues } from "react-hook-form";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -10,6 +5,11 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "../UI/Select.js";
|
||||
import type {
|
||||
BaseFormBuilderProps,
|
||||
GenericFormElementProps,
|
||||
} from "./DynamicForm.js";
|
||||
import { Controller, FieldValues } from "react-hook-form";
|
||||
|
||||
export interface SelectFieldProps<T> extends BaseFormBuilderProps<T> {
|
||||
type: "select" | "multiSelect";
|
||||
@@ -50,8 +50,8 @@ export function SelectInput<T extends FieldValues>({
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{optionsEnumValues.map(([name, value], index) => (
|
||||
<SelectItem key={index} value={value.toString()}>
|
||||
{optionsEnumValues.map(([name, value]) => (
|
||||
<SelectItem key={name} value={value.toString()}>
|
||||
{formatEnumName
|
||||
? name
|
||||
.replace(/_/g, " ")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { fromByteArray, toByteArray } from "base64-js";
|
||||
import type { ChannelValidation } from "@app/validation/channel.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { useToast } from "@core/hooks/useToast.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { fromByteArray, toByteArray } from "base64-js";
|
||||
|
||||
export interface SettingsPanelProps {
|
||||
channel: Protobuf.Channel;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { BluetoothValidation } from "@app/validation/config/bluetooth.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const Bluetooth = (): JSX.Element => {
|
||||
const { config, setWorkingConfig } = useDevice();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { LoRaValidation } from "@app/validation/config/lora.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const LoRa = (): JSX.Element => {
|
||||
const { config, setWorkingConfig } = useDevice();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { NetworkValidation } from "@app/validation/config/network.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const Network = (): JSX.Element => {
|
||||
const { config, setWorkingConfig } = useDevice();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Mono } from "@components/generic/Mono.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Mono } from "@components/generic/Mono.js";
|
||||
import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { Constants, IBLEConnection } from "@meshtastic/meshtasticjs";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
export const BLE = (): JSX.Element => {
|
||||
const [bleDevices, setBleDevices] = useState<BluetoothDevice[]>([]);
|
||||
@@ -35,9 +35,9 @@ export const BLE = (): JSX.Element => {
|
||||
return (
|
||||
<div className="flex w-full flex-col gap-2 p-4">
|
||||
<div className="flex h-48 flex-col gap-2 overflow-y-auto">
|
||||
{bleDevices.map((device, index) => (
|
||||
{bleDevices.map((device) => (
|
||||
<Button
|
||||
key={index}
|
||||
key={device.id}
|
||||
onClick={() => {
|
||||
void onConnect(device);
|
||||
}}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Controller, useForm, useWatch } from "react-hook-form";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { Switch } from "@components/UI/Switch.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { Label } from "@components/UI/Label.js";
|
||||
import { SelectLabel } from "@components/UI/Select.js";
|
||||
import { Switch } from "@components/UI/Switch.js";
|
||||
import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { IHTTPConnection } from "@meshtastic/meshtasticjs";
|
||||
import { Label } from "@components/UI/Label.js";
|
||||
import { SelectLabel } from "@components/UI/Select.js";
|
||||
import { Controller, useForm, useWatch } from "react-hook-form";
|
||||
|
||||
export const HTTP = (): JSX.Element => {
|
||||
const { addDevice } = useDeviceStore();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Mono } from "@components/generic/Mono.js";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Mono } from "@components/generic/Mono.js";
|
||||
import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { ISerialConnection } from "@meshtastic/meshtasticjs";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
export const Serial = (): JSX.Element => {
|
||||
const [serialPorts, setSerialPorts] = useState<SerialPort[]>([]);
|
||||
|
||||
@@ -24,7 +24,7 @@ export const ChannelChat = ({
|
||||
{messages ? (
|
||||
messages.map((message, index) => (
|
||||
<Message
|
||||
key={index}
|
||||
key={message.id}
|
||||
message={message}
|
||||
lastMsgSameUser={
|
||||
index === 0 ? false : messages[index - 1].from === message.from
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
|
||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import {
|
||||
CircleEllipsisIcon,
|
||||
AlertCircleIcon,
|
||||
CheckCircle2Icon,
|
||||
CircleEllipsisIcon,
|
||||
} from "lucide-react";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
|
||||
|
||||
export interface MessageProps {
|
||||
lastMsgSameUser: boolean;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { Input } from "@components/UI/Input.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { SendIcon } from "lucide-react";
|
||||
import type { Types } from "@meshtastic/meshtasticjs";
|
||||
import { Button } from "@components/UI/Button.js";
|
||||
import { SendIcon } from "lucide-react";
|
||||
|
||||
export interface MessageInputProps {
|
||||
to: Types.Destination;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { AudioValidation } from "@app/validation/moduleConfig/audio.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const Audio = (): JSX.Element => {
|
||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { CannedMessageValidation } from "@app/validation/moduleConfig/cannedMessage.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const CannedMessage = (): JSX.Element => {
|
||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ExternalNotificationValidation } from "@app/validation/moduleConfig/externalNotification.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const ExternalNotification = (): JSX.Element => {
|
||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { RangeTestValidation } from "@app/validation/moduleConfig/rangeTest.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const RangeTest = (): JSX.Element => {
|
||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { StoreForwardValidation } from "@app/validation/moduleConfig/storeForward.js";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||
|
||||
export const StoreForward = (): JSX.Element => {
|
||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { cn } from "@app/core/utils/cn.js";
|
||||
import { LucideIcon, AlignLeftIcon } from "lucide-react";
|
||||
import { AlignLeftIcon, LucideIcon } from "lucide-react";
|
||||
|
||||
export interface PageLayoutProps {
|
||||
label: string;
|
||||
@@ -20,7 +20,10 @@ export const PageLayout = ({
|
||||
return (
|
||||
<div className="relative flex h-full w-full flex-col">
|
||||
<div className="flex h-14 shrink-0 border-b-[0.5px] border-slate-300 dark:border-slate-700 md:h-16 md:px-4">
|
||||
<button className="pl-4 transition-all hover:text-accent md:hidden">
|
||||
<button
|
||||
type="button"
|
||||
className="pl-4 transition-all hover:text-accent md:hidden"
|
||||
>
|
||||
<AlignLeftIcon />
|
||||
</button>
|
||||
<div className="flex flex-1 items-center justify-between px-4 md:px-0">
|
||||
@@ -30,6 +33,7 @@ export const PageLayout = ({
|
||||
{actions?.map((action, index) => (
|
||||
<button
|
||||
key={index}
|
||||
type="button"
|
||||
className="transition-all hover:text-accent"
|
||||
onClick={action.onClick}
|
||||
>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
||||
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import type { Page } from "@core/stores/deviceStore.js";
|
||||
import {
|
||||
EditIcon,
|
||||
LayersIcon,
|
||||
LayoutGrid,
|
||||
LucideIcon,
|
||||
MapIcon,
|
||||
MessageSquareIcon,
|
||||
SettingsIcon,
|
||||
LayersIcon,
|
||||
UsersIcon,
|
||||
EditIcon,
|
||||
LayoutGrid,
|
||||
} from "lucide-react";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
||||
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
||||
|
||||
export interface SidebarProps {
|
||||
children?: React.ReactNode;
|
||||
@@ -67,6 +67,7 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
|
||||
<Subtle>{myNode?.user?.longName ?? "UNK"}</Subtle>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="transition-all hover:text-accent"
|
||||
onClick={() => setDialogOpen("deviceName", true)}
|
||||
>
|
||||
@@ -75,9 +76,9 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
|
||||
</div>
|
||||
|
||||
<SidebarSection label="Navigation">
|
||||
{pages.map((link, index) => (
|
||||
{pages.map((link) => (
|
||||
<SidebarButton
|
||||
key={index}
|
||||
key={link.name}
|
||||
label={link.name}
|
||||
icon={link.icon}
|
||||
onClick={() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import { VariantProps, cva } from "class-variance-authority";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
@@ -41,6 +41,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant, size, ...props }, ref) => {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
||||
import { Check } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import * as React from "react";
|
||||
import type { DialogProps } from "@radix-ui/react-dialog";
|
||||
import { Command as CommandPrimitive } from "cmdk";
|
||||
import { Search } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
import { Dialog, DialogContent } from "@components/UI/Dialog.js";
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
const Command = React.forwardRef<
|
||||
React.ElementRef<typeof CommandPrimitive>,
|
||||
@@ -21,9 +21,7 @@ const Command = React.forwardRef<
|
||||
));
|
||||
Command.displayName = CommandPrimitive.displayName;
|
||||
|
||||
interface CommandDialogProps extends DialogProps {}
|
||||
|
||||
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
||||
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
||||
return (
|
||||
<Dialog {...props}>
|
||||
<DialogContent className="overflow-hidden p-0 shadow-2xl [&_[dialog-overlay]]:bg-red-100">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||
import { X } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
)}
|
||||
{action && (
|
||||
<button
|
||||
type="button"
|
||||
className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-400 focus:outline-none "
|
||||
onClick={action.onClick}
|
||||
>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as LabelPrimitive from "@radix-ui/react-label";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "react";
|
||||
import * as SelectPrimitive from "@radix-ui/react-select";
|
||||
import { Check, ChevronDown } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
import { Button } from "../Button.js";
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
|
||||
export interface SidebarButtonProps {
|
||||
label: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import * as ToastPrimitives from "@radix-ui/react-toast";
|
||||
import { VariantProps, cva } from "class-variance-authority";
|
||||
import { X } from "lucide-react";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@core/utils/cn.js";
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ export const Table = ({ headings, rows }: TableProps): JSX.Element => {
|
||||
<table className="min-w-full">
|
||||
<thead className="bg-backgroundPrimary text-sm font-semibold text-textPrimary">
|
||||
<tr>
|
||||
{headings.map((heading, index) => (
|
||||
{headings.map((heading) => (
|
||||
<th
|
||||
key={index}
|
||||
key={heading.title}
|
||||
scope="col"
|
||||
className={`py-2 pr-3 pl-6 text-left ${
|
||||
heading.sortable
|
||||
|
||||
Reference in New Issue
Block a user