Skip to content

Commit f4e7c0e

Browse files
committed
Merge branch 'main' into feat/hide-dev-controls
2 parents cdc663e + bbfe69b commit f4e7c0e

1 file changed

Lines changed: 34 additions & 4 deletions

File tree

app/app/src/components/RenderDocument.astro

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2+
import { i18n as i18nConfig } from '~/config'
23
import { site } from '~/site'
34
import LocalesPicker from '~/components/LocalesPicker/LocalesPicker.astro'
4-
55
import logosrc from '~/assets/logo.png?url'
66
77
function splitHash(hash: string)
@@ -22,11 +22,11 @@ function splitHash(hash: string)
2222
2323
const data = Astro.props.data || {}
2424
const version = data.version || site.version || 'dev'
25-
25+
const supportedLocales: string[] = data.supportedLocales || [i18nConfig.defaultLocale]
2626
const footerText = data.footer || null
2727
---
2828

29-
<div class="controls">
29+
<div class="page-controls">
3030

3131
<LocalesPicker lang={Astro.currentLocale} />
3232

@@ -60,6 +60,19 @@ const footerText = data.footer || null
6060

6161
</div>
6262

63+
<div class="page-warnings">
64+
65+
{!supportedLocales.includes(Astro.currentLocale ?? '') && (
66+
<div class="unsupported-locale-warning">
67+
<span class="icon icon-[mdi--warning-circle] icon-align"></span>
68+
<p>
69+
<b>Sorry,</b> this document is not available in your language yet.
70+
</p>
71+
</div>
72+
)}
73+
74+
</div>
75+
6376
<div class="main">
6477

6578
<div class="content-ruler"></div>
@@ -119,7 +132,7 @@ const footerText = data.footer || null
119132
<style lang="scss">
120133
@reference "~/styles/tailwind.css";
121134

122-
.controls {
135+
.page-controls {
123136
@apply flex justify-center items-center gap-4;
124137
@apply w-full mt-8;
125138

@@ -177,6 +190,23 @@ const footerText = data.footer || null
177190
}
178191
}
179192

193+
.page-warnings {
194+
@apply flex justify-center items-center;
195+
@apply w-full mt-4 mb-4;
196+
197+
.unsupported-locale-warning {
198+
@apply flex justify-center items-center gap-2;
199+
@apply bg-orange-100;
200+
@apply px-4 py-2;
201+
@apply text-sm text-orange-800 font-semibold;
202+
@apply border border-orange-400 rounded-lg;
203+
204+
.icon {
205+
@apply text-xl;
206+
}
207+
}
208+
}
209+
180210
.main {
181211
@apply flex flex-col justify-start items-center;
182212
@apply pt-8 pb-24;

0 commit comments

Comments
 (0)