Skip to content

Commit

Permalink
chore: use test app host
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Oct 5, 2024
1 parent 433325e commit 415bb5a
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 34 deletions.
33 changes: 29 additions & 4 deletions apps/frontend/web/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react';

import { Provider } from 'jotai';
import { kebabCase } from 'scule';
import { useState, useEffect } from 'react';

import global from '~/layouts/global.js?raw';
import { Toaster } from '~/components/ui/sonner';
import { MaxPaddingTop, MaxPaddingBottom } from '~/layouts/Layout';

import Tags from '~analytics/scripts';

import 'virtual:uno.css';

import './styles/main.css';
import './styles/sonner.css';
import './layouts/layout.css';

import global from '~/layouts/global.js?raw';
import { Toaster } from '~/components/ui/sonner';
import { MaxPaddingTop, MaxPaddingBottom } from '~/layouts/Layout';

export function Layout({ children }: { children: React.ReactNode }) {
const [isClient, setIsClient] = useState(false);

Expand All @@ -34,6 +37,28 @@ export function Layout({ children }: { children: React.ReactNode }) {
<link rel="mask-icon" color="#FFFFFF" href="/favicon.svg" />
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="theme-color" content="#ffffff" />
{Tags.slice(0, 1).map((t) =>
'src' in t ? (
<script
suppressHydrationWarning={true}
key={t.src}
src={t.src}
{...Object.fromEntries(
Object.entries(t.dataset ?? {}).map(([k, v]) => ['data-' + kebabCase(k), v])
)}
></script>
) : (
<script
suppressHydrationWarning={true}
key={t.children}
type={t.type}
dangerouslySetInnerHTML={{ __html: t.children }}
{...Object.fromEntries(
Object.entries(t.dataset ?? {}).map(([k, v]) => ['data-' + kebabCase(k), v])
)}
></script>
)
)}
<Meta />
<Links />
</head>
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/web/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="unplugin-info/client" />
/// <reference types="unplugin-analytics/client" />

import type * as CSS from 'csstype';

Expand Down
5 changes: 3 additions & 2 deletions apps/frontend/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"react-dom": "^18.3.1",
"remix-hono": "^0.0.16",
"remix-sitemap": "^3.2.0",
"scule": "^1.3.0",
"sonner": "^1.5.0",
"swagger-ui-react": "^5.17.14",
"tailwind-merge": "^2.5.2",
Expand All @@ -68,8 +69,8 @@
"unocss-preset-animations": "^1.1.0",
"unocss-preset-flowind": "^0.0.5",
"unocss-preset-shadcn": "^0.3.1",
"unplugin-analytics": "^0.0.11",
"unplugin-analytics": "^0.0.12",
"unplugin-info": "^1.2.1",
"vite-tsconfig-paths": "^4.2.1"
}
}
}
2 changes: 1 addition & 1 deletion apps/frontend/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Analytics from 'unplugin-analytics/vite';

const KEEPSHARE = 'gv78k1oi';

const APP_HOST = process.env.APP_HOST ?? `garden.breadio.wiki`;
const APP_HOST = process.env.APP_HOST ?? `garden.test.breadio.wiki`;

const SERVER_HOST = process.env.SERVER_HOST;
const SERVER_PORT = process.env.SERVER_PORT;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"unocss": "^0.62.3",
"unocss-preset-animations": "^1.1.0",
"unocss-preset-shadcn": "^0.3.1",
"unplugin-analytics": "^0.0.11",
"unplugin-analytics": "^0.0.12",
"unplugin-info": "^1.2.1"
}
}
50 changes: 24 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 415bb5a

Please sign in to comment.