(fix): remove unused dependencies
(fix): remove dead code (fix): remove unused exports
This commit is contained in:
parent
2a8fade420
commit
be56080ba1
29 changed files with 168 additions and 338 deletions
|
|
@ -26,9 +26,7 @@
|
|||
"validate:raw": "bun run build && bun run package:linux:raw",
|
||||
"validate": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop --command bun run validate:raw; else bun run validate:raw; fi"
|
||||
},
|
||||
"dependencies": {
|
||||
"electron-updater": "^6.6.2"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.9.1",
|
||||
"electron": "^39.2.7",
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
import { checkForUpdates } from "./updates.js";
|
||||
import {
|
||||
ipcChannels,
|
||||
type DesktopScreenShareAudioOutput,
|
||||
type DesktopScreenShareCapabilities,
|
||||
} from "../shared/ipc.js";
|
||||
|
||||
|
|
@ -88,7 +89,7 @@ function execJson(command: string, args: string[]) {
|
|||
});
|
||||
}
|
||||
|
||||
async function listAudioOutputs() {
|
||||
async function listAudioOutputs(): Promise<DesktopScreenShareAudioOutput[]> {
|
||||
verboseLog("listAudioOutputs", { platform: process.platform });
|
||||
|
||||
if (process.platform !== "linux") return [];
|
||||
|
|
@ -106,7 +107,9 @@ async function listAudioOutputs() {
|
|||
if (!id || !name) return null;
|
||||
return { id, name, isDefault: false };
|
||||
})
|
||||
.filter(Boolean);
|
||||
.filter(
|
||||
(output): output is DesktopScreenShareAudioOutput => output != null,
|
||||
);
|
||||
}
|
||||
|
||||
async function listScreenShareSources() {
|
||||
|
|
|
|||
|
|
@ -30,12 +30,10 @@
|
|||
"@tauri-apps/api": "^2",
|
||||
"@tauri-apps/plugin-barcode-scanner": "~2",
|
||||
"@tauri-apps/plugin-deep-link": "~2",
|
||||
"@tauri-apps/plugin-opener": "^2",
|
||||
"react-dom": "^19.2.0",
|
||||
"@tensamin/ui": "*",
|
||||
"@tensamin/shared": "workspace:*",
|
||||
"lucide-react": "^1.14.0",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0"
|
||||
"react": "^19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^2",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@fontsource-variable/inter": "^5.2.8",
|
||||
"@noble/curves": "^2.2.0",
|
||||
"@tailwindcss/vite": "^4.2.4",
|
||||
"@tanstack/react-router": "^1.169.1",
|
||||
"@tanstack/react-virtual": "^3.13.24",
|
||||
|
|
@ -30,21 +29,13 @@
|
|||
"@tensamin/ui": "*",
|
||||
"@tensamin/user": "workspace:*",
|
||||
"@tensamin/notifications": "workspace:*",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"comlink": "^4.4.2",
|
||||
"framer-motion": "^12.38.0",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"lucide-react": "^1.14.0",
|
||||
"qrcode": "^1.5.4",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"shadcn": "^4.6.0",
|
||||
"sonner": "^2.0.7",
|
||||
"tailwind-merge": "^3.5.0",
|
||||
"tailwind-scrollbar-hide": "^4.0.0",
|
||||
"tailwindcss": "^4.2.4",
|
||||
"tauri-plugin-app-events-api": "^0.2.0",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"tailwind-scrollbar-hide": "^4.0.0",
|
||||
"zod": "^4.3.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import { useIsMobile } from "@tensamin/ui";
|
|||
import { MobileNavbar } from "./navbar";
|
||||
|
||||
import SidebarBox from "@tensamin/call/sidebarBox";
|
||||
import { useShowMobileNavbar } from "@/routes/app/layout";
|
||||
import { useShowMobileNavbar } from "@/routes/app/useShowMobileNavbar";
|
||||
import { Ellipsis, Check } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import type { User } from "@tensamin/user/context";
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ function ContinueButton({
|
|||
);
|
||||
}
|
||||
|
||||
export function BigCheckbox({
|
||||
function BigCheckbox({
|
||||
id,
|
||||
label,
|
||||
checked,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Label } from "@tensamin/ui";
|
||||
import { Switch as UISwitch, Input as UIInput } from "@tensamin/ui";
|
||||
import { Switch as UISwitch } from "@tensamin/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import type { Storage } from "@tensamin/shared/data";
|
||||
|
|
@ -10,28 +10,6 @@ type BooleanStorageKey = {
|
|||
[K in keyof Storage]: Storage[K] extends boolean ? K : never;
|
||||
}[keyof Storage];
|
||||
|
||||
type StringStorageKey = {
|
||||
[K in keyof Storage]: Storage[K] extends string ? K : never;
|
||||
}[keyof Storage];
|
||||
|
||||
type NumberStorageKey = {
|
||||
[K in keyof Storage]: Storage[K] extends number ? K : never;
|
||||
}[keyof Storage];
|
||||
|
||||
type InputProps =
|
||||
| {
|
||||
label: string;
|
||||
id: StringStorageKey;
|
||||
placeholder?: string;
|
||||
type?: "text";
|
||||
}
|
||||
| {
|
||||
label: string;
|
||||
id: NumberStorageKey;
|
||||
placeholder?: string;
|
||||
type: "number";
|
||||
};
|
||||
|
||||
export function Switch({
|
||||
label,
|
||||
id,
|
||||
|
|
@ -60,49 +38,3 @@ export function Switch({
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function Input({ label, id, placeholder, type }: InputProps) {
|
||||
const { save, load } = useStorage();
|
||||
const [value, setValue] = useState<string | number>(
|
||||
type === "number" ? 0 : "",
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
load(id).then((loadedValue) => {
|
||||
if (type === "number") {
|
||||
if (typeof loadedValue === "number") {
|
||||
setValue(loadedValue);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof loadedValue === "string") {
|
||||
setValue(loadedValue);
|
||||
}
|
||||
});
|
||||
}, [id, load, type]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
<Label htmlFor={id}>{label}</Label>
|
||||
<UIInput
|
||||
id={id}
|
||||
type={type || "text"}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={(e) => {
|
||||
if (type === "number") {
|
||||
const nextValue = Number(e.target.value);
|
||||
setValue(nextValue);
|
||||
save(id, nextValue);
|
||||
return;
|
||||
}
|
||||
|
||||
const nextValue = e.target.value;
|
||||
setValue(nextValue);
|
||||
save(id, nextValue);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,12 @@ import { type ReactNode } from "react";
|
|||
|
||||
import Sidebar from "@/components/sidebar";
|
||||
import Navbar, { MobileNavbar } from "@/components/navbar";
|
||||
import { useShowMobileNavbar } from "./useShowMobileNavbar";
|
||||
|
||||
import { useIsMobile, cn, SidebarProvider } from "@tensamin/ui";
|
||||
|
||||
import { isTauri } from "@tauri-apps/api/core";
|
||||
import { useLocation, useMatches } from "@tanstack/react-router";
|
||||
|
||||
/**
|
||||
* Executes Layout.
|
||||
* @param props Parameter props.
|
||||
* @returns unknown.
|
||||
*/
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
const isMobile = useIsMobile();
|
||||
const showMobileNavbar = useShowMobileNavbar();
|
||||
|
|
@ -47,17 +42,3 @@ export default function Layout({ children }: { children: ReactNode }) {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function useShowMobileNavbar(): boolean {
|
||||
const matches = useMatches();
|
||||
const location = useLocation();
|
||||
|
||||
const value = matches.some(
|
||||
(match) =>
|
||||
match.pathname === location.pathname &&
|
||||
// @ts-expect-error Stuff
|
||||
match.staticData?.showMobileNavbar === true,
|
||||
);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
|
|||
14
apps/web/src/routes/app/useShowMobileNavbar.ts
Normal file
14
apps/web/src/routes/app/useShowMobileNavbar.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { useLocation, useMatches } from "@tanstack/react-router";
|
||||
|
||||
export function useShowMobileNavbar(): boolean {
|
||||
const matches = useMatches();
|
||||
const location = useLocation();
|
||||
|
||||
return matches.some(
|
||||
(match) =>
|
||||
match.pathname === location.pathname &&
|
||||
// Router staticData is app-defined and not typed by the route matcher here.
|
||||
// @ts-expect-error App route metadata
|
||||
match.staticData?.showMobileNavbar === true,
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue