feat: incident history (#113)
* feat: add incident history link to links in header * fix: lower margin-bottom on header to have not that much wasted space * chore: move footer to own component * feat: add NoIncidents component * feat: add incidents history page * fix: add sorting by date * fix: fix sorting * feat: hash linking to individual incidents * fix: always truthy title * feat: remove hash * feat: some link improvements * feat: improve styles for alert, support mobile devices * fix: remove unused vars, larger margin --------- Co-authored-by: lyc8503 <[email protected]>
This commit is contained in:
1 parent
5769a52f0c
commit
41257c6ae9
7 files changed
+235
-42
No files matched your search
+11
-6
@@ -4,12 +4,12 @@ import { pageConfig } from '@/uptime.config'
|
||||
import { PageConfigLink } from '@/types/config'
|
||||
|
||||
export default function Header() {
|
||||
const linkToElement = (link: PageConfigLink) => {
|
||||
const linkToElement = (link: PageConfigLink, i: number) => {
|
||||
return (
|
||||
<a
|
||||
key={link.label}
|
||||
key={i}
|
||||
href={link.link}
|
||||
target="_blank"
|
||||
target={link.link.startsWith('/') ? undefined : '_blank'}
|
||||
className={classes.link}
|
||||
data-active={link.highlight}
|
||||
>
|
||||
@@ -18,11 +18,16 @@ export default function Header() {
|
||||
)
|
||||
}
|
||||
|
||||
const links = [{ label: 'Incident History', link: '/incidents' }, ...(pageConfig.links || [])]
|
||||
|
||||
return (
|
||||
<header className={classes.header}>
|
||||
<Container size="md" className={classes.inner}>
|
||||
<div>
|
||||
<a href="https://github.com/lyc8503/UptimeFlare" target="_blank">
|
||||
<a
|
||||
href={location.pathname == '/' ? 'https://github.com/lyc8503/UptimeFlare' : '/'}
|
||||
target={location.pathname == '/' ? '_blank' : undefined}
|
||||
>
|
||||
<Text size="xl" span>
|
||||
🕒
|
||||
</Text>
|
||||
@@ -39,11 +44,11 @@ export default function Header() {
|
||||
</div>
|
||||
|
||||
<Group gap={5} visibleFrom="sm">
|
||||
{pageConfig.links?.map(linkToElement)}
|
||||
{links?.map(linkToElement)}
|
||||
</Group>
|
||||
|
||||
<Group gap={5} hiddenFrom="sm">
|
||||
{pageConfig.links?.filter((link) => link.highlight).map(linkToElement)}
|
||||
{links?.filter((link) => (link.highlight || link.link.startsWith('/'))).map(linkToElement)}
|
||||
</Group>
|
||||
</Container>
|
||||
</header>
|
||||
|
||||
Reference in new issue
Block a user