From d83a02294336b7d0b5f28f285df8a5b429dedb13 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 12 Feb 2024 12:25:02 -0600 Subject: [PATCH] feat: add custom domain setup instructions (#41) --- components/dashboard.tsx | 25 ++++++++++++++++++++- components/info.tsx | 5 ++++- components/update-deployment.tsx | 38 +++++++++++++++++++++++++++----- config/ghostcloud-infra.ts | 4 ++++ pages/dashboard.tsx | 24 ++++++++++++++++++-- 5 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 config/ghostcloud-infra.ts diff --git a/components/dashboard.tsx b/components/dashboard.tsx index 19a86ed..48095bf 100644 --- a/components/dashboard.tsx +++ b/components/dashboard.tsx @@ -3,6 +3,7 @@ import { Box, Button, Center, + Icon, Table, Thead, Tbody, @@ -13,6 +14,8 @@ import { IconButton, Spinner, HStack, + Tooltip, + useTheme } from "@chakra-ui/react" import { ArrowBackIcon, @@ -29,8 +32,12 @@ import { GHOSTCLOUD_URL_DOMAIN, GHOSTCLOUD_URL_SCHEME, } from "../config/ghostcloud-chain" +import { + GHOSTCLOUD_INFRA_LOADBALANCER_IP +} from "../config/ghostcloud-infra" import useWeb3AuthStore from "../store/web3-auth" import { truncateAddress } from "../helpers/address" +import { FaInfoCircle } from "react-icons/fa" function createUrl(name: string, address: string) { return `${GHOSTCLOUD_URL_SCHEME}://${name}-${address}.${GHOSTCLOUD_URL_DOMAIN}` @@ -54,6 +61,7 @@ const Dashboard = () => { handlePageClick, ] = useFetchMetas() const store = useWeb3AuthStore() + const theme = useTheme() useEffect(() => { const fetchAddress = async () => { @@ -128,7 +136,22 @@ const Dashboard = () => { {meta.name} {meta.description} - {meta.domain} + + {meta.domain && ( + <> + {meta.domain} + + + + + + + )} + - Name + + Name + + + + - Description + + Description + + + + - Domain + + Domain + + + + - Memo + + Memo + + + + - File (Max 5MB) + + File (Max 5MB) + + + + diff --git a/config/ghostcloud-infra.ts b/config/ghostcloud-infra.ts new file mode 100644 index 0000000..e8d502b --- /dev/null +++ b/config/ghostcloud-infra.ts @@ -0,0 +1,4 @@ +// This file contains the configuration for Ghostcloud infrastrucutre components. + +export const GHOSTCLOUD_INFRA_LOADBALANCER_IP = + process.env["NEXT_PUBLIC_GHOSTCLOUD_INFRA_LOADBALANCER_IP"] ?? "35.131.208.174" diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index a826b0f..c83bf2b 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -1,6 +1,14 @@ import useWeb3AuthStore from "../store/web3-auth" import DashboardComponent from "../components/dashboard" -import { Box, Container, Grid, GridItem } from "@chakra-ui/react" +import { + Alert, + AlertIcon, + Box, + Center, + Container, + Grid, + GridItem +} from "@chakra-ui/react" export default function Dashboard() { const store = useWeb3AuthStore() @@ -17,6 +25,18 @@ export default function Dashboard() { ) : ( -
Please login to view this page
+ + + +
+ + + + Please login to view this page + + +
+
+
) }