From 1962ef30b0b169740b01074b0453eb6744e3d177 Mon Sep 17 00:00:00 2001 From: ivansglazunov Date: Fri, 12 Jul 2024 17:07:23 +0200 Subject: [PATCH] 0.1.0-beta.39 --- package.json | 2 +- pages/new.tsx | 253 -------------------------------------------------- 2 files changed, 1 insertion(+), 254 deletions(-) delete mode 100644 pages/new.tsx diff --git a/package.json b/package.json index 0c42e6c5..10198362 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deep-foundation/deepcase-app", - "version": "0.1.0-beta.38", + "version": "0.1.0-beta.39", "license": "Unlicense", "main": "./bin/server.js", "bin": { diff --git a/pages/new.tsx b/pages/new.tsx deleted file mode 100644 index 9a7e812c..00000000 --- a/pages/new.tsx +++ /dev/null @@ -1,253 +0,0 @@ -import { - Box, - Button, - CircularProgress, - Flex, - Grid, - GridItem, - Text, -} from '@chakra-ui/react'; -import { AutoGuest } from '@deep-foundation/deepcase/imports/auto-guest'; -import { parseUrl } from '@deep-foundation/deepcase/imports/connector/connector'; -import { useContainer, useSpaceId } from '@deep-foundation/deepcase/imports/hooks'; -import { Provider as ProviderDeepcase } from '@deep-foundation/deepcase/imports/provider'; -import { DeepNamespaceProvider, DeepProvider, useDeep } from '@deep-foundation/deeplinks/imports/client'; -import { MinilinksProvider } from '@deep-foundation/deeplinks/imports/minilinks'; -import { useQueryStore } from '@deep-foundation/store/query'; -import { useTranslation } from 'next-i18next'; -import getConfig from 'next/config'; -import { useRouter } from 'next/router'; -import { useEffect, useState } from 'react'; -import { IoMdExit } from "react-icons/io"; -import pckg from '../package.json'; -import { i18nGetStaticProps } from '../src/i18n.tsx'; -import { useDeepPath } from '../src/provider.tsx'; - -const { publicRuntimeConfig } = getConfig(); - -export const Tab = ({ - id, name, type, icon, isActive, onClick, - side = 'right' -}: { - id: number; - name: string; - type: string; - icon: string; - isActive: boolean; - onClick: (id: number) => void; - side?: 'left' | 'right'; -}) => { - return - - - - - - -}; - -export const LayoutButton = ({ - id, name, isActive, onClick -}: { - id: string; - name: string; - isActive: boolean; - onClick: (id: string) => void; -}) => { - return - - - - - -}; - -export function Status() { - const deep = useDeep(); - // const status = deep.client.useApolloNetworkStatus(); - const status = {} - console.log('status', status); - return <> - - ; -} - -export function Content() { - const deep = useDeep(); - const { t } = useTranslation(); - const router = useRouter(); - - // @ts-ignore - if (typeof(window) === 'object') window.deep = deep; - console.log('deep', deep); - - const [layout, setLayout] = useQueryStore('layout', 'c'); - - const [spaceId, setSpaceId] = useSpaceId(); - const [containerId, setContainerId] = useContainer(); - - return ( - - - - - setSpaceId(id)} isActive={spaceId === 123} - /> - setSpaceId(id)} isActive={spaceId === 4324} - /> - setSpaceId(id)} isActive={spaceId === 1273} - /> - setSpaceId(id)} isActive={spaceId === 2473} - /> - setSpaceId(id)} isActive={spaceId === 4273} - /> - setSpaceId(id)} isActive={spaceId === 5173} - /> - - - setSpaceId(id)} isActive={spaceId === 452} - side='left' - /> - - - - - setLayout(id)}/> - setLayout(id)}/> - setLayout(id)}/> - setLayout(id)}/> - - - - - - {layout === 'c' && - } - {layout === 'g' && } - {layout === 'f' && - } - {layout === 'o' && - - } - - - ); - // return ( - // - // - // - // - // ); -}; - -export default function Page({ - defaultPath, defaultSsl, disableConnector -}: { - defaultPath: string; - defaultSsl: boolean; - disableConnector: boolean; -}) { - const [path, setPath] = useDeepPath(defaultPath); - const [ssl, setSsl] = useState(defaultSsl); - - useEffect(() => { - if (!disableConnector) { - return; - } - if (typeof window !== 'undefined') { - const browserURI = window?.location?.origin; - if (browserURI) { - const [browserPath, browserSsl] = parseUrl(browserURI); - setPath(browserPath + "/api/gql"); - setSsl(browserSsl); - } - } - }, []); - - return ( - - - - {!!path && <> - {/* */} - - - - } - - - - ); -}; - -export async function getStaticProps(arg) { - const result = await i18nGetStaticProps(arg); - result.props = result?.props || {}; - - result.props.defaultPath = publicRuntimeConfig?.NEXT_PUBLIC_GQL_PATH || ''; - result.props.defaultSsl = !!+publicRuntimeConfig?.NEXT_PUBLIC_GQL_SSL || false; - result.props.serverUrl = publicRuntimeConfig?.NEXT_PUBLIC_DEEPLINKS_SERVER || 'http://localhost:3007'; - result.props.deeplinksUrl = publicRuntimeConfig?.NEXT_PUBLIC_DEEPLINKS_URL || 'http://localhost:3006'; - result.props.disableConnector = !!+publicRuntimeConfig?.NEXT_PUBLIC_DISABLE_CONNECTOR || false; - result.props.appVersion = pckg?.version || ''; - - return result; -} \ No newline at end of file