mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Changed route ids to be more explicit.
This commit is contained in:
parent
1a70350936
commit
18e36aa7b3
105 changed files with 86 additions and 76 deletions
12
src/app/share/[...shareId]/Footer.module.css
Normal file
12
src/app/share/[...shareId]/Footer.module.css
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
.footer {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
font-size: var(--font-size-sm);
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
color: var(--font-color100);
|
||||
}
|
||||
15
src/app/share/[...shareId]/Footer.tsx
Normal file
15
src/app/share/[...shareId]/Footer.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
'use client';
|
||||
import { CURRENT_VERSION, HOMEPAGE_URL } from 'lib/constants';
|
||||
import styles from './Footer.module.css';
|
||||
|
||||
export function Footer() {
|
||||
return (
|
||||
<footer className={styles.footer}>
|
||||
<a href={HOMEPAGE_URL}>
|
||||
<b>umami</b> {`v${CURRENT_VERSION}`}
|
||||
</a>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
export default Footer;
|
||||
41
src/app/share/[...shareId]/Header.module.css
Normal file
41
src/app/share/[...shareId]/Header.module.css
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
.header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.row {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-size: var(--font-size-lg);
|
||||
font-weight: 700;
|
||||
color: var(--font-color100) !important;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 992px) {
|
||||
.header .buttons {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.links {
|
||||
order: 2;
|
||||
margin: 20px 0;
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
30
src/app/share/[...shareId]/Header.tsx
Normal file
30
src/app/share/[...shareId]/Header.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
'use client';
|
||||
import { Icon, Text } from 'react-basics';
|
||||
import Link from 'next/link';
|
||||
import LanguageButton from 'components/input/LanguageButton';
|
||||
import ThemeButton from 'components/input/ThemeButton';
|
||||
import SettingsButton from 'components/input/SettingsButton';
|
||||
import Icons from 'components/icons';
|
||||
import styles from './Header.module.css';
|
||||
|
||||
export function Header() {
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<div>
|
||||
<Link href="https://umami.is" target="_blank" className={styles.title}>
|
||||
<Icon size="lg">
|
||||
<Icons.Logo />
|
||||
</Icon>
|
||||
<Text>umami</Text>
|
||||
</Link>
|
||||
</div>
|
||||
<div className={styles.buttons}>
|
||||
<ThemeButton />
|
||||
<LanguageButton />
|
||||
<SettingsButton />
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
export default Header;
|
||||
4
src/app/share/[...shareId]/Share.module.css
Normal file
4
src/app/share/[...shareId]/Share.module.css
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.container {
|
||||
flex: 1;
|
||||
min-height: calc(100vh - 200px);
|
||||
}
|
||||
25
src/app/share/[...shareId]/Share.tsx
Normal file
25
src/app/share/[...shareId]/Share.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
'use client';
|
||||
import WebsiteDetails from '../../(main)/websites/[websiteId]/WebsiteDetails';
|
||||
import { useShareToken } from 'components/hooks';
|
||||
import styles from './Share.module.css';
|
||||
import Page from 'components/layout/Page';
|
||||
import Header from './Header';
|
||||
import Footer from './Footer';
|
||||
|
||||
export default function Share({ shareId }) {
|
||||
const { shareToken, isLoading } = useShareToken(shareId);
|
||||
|
||||
if (isLoading || !shareToken) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Page>
|
||||
<Header />
|
||||
<WebsiteDetails websiteId={shareToken.websiteId} />
|
||||
<Footer />
|
||||
</Page>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
10
src/app/share/[...shareId]/page.tsx
Normal file
10
src/app/share/[...shareId]/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import Share from './Share';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function ({ params: { shareId } }) {
|
||||
return <Share shareId={shareId[0]} />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'umami',
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue