From e0e13e71086fb4e2b300111688d8779828453e06 Mon Sep 17 00:00:00 2001 From: Adeoye Adefemi Date: Mon, 20 May 2024 00:27:51 +0100 Subject: [PATCH] feat: improve connection page --- desktop/src/pages/_app.tsx | 2 +- desktop/src/pages/connection/desktop.tsx | 50 +++++++++++++++++++ desktop/src/pages/connection/hotspot.tsx | 33 ++++++++++++ desktop/src/pages/connection/index.tsx | 41 +++++++++++++++ .../{connection.tsx => connection/mobile.tsx} | 19 +++---- desktop/src/pages/connection/peer.tsx | 47 +++++++++++++++++ 6 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 desktop/src/pages/connection/desktop.tsx create mode 100644 desktop/src/pages/connection/hotspot.tsx create mode 100644 desktop/src/pages/connection/index.tsx rename desktop/src/pages/{connection.tsx => connection/mobile.tsx} (75%) create mode 100644 desktop/src/pages/connection/peer.tsx diff --git a/desktop/src/pages/_app.tsx b/desktop/src/pages/_app.tsx index d7e240dc..ae3ddef3 100644 --- a/desktop/src/pages/_app.tsx +++ b/desktop/src/pages/_app.tsx @@ -4,7 +4,7 @@ import SystemInfoStore from "@/store/sys-info"; import "@/styles/globals.css"; import type { AppProps } from "next/app"; import WifiStatus from "@/store/wifi-status"; - +import "remixicon/fonts/remixicon.css"; export default function App({ Component, pageProps }: AppProps) { return ( diff --git a/desktop/src/pages/connection/desktop.tsx b/desktop/src/pages/connection/desktop.tsx new file mode 100644 index 00000000..c537300f --- /dev/null +++ b/desktop/src/pages/connection/desktop.tsx @@ -0,0 +1,50 @@ +"use client"; + +import Heading from "@/components/Heading"; +import Text from "@/components/Text"; +import View from "@/components/View"; +import PageLayout from "@/components/layout/PageLayout"; +import { SystemInformationContext } from "@/store/sys-info"; +import { useContext } from "react"; +import { writeText } from "@tauri-apps/api/clipboard"; +import { message } from "@tauri-apps/api/dialog"; + +export default function ConnectionPage() { + const { port } = useContext(SystemInformationContext); + + const copyToClipboard = async () => { + writeText(port.toString()) + .then(async () => { + message("Text Copied", { title: "Tauri", type: "info" }); + }) + .then(() => { + console.log("here goes nothing"); + }); + }; + return ( + <> + + + + + Connect Device + + + Provide the client id in the peer device + + + + + #{port} + + + + + + + + ); +} diff --git a/desktop/src/pages/connection/hotspot.tsx b/desktop/src/pages/connection/hotspot.tsx new file mode 100644 index 00000000..c55b5b1d --- /dev/null +++ b/desktop/src/pages/connection/hotspot.tsx @@ -0,0 +1,33 @@ +"use client"; + +import Heading from "@/components/Heading"; +import View from "@/components/View"; +import PageLayout from "@/components/layout/PageLayout"; +import { Text } from "@filesync/components"; +import { + ArrowDownIcon, + ArrowUpIcon, + RadioIcon, + WifiIcon, +} from "@heroicons/react/24/outline"; + +export default function ConnectionPage() { + return ( + <> + + + + + + Network Configuration + + Connect to the network on peer device + + + + + + + + ); +} diff --git a/desktop/src/pages/connection/index.tsx b/desktop/src/pages/connection/index.tsx new file mode 100644 index 00000000..5460e73b --- /dev/null +++ b/desktop/src/pages/connection/index.tsx @@ -0,0 +1,41 @@ +"use client"; + +import Heading from "@/components/Heading"; +import View from "@/components/View"; +import PageLayout from "@/components/layout/PageLayout"; +import { Text } from "@filesync/components"; +import { ArrowDownIcon, ArrowUpIcon } from "@heroicons/react/24/outline"; + +export default function ConnectionPage() { + return ( + <> + + + + + What would you like to do? + + some lorem text blablabla + + + + + Send File + + + + Recieve File + + + + + + + ); +} diff --git a/desktop/src/pages/connection.tsx b/desktop/src/pages/connection/mobile.tsx similarity index 75% rename from desktop/src/pages/connection.tsx rename to desktop/src/pages/connection/mobile.tsx index 2234f7ac..05da42dc 100644 --- a/desktop/src/pages/connection.tsx +++ b/desktop/src/pages/connection/mobile.tsx @@ -1,12 +1,12 @@ "use client"; +import Heading from "@/components/Heading"; import Text from "@/components/Text"; import View from "@/components/View"; import PageLayout from "@/components/layout/PageLayout"; -import QRCode from "react-qr-code"; -import { useContext } from "react"; import { SystemInformationContext } from "@/store/sys-info"; -import Heading from "@/components/Heading"; +import { useContext } from "react"; +import QRCode from "react-qr-code"; export default function ConnectionPage() { const { serverBaseUrl } = useContext(SystemInformationContext); @@ -18,17 +18,18 @@ export default function ConnectionPage() { className=" text-center flex flex-col justify-center items-center" style={{ height: "600px" }} > - - Connect Device + + Connect Device + - Scan the QR code below to connect your device + Scan the QR code to connect your device diff --git a/desktop/src/pages/connection/peer.tsx b/desktop/src/pages/connection/peer.tsx new file mode 100644 index 00000000..551e4e42 --- /dev/null +++ b/desktop/src/pages/connection/peer.tsx @@ -0,0 +1,47 @@ +"use client"; + +import Heading from "@/components/Heading"; +import Text from "@/components/Text"; +import View from "@/components/View"; +import PageLayout from "@/components/layout/PageLayout"; +import { LinuxOutlined } from "@ant-design/icons"; + +export default function ConnectionPage() { + return ( + <> + + + + + Select Device + + + Select device type to begin + + + + + + + + + + + + + + + ); +}