mirror of
https://github.com/khairul169/vaulterm.git
synced 2026-09-15 17:03:30 +07:00
feat: add tags
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
import { View, Text } from "react-native";
|
||||
import React from "react";
|
||||
import HostList from "../hosts/components/host-list";
|
||||
import { useQueryParams } from "@/hooks/useQueryParams";
|
||||
import { BackButton } from "@/components/ui/button";
|
||||
import { XStack } from "tamagui";
|
||||
|
||||
type Params = {
|
||||
parentId?: string | null;
|
||||
};
|
||||
|
||||
const NewSessionPage = () => {
|
||||
const queryParams = useQueryParams<Params>();
|
||||
const parentId = queryParams.params?.parentId;
|
||||
|
||||
const setParentId = (id: string | null) => {
|
||||
queryParams.push({ parentId: id || "" });
|
||||
};
|
||||
|
||||
const onGoBack = () => {
|
||||
if (!queryParams.goBack()) {
|
||||
queryParams.replace({ parentId: "" });
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<XStack alignItems="center" h="$6">
|
||||
{parentId ? <BackButton onPress={onGoBack} /> : null}
|
||||
</XStack>
|
||||
<HostList
|
||||
allowEdit={false}
|
||||
parentId={parentId}
|
||||
onParentIdChange={setParentId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default NewSessionPage;
|
||||
@@ -8,7 +8,7 @@ import Drawer from "expo-router/drawer";
|
||||
import { router } from "expo-router";
|
||||
import Icons from "@/components/ui/icons";
|
||||
import { useDebounceCallback } from "@/hooks/useDebounce";
|
||||
import NewSessionPage from "./new-session-page";
|
||||
import HostList from "../hosts/components/host-list";
|
||||
|
||||
const TerminalPage = () => {
|
||||
const pagerViewRef = useRef<PagerViewRef>(null!);
|
||||
@@ -58,7 +58,11 @@ const TerminalPage = () => {
|
||||
/>
|
||||
|
||||
{sessions.length > 0 && media.gtSm ? <SessionTabs /> : null}
|
||||
{!sessions.length ? <NewSessionPage /> : pagerView}
|
||||
{!sessions.length ? (
|
||||
<HostList allowEdit={false} parentId="none" hideGroups />
|
||||
) : (
|
||||
pagerView
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user