Fix CSS. Updated pages.

This commit is contained in:
Mike Cao 2023-09-29 19:18:44 -07:00
parent 0f12226401
commit 3720a5a2fc
12 changed files with 71 additions and 71 deletions

1
next-env.d.ts vendored
View File

@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View File

@ -78,6 +78,7 @@ const basePath = process.env.BASE_PATH;
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: false,
env: {
basePath: basePath || '',
cloudMode: !!process.env.CLOUD_MODE,
@ -85,6 +86,8 @@ const config = {
configUrl: '/config',
currentVersion: pkg.version,
defaultLocale: process.env.DEFAULT_LOCALE,
disableLogin: process.env.DISABLE_LOGIN,
disableUI: process.env.DISABLE_UI,
isProduction: process.env.NODE_ENV === 'production',
},
basePath,

View File

@ -63,6 +63,7 @@
"dependencies": {
"@fontsource/inter": "^4.5.15",
"@prisma/client": "5.3.1",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^4.33.0",
"@umami/prisma-client": "^0.3.0",
"@umami/redis-client": "^0.15.0",
@ -102,7 +103,6 @@
"react-error-boundary": "^4.0.4",
"react-intl": "^6.4.7",
"react-simple-maps": "^2.3.0",
"react-spring": "^9.4.4",
"react-use-measure": "^2.0.4",
"react-window": "^1.8.6",
"request-ip": "^3.3.0",

View File

@ -1,3 +1,4 @@
'use client';
import WebsiteSelect from 'components/input/WebsiteSelect';
import Page from 'components/layout/Page';
import PageHeader from 'components/layout/PageHeader';

View File

@ -10,7 +10,6 @@
width: 100vw;
grid-column: 1;
grid-row: 1 / 2;
z-index: var(--z-index-popup);
}
.body {

View File

@ -4,20 +4,20 @@ import '@fontsource/inter/400.css';
import '@fontsource/inter/700.css';
import '@fontsource/inter/800.css';
import 'react-basics/dist/styles.css';
import 'styles/variables.css';
import 'styles/locale.css';
import 'styles/index.css';
import 'styles/variables.css';
export default function RootLayout({ children }) {
return (
<html lang="en" data-scroll="0">
<head>
<link rel="icon" href={`favicon.ico`} />
<link rel="apple-touch-icon" sizes="180x180" href={`apple-touch-icon.png`} />
<link rel="icon" type="image/png" sizes="32x32" href={`favicon-32x32.png`} />
<link rel="icon" type="image/png" sizes="16x16" href={`favicon-16x16.png`} />
<link rel="manifest" href={`site.webmanifest`} />
<link rel="mask-icon" href={`safari-pinned-tab.svg`} color="#5bbad5" />
<link rel="icon" href={`/favicon.ico`} />
<link rel="apple-touch-icon" sizes="180x180" href={`/apple-touch-icon.png`} />
<link rel="icon" type="image/png" sizes="32x32" href={`/favicon-32x32.png`} />
<link rel="icon" type="image/png" sizes="16x16" href={`/favicon-16x16.png`} />
<link rel="manifest" href={`/site.webmanifest`} />
<link rel="mask-icon" href={`/safari-pinned-tab.svg`} color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#fafafa" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#2f2f2f" media="(prefers-color-scheme: dark)" />

32
src/app/logout/Logout.js Normal file
View File

@ -0,0 +1,32 @@
'use client';
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import useApi from 'components/hooks/useApi';
import { setUser } from 'store/app';
import { removeClientAuthToken } from 'lib/client';
export function Logout() {
const disabled = !!(process.env.disableLogin || process.env.cloudMode);
const router = useRouter();
const { post } = useApi();
useEffect(() => {
async function logout() {
await post('/auth/logout');
}
if (!disabled) {
removeClientAuthToken();
logout();
router.push('/login');
return () => setUser(null);
}
}, [disabled, router, post]);
return null;
}
export default Logout;

View File

@ -1,34 +1,5 @@
'use client';
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import useApi from 'components/hooks/useApi';
import { setUser } from 'store/app';
import { removeClientAuthToken } from 'lib/client';
import Logout from './Logout';
async function getDisabled() {
return !!(process.env.DISABLE_LOGIN || process.env.CLOUD_MODE);
}
export default async function LogoutPage() {
const disabled = await getDisabled();
const router = useRouter();
const { post } = useApi();
useEffect(() => {
async function logout() {
await post('/auth/logout');
}
if (!disabled) {
removeClientAuthToken();
logout();
router.push('/login');
return () => setUser(null);
}
}, [disabled, router, post]);
return null;
export default function () {
return <Logout />;
}

View File

@ -0,0 +1,13 @@
'use client';
import WebsiteDetails from 'app/(app)/websites/[id]/WebsiteDetails';
import useShareToken from 'components/hooks/useShareToken';
export default function ({ shareId }) {
const shareToken = useShareToken(shareId);
if (!shareToken) {
return null;
}
return <WebsiteDetails websiteId={shareToken.websiteId} />;
}

View File

@ -1,17 +1,9 @@
import Page from 'components/layout/Page';
import WebsiteDetails from 'app/(app)/websites/[id]/WebsiteDetails';
import useShareToken from 'components/hooks/useShareToken';
import Share from './Share';
export default function SharePage({ params }) {
const shareToken = useShareToken(params.id);
if (!shareToken) {
export default function ({ params: { id } }) {
if (!id) {
return null;
}
return (
<Page>
<WebsiteDetails websiteId={shareToken.websiteId} />
</Page>
);
return <Share shareId={id} />;
}

View File

@ -1,4 +1,4 @@
:root {
html body {
--primary400: var(--blue800);
--primary500: var(--blue900);
--primary600: var(--blue1000);

View File

@ -2024,7 +2024,7 @@
"@react-spring/shared" "~9.7.3"
"@react-spring/types" "~9.7.3"
"@react-spring/konva@~9.7.1", "@react-spring/konva@~9.7.3":
"@react-spring/konva@~9.7.1":
version "9.7.3"
resolved "https://registry.yarnpkg.com/@react-spring/konva/-/konva-9.7.3.tgz#16bd29dd4860a99e960a72987c8bcfc828b22119"
integrity sha512-R9sY6SiPGYqz1383P5qppg5z57YfChVknOC1UxxaGxpw+WiZa8fZ4zmZobslrw+os3/+HAXZv8O+EvU/nQpf7g==
@ -2034,7 +2034,7 @@
"@react-spring/shared" "~9.7.3"
"@react-spring/types" "~9.7.3"
"@react-spring/native@~9.7.1", "@react-spring/native@~9.7.3":
"@react-spring/native@~9.7.1":
version "9.7.3"
resolved "https://registry.yarnpkg.com/@react-spring/native/-/native-9.7.3.tgz#ee38d7c23482cfb4916c9b3c021de2995a4f553a"
integrity sha512-4mpxX3FuEBCUT6ae2fjhxcJW6bhr2FBwFf274eXB7n+U30Gdg8Wo2qYwcUnmiAA0S3dvP8vLTazx3+CYWFShnA==
@ -2051,7 +2051,7 @@
dependencies:
"@react-spring/types" "~9.7.3"
"@react-spring/three@~9.7.1", "@react-spring/three@~9.7.3":
"@react-spring/three@~9.7.1":
version "9.7.3"
resolved "https://registry.yarnpkg.com/@react-spring/three/-/three-9.7.3.tgz#4358a0c4640efe2972c4f7d0f7cd4efe927471c1"
integrity sha512-Q1p512CqUlmMK8UMBF/Rj79qndhOWq4XUTayxMP9S892jiXzWQuj+xC3Xvm59DP/D4JXusXpxxqfgoH+hmOktA==
@ -2066,7 +2066,7 @@
resolved "https://registry.yarnpkg.com/@react-spring/types/-/types-9.7.3.tgz#ea78fd447cbc2612c1f5d55852e3c331e8172a0b"
integrity sha512-Kpx/fQ/ZFX31OtlqVEFfgaD1ACzul4NksrvIgYfIFq9JpDHFwQkMVZ10tbo0FU/grje4rcL4EIrjekl3kYwgWw==
"@react-spring/web@~9.7.1", "@react-spring/web@~9.7.3":
"@react-spring/web@^9.7.3", "@react-spring/web@~9.7.1":
version "9.7.3"
resolved "https://registry.yarnpkg.com/@react-spring/web/-/web-9.7.3.tgz#d9f4e17fec259f1d65495a19502ada4f5b57fa3d"
integrity sha512-BXt6BpS9aJL/QdVqEIX9YoUy8CE6TJrU0mNCqSoxdXlIeNcEBWOfIyE6B14ENNsyQKS3wOWkiJfco0tCr/9tUg==
@ -2076,7 +2076,7 @@
"@react-spring/shared" "~9.7.3"
"@react-spring/types" "~9.7.3"
"@react-spring/zdog@~9.7.1", "@react-spring/zdog@~9.7.3":
"@react-spring/zdog@~9.7.1":
version "9.7.3"
resolved "https://registry.yarnpkg.com/@react-spring/zdog/-/zdog-9.7.3.tgz#8ccc7316f6d3460ed244d9e3f60de9b4c4a848ac"
integrity sha512-L+yK/1PvNi9n8cldiJ309k4LdxcPkeWE0W18l1zrP1IBIyd5NB5EPA8DMsGr9gtNnnIujtEzZk+4JIOjT8u/tw==
@ -7914,18 +7914,6 @@ react-simple-maps@^2.3.0:
d3-zoom "^2.0.0"
topojson-client "^3.1.0"
react-spring@^9.4.4:
version "9.7.3"
resolved "https://registry.yarnpkg.com/react-spring/-/react-spring-9.7.3.tgz#3211dea4c4d7c5b541260af5100261b87becb5d5"
integrity sha512-oTxDpFV5gzq7jQX6+bU0SVq+vX8VnuuT5c8Zwn6CpDErOPvCmV+DRkPiEBtaL3Ozgzwiy5yFx83N0h303j/r3A==
dependencies:
"@react-spring/core" "~9.7.3"
"@react-spring/konva" "~9.7.3"
"@react-spring/native" "~9.7.3"
"@react-spring/three" "~9.7.3"
"@react-spring/web" "~9.7.3"
"@react-spring/zdog" "~9.7.3"
react-spring@^9.5.5:
version "9.7.1"
resolved "https://registry.yarnpkg.com/react-spring/-/react-spring-9.7.1.tgz#8acfed700823490a4d9d4cf131c5fea12d1aaa93"