fix build
This commit is contained in:
@@ -10,12 +10,12 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
Tablist,
|
Tablist,
|
||||||
} from "evergreen-ui";
|
} from "evergreen-ui";
|
||||||
import type { IconType } from "react-icons";
|
|
||||||
import { FiBluetooth, FiTerminal, FiWifi } from "react-icons/fi";
|
import { FiBluetooth, FiTerminal, FiWifi } from "react-icons/fi";
|
||||||
|
|
||||||
import { BLE } from "../connect/BLE.js";
|
import { BLE } from "../connect/BLE.js";
|
||||||
import { HTTP } from "../connect/HTTP.js";
|
import { HTTP } from "../connect/HTTP.js";
|
||||||
import { Serial } from "../connect/Serial.js";
|
import { Serial } from "../connect/Serial.js";
|
||||||
|
import type { TabType } from "../layout/page/TabbedContent.js";
|
||||||
|
|
||||||
export interface NewDeviceProps {
|
export interface NewDeviceProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -28,35 +28,32 @@ export interface CloseProps {
|
|||||||
|
|
||||||
export type connType = "http" | "ble" | "serial";
|
export type connType = "http" | "ble" | "serial";
|
||||||
|
|
||||||
export interface Tab {
|
export interface ConnTab extends Omit<TabType, "element"> {
|
||||||
name: connType;
|
connType: connType;
|
||||||
icon: IconType;
|
|
||||||
displayName: string;
|
|
||||||
element: ({ close }: CloseProps) => JSX.Element;
|
element: ({ close }: CloseProps) => JSX.Element;
|
||||||
disabled?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NewDevice = ({ open, onClose }: NewDeviceProps) => {
|
export const NewDevice = ({ open, onClose }: NewDeviceProps) => {
|
||||||
const [selectedConnType, setSelectedConnType] = useState<connType>("ble");
|
const [selectedConnType, setSelectedConnType] = useState<connType>("ble");
|
||||||
|
|
||||||
const tabs: Tab[] = [
|
const tabs: ConnTab[] = [
|
||||||
{
|
{
|
||||||
name: "ble",
|
connType: "ble",
|
||||||
icon: FiBluetooth,
|
icon: FiBluetooth,
|
||||||
displayName: "BLE",
|
name: "BLE",
|
||||||
element: BLE,
|
element: BLE,
|
||||||
disabled: !navigator.bluetooth,
|
disabled: !navigator.bluetooth,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "http",
|
connType: "http",
|
||||||
icon: FiWifi,
|
icon: FiWifi,
|
||||||
displayName: "HTTP",
|
name: "HTTP",
|
||||||
element: HTTP,
|
element: HTTP,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "serial",
|
connType: "serial",
|
||||||
icon: FiTerminal,
|
icon: FiTerminal,
|
||||||
displayName: "Serial",
|
name: "Serial",
|
||||||
element: Serial,
|
element: Serial,
|
||||||
disabled: !navigator.serial,
|
disabled: !navigator.serial,
|
||||||
},
|
},
|
||||||
@@ -85,13 +82,13 @@ export const NewDevice = ({ open, onClose }: NewDeviceProps) => {
|
|||||||
<Tab
|
<Tab
|
||||||
key={index}
|
key={index}
|
||||||
gap={5}
|
gap={5}
|
||||||
isSelected={selectedConnType === TabData.name}
|
isSelected={selectedConnType === TabData.connType}
|
||||||
onSelect={() => setSelectedConnType(TabData.name)}
|
onSelect={() => setSelectedConnType(TabData.connType)}
|
||||||
disabled={TabData.disabled}
|
disabled={TabData.disabled}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<TabData.icon />
|
<TabData.icon />
|
||||||
{TabData.displayName}
|
{TabData.name}
|
||||||
</>
|
</>
|
||||||
</Tab>
|
</Tab>
|
||||||
))}
|
))}
|
||||||
@@ -106,7 +103,7 @@ export const NewDevice = ({ open, onClose }: NewDeviceProps) => {
|
|||||||
backgroundColor="white"
|
backgroundColor="white"
|
||||||
elevation={1}
|
elevation={1}
|
||||||
flexGrow={1}
|
flexGrow={1}
|
||||||
display={selectedConnType === TabData.name ? "block" : "none"}
|
display={selectedConnType === TabData.connType ? "block" : "none"}
|
||||||
>
|
>
|
||||||
{!TabData.disabled && <TabData.element close={onClose} />}
|
{!TabData.disabled && <TabData.element close={onClose} />}
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import type React from "react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Heading,
|
||||||
|
IconComponent,
|
||||||
|
majorScale,
|
||||||
|
Pane,
|
||||||
|
Paragraph,
|
||||||
|
Tab,
|
||||||
|
Tablist,
|
||||||
|
} from "evergreen-ui";
|
||||||
|
import type { IconType } from "react-icons";
|
||||||
|
|
||||||
|
export interface TabType {
|
||||||
|
name: string;
|
||||||
|
icon: IconComponent | IconType;
|
||||||
|
element: () => JSX.Element;
|
||||||
|
disabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SlideSheetTabbedContentProps {
|
||||||
|
heading: string;
|
||||||
|
description: string;
|
||||||
|
tabs: TabType[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const SlideSheetTabbedContent = ({
|
||||||
|
heading,
|
||||||
|
description,
|
||||||
|
tabs,
|
||||||
|
}: SlideSheetTabbedContentProps): JSX.Element => {
|
||||||
|
const [selectedTab, setSelectedTab] = useState(0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Pane zIndex={1} flexShrink={0} elevation={1} backgroundColor="white">
|
||||||
|
<Pane padding={16} borderBottom="muted">
|
||||||
|
<Heading size={600}>{heading}</Heading>
|
||||||
|
<Paragraph size={400} color="muted">
|
||||||
|
{description}
|
||||||
|
</Paragraph>
|
||||||
|
</Pane>
|
||||||
|
<Pane display="flex" padding={8}>
|
||||||
|
<Tablist>
|
||||||
|
{tabs.map((Entry, index) => (
|
||||||
|
<Tab
|
||||||
|
key={index}
|
||||||
|
userSelect="none"
|
||||||
|
disabled={Entry.disabled}
|
||||||
|
gap={5}
|
||||||
|
onSelect={() => setSelectedTab(index)}
|
||||||
|
isSelected={selectedTab === index}
|
||||||
|
>
|
||||||
|
<Entry.icon />
|
||||||
|
{Entry.name}
|
||||||
|
</Tab>
|
||||||
|
))}
|
||||||
|
</Tablist>
|
||||||
|
</Pane>
|
||||||
|
</Pane>
|
||||||
|
<Pane display="flex" overflowY="scroll" background="tint1" padding={16}>
|
||||||
|
{tabs.map((Entry, index) => (
|
||||||
|
<Pane
|
||||||
|
key={index}
|
||||||
|
borderRadius={majorScale(1)}
|
||||||
|
backgroundColor="white"
|
||||||
|
elevation={1}
|
||||||
|
flexGrow={1}
|
||||||
|
display={selectedTab === index ? "block" : "none"}
|
||||||
|
>
|
||||||
|
{!Entry.disabled && <Entry.element />}
|
||||||
|
</Pane>
|
||||||
|
))}
|
||||||
|
</Pane>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,28 +1,27 @@
|
|||||||
import type React from "react";
|
import type React from "react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
import { IconComponent, majorScale, Pane, Tab, Tablist } from "evergreen-ui";
|
import { IconComponent, majorScale, Pane, Tab, Tablist } from "evergreen-ui";
|
||||||
|
import type { IconType } from "react-icons";
|
||||||
|
|
||||||
export interface Tab {
|
export interface TabType {
|
||||||
key: number;
|
|
||||||
name: string;
|
name: string;
|
||||||
icon: IconComponent;
|
icon: IconComponent | IconType;
|
||||||
element: () => JSX.Element;
|
element: () => JSX.Element;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TabbedContentProps {
|
export interface TabbedContentProps {
|
||||||
active: number;
|
tabs: TabType[];
|
||||||
setActive: (index: number) => void;
|
|
||||||
tabs: Tab[];
|
|
||||||
actions?: (() => JSX.Element)[];
|
actions?: (() => JSX.Element)[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TabbedContent = ({
|
export const TabbedContent = ({
|
||||||
active,
|
|
||||||
setActive,
|
|
||||||
tabs,
|
tabs,
|
||||||
actions,
|
actions,
|
||||||
}: TabbedContentProps): JSX.Element => {
|
}: TabbedContentProps): JSX.Element => {
|
||||||
|
const [selectedTab, setSelectedTab] = useState(0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Pane
|
<Pane
|
||||||
margin={majorScale(3)}
|
margin={majorScale(3)}
|
||||||
@@ -38,13 +37,14 @@ export const TabbedContent = ({
|
|||||||
<Pane borderBottom="muted" paddingBottom={majorScale(2)}>
|
<Pane borderBottom="muted" paddingBottom={majorScale(2)}>
|
||||||
<Pane display="flex">
|
<Pane display="flex">
|
||||||
<Tablist>
|
<Tablist>
|
||||||
{tabs.map((Entry) => (
|
{tabs.map((Entry, index) => (
|
||||||
<Tab
|
<Tab
|
||||||
key={Entry.key}
|
key={index}
|
||||||
|
userSelect="none"
|
||||||
disabled={Entry.disabled}
|
disabled={Entry.disabled}
|
||||||
gap={5}
|
gap={5}
|
||||||
onSelect={() => setActive(Entry.key)}
|
onSelect={() => setSelectedTab(index)}
|
||||||
isSelected={active === Entry.key}
|
isSelected={selectedTab === index}
|
||||||
>
|
>
|
||||||
<Entry.icon />
|
<Entry.icon />
|
||||||
{Entry.name}
|
{Entry.name}
|
||||||
@@ -59,14 +59,14 @@ export const TabbedContent = ({
|
|||||||
</Pane>
|
</Pane>
|
||||||
</Pane>
|
</Pane>
|
||||||
</Pane>
|
</Pane>
|
||||||
{tabs.map((Entry) => (
|
{tabs.map((Entry, index) => (
|
||||||
<Pane
|
<Pane
|
||||||
key={Entry.key}
|
key={index}
|
||||||
display={active === Entry.key ? "flex" : "none"}
|
display={selectedTab === index ? "flex" : "none"}
|
||||||
flexDirection="column"
|
flexDirection="column"
|
||||||
flexGrow={1}
|
flexGrow={1}
|
||||||
>
|
>
|
||||||
<Entry.element />
|
{!Entry.disabled && <Entry.element />}
|
||||||
</Pane>
|
</Pane>
|
||||||
))}
|
))}
|
||||||
</Pane>
|
</Pane>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Button, LayerIcon, LayerOutlineIcon, Tooltip } from "evergreen-ui";
|
|||||||
import { IoQrCodeOutline } from "react-icons/io5";
|
import { IoQrCodeOutline } from "react-icons/io5";
|
||||||
|
|
||||||
import { QRDialog } from "@app/components/Dialog/QRDialog.js";
|
import { QRDialog } from "@app/components/Dialog/QRDialog.js";
|
||||||
import { Tab, TabbedContent } from "@components/layout/page/TabbedContent";
|
import { TabbedContent, TabType } from "@components/layout/page/TabbedContent";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
|
|
||||||
@@ -14,11 +14,9 @@ import { Channel } from "./Channel.js";
|
|||||||
export const ChannelsPage = (): JSX.Element => {
|
export const ChannelsPage = (): JSX.Element => {
|
||||||
const { channels, config } = useDevice();
|
const { channels, config } = useDevice();
|
||||||
const [QRDialogOpen, setQRDialogOpen] = useState(false);
|
const [QRDialogOpen, setQRDialogOpen] = useState(false);
|
||||||
const [activeChannel, setActiveChannel] = useState(0);
|
|
||||||
|
|
||||||
const tabs: Tab[] = channels.map((channel) => {
|
const tabs: TabType[] = channels.map((channel) => {
|
||||||
return {
|
return {
|
||||||
key: channel.config.index,
|
|
||||||
name: channel.config.settings?.name.length
|
name: channel.config.settings?.name.length
|
||||||
? channel.config.settings.name
|
? channel.config.settings.name
|
||||||
: channel.config.role === Protobuf.Channel_Role.PRIMARY
|
: channel.config.role === Protobuf.Channel_Role.PRIMARY
|
||||||
@@ -43,8 +41,6 @@ export const ChannelsPage = (): JSX.Element => {
|
|||||||
loraConfig={config.lora}
|
loraConfig={config.lora}
|
||||||
/>
|
/>
|
||||||
<TabbedContent
|
<TabbedContent
|
||||||
active={activeChannel}
|
|
||||||
setActive={setActiveChannel}
|
|
||||||
tabs={tabs}
|
tabs={tabs}
|
||||||
actions={[
|
actions={[
|
||||||
() => (
|
() => (
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import type React from "react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
import { Pane, Tab, Tablist } from "evergreen-ui";
|
||||||
|
|
||||||
|
import { ExternalNotification } from "@app/components/PageComponents/ModuleConfig/ExternalNotification.js";
|
||||||
|
import { MQTT } from "@components/PageComponents/ModuleConfig/MQTT.js";
|
||||||
|
import { Serial } from "@components/PageComponents/ModuleConfig/Serial.js";
|
||||||
|
|
||||||
|
export const AppConfig = (): JSX.Element => {
|
||||||
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
||||||
|
|
||||||
|
const configSections = [
|
||||||
|
{
|
||||||
|
label: "Interface",
|
||||||
|
element: MQTT,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Logging",
|
||||||
|
element: Serial,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Language",
|
||||||
|
element: ExternalNotification,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Pane display="flex">
|
||||||
|
<Pane flexBasis={150} marginRight={24}>
|
||||||
|
<Tablist>
|
||||||
|
{configSections.map((Config, index) => (
|
||||||
|
<Tab
|
||||||
|
key={index}
|
||||||
|
direction="vertical"
|
||||||
|
isSelected={index === selectedIndex}
|
||||||
|
onSelect={() => setSelectedIndex(index)}
|
||||||
|
>
|
||||||
|
{Config.label}
|
||||||
|
</Tab>
|
||||||
|
))}
|
||||||
|
</Tablist>
|
||||||
|
</Pane>
|
||||||
|
<Pane flex="1">
|
||||||
|
{configSections.map((Config, index) => (
|
||||||
|
<Pane
|
||||||
|
key={index}
|
||||||
|
display={index === selectedIndex ? "block" : "none"}
|
||||||
|
>
|
||||||
|
<Config.element />
|
||||||
|
</Pane>
|
||||||
|
))}
|
||||||
|
</Pane>
|
||||||
|
</Pane>
|
||||||
|
);
|
||||||
|
};
|
||||||
+10
-15
@@ -1,36 +1,31 @@
|
|||||||
import type React from "react";
|
import type React from "react";
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
import { CogIcon, CubeIcon } from "evergreen-ui";
|
import { ApplicationsIcon, CogIcon, CubeIcon } from "evergreen-ui";
|
||||||
|
|
||||||
import { Tab, TabbedContent } from "@components/layout/page/TabbedContent";
|
import { TabbedContent, TabType } from "@components/layout/page/TabbedContent";
|
||||||
|
|
||||||
|
import { AppConfig } from "./AppConfig.js";
|
||||||
import { DeviceConfig } from "./DeviceConfig.js";
|
import { DeviceConfig } from "./DeviceConfig.js";
|
||||||
import { ModuleConfig } from "./ModuleConfig.js";
|
import { ModuleConfig } from "./ModuleConfig.js";
|
||||||
|
|
||||||
export const ConfigPage = (): JSX.Element => {
|
export const ConfigPage = (): JSX.Element => {
|
||||||
const [activeConfig, setActiveConfig] = useState(0);
|
const tabs: TabType[] = [
|
||||||
|
|
||||||
const tabs: Tab[] = [
|
|
||||||
{
|
{
|
||||||
key: 0,
|
|
||||||
name: "Device Config",
|
name: "Device Config",
|
||||||
icon: CogIcon,
|
icon: CogIcon,
|
||||||
element: DeviceConfig,
|
element: DeviceConfig,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 1,
|
|
||||||
name: "Module Config",
|
name: "Module Config",
|
||||||
icon: CubeIcon,
|
icon: CubeIcon,
|
||||||
element: ModuleConfig,
|
element: ModuleConfig,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "App Config",
|
||||||
|
icon: ApplicationsIcon,
|
||||||
|
element: AppConfig,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return <TabbedContent tabs={tabs} />;
|
||||||
<TabbedContent
|
|
||||||
active={activeConfig}
|
|
||||||
setActive={setActiveConfig}
|
|
||||||
tabs={tabs}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,10 +36,7 @@ export const FileBrowser = (): JSX.Element => {
|
|||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
href={`http://meshtastic.local/json/fs/browse/static/${file.name.replace(
|
href={`http://meshtastic.local/${file.name.replace("static/", "")}`}
|
||||||
"static/",
|
|
||||||
""
|
|
||||||
)}`}
|
|
||||||
>
|
>
|
||||||
{file.name.replace("static/", "").replace(".gz", "")}
|
{file.name.replace("static/", "").replace(".gz", "")}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,46 +1,35 @@
|
|||||||
import type React from "react";
|
import type React from "react";
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
import { DocumentIcon, GanttChartIcon, RainIcon } from "evergreen-ui";
|
import { DocumentIcon, GanttChartIcon, RainIcon } from "evergreen-ui";
|
||||||
|
|
||||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||||
import { Tab, TabbedContent } from "@components/layout/page/TabbedContent";
|
import { TabbedContent, TabType } from "@components/layout/page/TabbedContent";
|
||||||
import { FileBrowser } from "@pages/Extensions/FileBrowser";
|
import { FileBrowser } from "@pages/Extensions/FileBrowser";
|
||||||
|
|
||||||
import { Environment } from "./Environment.js";
|
import { Environment } from "./Environment.js";
|
||||||
|
|
||||||
export const ExtensionsPage = (): JSX.Element => {
|
export const ExtensionsPage = (): JSX.Element => {
|
||||||
const [activeExtension, setActiveExtension] = useState(0);
|
|
||||||
const { hardware } = useDevice();
|
const { hardware } = useDevice();
|
||||||
|
|
||||||
const tabs: Tab[] = [
|
const tabs: TabType[] = [
|
||||||
{
|
{
|
||||||
key: 0,
|
|
||||||
name: "File Browser",
|
name: "File Browser",
|
||||||
icon: DocumentIcon,
|
icon: DocumentIcon,
|
||||||
element: FileBrowser,
|
element: FileBrowser,
|
||||||
disabled: !hardware.hasWifi,
|
disabled: !hardware.hasWifi,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 1,
|
|
||||||
name: "Range Test",
|
name: "Range Test",
|
||||||
icon: GanttChartIcon,
|
icon: GanttChartIcon,
|
||||||
element: FileBrowser,
|
element: FileBrowser,
|
||||||
disabled: !hardware.hasWifi,
|
disabled: !hardware.hasWifi,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 2,
|
|
||||||
name: "Environment",
|
name: "Environment",
|
||||||
icon: RainIcon,
|
icon: RainIcon,
|
||||||
element: Environment,
|
element: Environment,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return <TabbedContent tabs={tabs} />;
|
||||||
<TabbedContent
|
|
||||||
active={activeExtension}
|
|
||||||
setActive={setActiveExtension}
|
|
||||||
tabs={tabs}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,10 +28,9 @@ export const ChannelChat = ({ channel }: ChannelChatProps): JSX.Element => {
|
|||||||
currentMessage,
|
currentMessage,
|
||||||
undefined,
|
undefined,
|
||||||
true,
|
true,
|
||||||
channel.config.index, //maybe channel.config.index--
|
channel.config.index,
|
||||||
(id) => {
|
(id) => {
|
||||||
ackMessage(channel.config.index, id), console.log("Got Ack");
|
ackMessage(channel.config.index, id);
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -44,7 +43,7 @@ export const ChannelChat = ({ channel }: ChannelChatProps): JSX.Element => {
|
|||||||
{channel.messages.map((message, index) => (
|
{channel.messages.map((message, index) => (
|
||||||
<Message
|
<Message
|
||||||
key={index}
|
key={index}
|
||||||
message={message.message.data}
|
messagePacket={message.message}
|
||||||
ack={message.ack}
|
ack={message.ack}
|
||||||
rxTime={message.received}
|
rxTime={message.received}
|
||||||
lastMsgSameUser={
|
lastMsgSameUser={
|
||||||
|
|||||||
@@ -9,18 +9,20 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
} from "evergreen-ui";
|
} from "evergreen-ui";
|
||||||
|
|
||||||
import { Tab, TabbedContent } from "@components/layout/page/TabbedContent.js";
|
import {
|
||||||
|
TabbedContent,
|
||||||
|
TabType,
|
||||||
|
} from "@components/layout/page/TabbedContent.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
|
|
||||||
import { ChannelChat } from "./ChannelChat.js";
|
import { ChannelChat } from "./ChannelChat.js";
|
||||||
|
|
||||||
export const MessagesPage = (): JSX.Element => {
|
export const MessagesPage = (): JSX.Element => {
|
||||||
const { channels, activeChat, setActiveChat, setActivePage } = useDevice();
|
const { channels, setActivePage } = useDevice();
|
||||||
|
|
||||||
const tabs: Tab[] = channels.map((channel) => {
|
const tabs: TabType[] = channels.map((channel) => {
|
||||||
return {
|
return {
|
||||||
key: channel.config.index,
|
|
||||||
name: channel.config.settings?.name.length
|
name: channel.config.settings?.name.length
|
||||||
? channel.config.settings?.name
|
? channel.config.settings?.name
|
||||||
: channel.config.index === 0
|
: channel.config.index === 0
|
||||||
@@ -35,8 +37,6 @@ export const MessagesPage = (): JSX.Element => {
|
|||||||
return (
|
return (
|
||||||
<Pane display="flex" flexDirection="column" width="100%">
|
<Pane display="flex" flexDirection="column" width="100%">
|
||||||
<TabbedContent
|
<TabbedContent
|
||||||
active={activeChat}
|
|
||||||
setActive={setActiveChat}
|
|
||||||
tabs={tabs}
|
tabs={tabs}
|
||||||
actions={[
|
actions={[
|
||||||
() => (
|
() => (
|
||||||
|
|||||||
Reference in New Issue
Block a user