Switch to next/font.

This commit is contained in:
Mike Cao 2023-04-01 20:03:38 -07:00
parent 728e4cff5b
commit 8397102bac
7 changed files with 14 additions and 25 deletions

View File

@ -5,7 +5,6 @@ import NavBar from 'components/layout/NavBar';
import UpdateNotice from 'components/common/UpdateNotice';
import useRequireLogin from 'hooks/useRequireLogin';
import useConfig from 'hooks/useConfig';
import { UI_LAYOUT_BODY } from 'lib/constants';
import styles from './AppLayout.module.css';
export default function AppLayout({ title, children }) {
@ -25,14 +24,12 @@ export default function AppLayout({ title, children }) {
<Head>
<title>{title ? `${title} | umami` : 'umami'}</title>
</Head>
<div className={styles.nav}>
<nav className={styles.nav}>
<NavBar />
</div>
<div className={styles.body} id={UI_LAYOUT_BODY}>
<Container>
<main>{children}</main>
</Container>
</div>
</nav>
<main className={styles.body}>
<Container>{children}</Container>
</main>
</div>
);
}

View File

@ -17,8 +17,8 @@ export default function FilterTags({ websiteId, params }) {
}
function handleCloseFilter(param) {
if (param === null) {
router.push(`/websites/${websiteId}/?view=${view}`);
if (!param) {
router.push(`/websites/${websiteId}${view ? `?view=${view}` : ''}`);
} else {
router.push(resolveUrl({ [param]: undefined }));
}
@ -41,7 +41,7 @@ export default function FilterTags({ websiteId, params }) {
</div>
);
})}
<Button size="sm" variant="quiet" onClick={() => handleCloseFilter(null)}>
<Button size="sm" variant="quiet" onClick={() => handleCloseFilter()}>
<Icon>
<Icons.Close />
</Icon>

View File

@ -23,8 +23,6 @@ export const DEFAULT_WEBSITE_LIMIT = 10;
export const REALTIME_RANGE = 30;
export const REALTIME_INTERVAL = 5000;
export const UI_LAYOUT_BODY = 'ui-layout-body';
export const FILTER_COMBINED = 'filter-combined';
export const FILTER_RAW = 'filter-raw';
export const FILTER_DAY = 'filter-day';

View File

@ -58,7 +58,6 @@
".next/cache"
],
"dependencies": {
"@fontsource/inter": "4.5.7",
"@prisma/client": "4.11.0",
"@tanstack/react-query": "^4.16.1",
"@umami/prisma-client": "^0.2.0",

View File

@ -1,6 +1,7 @@
import { IntlProvider } from 'react-intl';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import Head from 'next/head';
import { Inter } from 'next/font/google';
import { useRouter } from 'next/router';
import useLocale from 'hooks/useLocale';
import useConfig from 'hooks/useConfig';
@ -8,11 +9,11 @@ import 'react-basics/dist/styles.css';
import 'styles/variables.css';
import 'styles/locale.css';
import 'styles/index.css';
import '@fontsource/inter/400.css';
import '@fontsource/inter/700.css';
import 'chartjs-adapter-date-fns';
import Script from 'next/script';
const inter = Inter({ subsets: ['latin'] });
const client = new QueryClient({
defaultOptions: {
queries: {
@ -53,7 +54,9 @@ export default function App({ Component, pageProps }) {
<meta name="theme-color" content="#2f2f2f" media="(prefers-color-scheme: dark)" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<div className={inter.className}>
<Component {...pageProps} />
</div>
{!pathname.includes('/share/') && <Script src={`${basePath}/telemetry.js`} />}
</IntlProvider>
</QueryClientProvider>

View File

@ -1,8 +1,5 @@
html,
body {
font-family: Inter, -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans,
Ubuntu, Cantrell, 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
font-size: 14px;
font-weight: normal;
line-height: 1.5rem;

View File

@ -1274,11 +1274,6 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.36.0.tgz#9837f768c03a1e4a30bd304a64fb8844f0e72efe"
integrity sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==
"@fontsource/inter@4.5.7":
version "4.5.7"
resolved "https://registry.npmjs.org/@fontsource/inter/-/inter-4.5.7.tgz"
integrity sha512-25k3thupaOEBexuU+jAkGqieKPbuhSuA+sinDwp1iBNhqQPiJ9QHDvsXgoCgCbZ4sGlE8aCwZmSlDJrPdJHNkw==
"@formatjs/cli@^4.2.29":
version "4.8.4"
resolved "https://registry.npmjs.org/@formatjs/cli/-/cli-4.8.4.tgz"