Skip to content

Commit bb96e5a

Browse files
feat(frontend): display a maintenance banner warning (#2801)
* feat(frontend): display a maintenance banner warning * chore: fmt
1 parent 5721844 commit bb96e5a

6 files changed

Lines changed: 48 additions & 27 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script lang="ts">
2+
import IconSpaceStation from '$lib/components/icons/IconSpaceStation.svelte';
3+
import IconWarning from '$lib/components/icons/IconWarning.svelte';
4+
import Html from '$lib/components/ui/Html.svelte';
5+
import { i18n } from '$lib/stores/app/i18n.store';
6+
7+
interface Props {
8+
display: 'dev' | 'maintenance';
9+
}
10+
11+
let { display }: Props = $props();
12+
</script>
13+
14+
<aside class="banner" class:warn={display === 'maintenance'}>
15+
{#if display === 'dev'}
16+
<IconSpaceStation /> <strong>Dev Console</strong>
17+
{:else}
18+
<IconWarning size="18" /> <Html text={$i18n.core.maintenance}></Html>
19+
{/if}
20+
</aside>
21+
22+
<style lang="scss">
23+
.banner {
24+
height: var(--banner-height);
25+
26+
background: var(--color-tertiary);
27+
color: var(--color-tertiary-contrast);
28+
29+
display: flex;
30+
justify-content: center;
31+
align-items: center;
32+
33+
gap: var(--padding);
34+
35+
&.warn {
36+
background: var(--color-warning);
37+
color: var(--color-warning-contrast);
38+
}
39+
}
40+
</style>

src/frontend/src/lib/components/app/core/BannerSkylab.svelte

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/frontend/src/lib/components/app/core/Navbar.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { debounce, nonNullish } from '@dfinity/utils';
33
import { fade } from 'svelte/transition';
4-
import BannerSkylab from '$lib/components/app/core/BannerSkylab.svelte';
4+
import Banner from '$lib/components/app/core/Banner.svelte';
55
import Logo from '$lib/components/app/core/Logo.svelte';
66
import NavbarSpotlight from '$lib/components/app/core/NavbarSpotlight.svelte';
77
import NavbarTitle from '$lib/components/app/core/NavbarTitle.svelte';
@@ -37,10 +37,10 @@
3737
</script>
3838

3939
{#snippet banner()}
40-
<BannerSkylab />
40+
<Banner display={isSkylab() ? 'dev' : 'maintenance'} />
4141
{/snippet}
4242

43-
<Header banner={isSkylab() ? banner : undefined} {hide}>
43+
<Header {banner} {hide}>
4444
<div class="start">
4545
{#if start === 'menu'}
4646
<ButtonMenu />

src/frontend/src/lib/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126
"environment": "Environment",
127127
"tags": "Tags",
128128
"edit_details": "Edit details",
129-
"tags_placeholder": "Comma-separated or one per line. Leave empty for no tags."
129+
"tags_placeholder": "Comma-separated or one per line. Leave empty for no tags.",
130+
"maintenance": "Juno is in <strong>maintenance</strong> and not actively developed anymore."
130131
},
131132
"canisters": {
132133
"top_up": "Top-up",

src/frontend/src/lib/i18n/zh-cn.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@
127127
"environment": "运行环境",
128128
"tags": "标签",
129129
"edit_details": "编辑详情",
130-
"tags_placeholder": "逗号分隔或每行一个,留空则不添加标签。"
130+
"tags_placeholder": "逗号分隔或每行一个,留空则不添加标签。",
131+
"maintenance": "Juno 目前处于<strong>维护模式</strong>,不再积极开发。"
131132
},
132133
"canisters": {
133134
"top_up": "充值",

src/frontend/src/lib/types/i18n.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ interface I18nCore {
130130
tags: string;
131131
edit_details: string;
132132
tags_placeholder: string;
133+
maintenance: string;
133134
}
134135

135136
interface I18nCanisters {

0 commit comments

Comments
 (0)