Skip to content

Commit 0f8af09

Browse files
feat: save the date translation button (#70)
1 parent 91a099a commit 0f8af09

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

app/src/pages/save-the-date.tsx

+21-15
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ function TranslatedSection(
120120
const clic_cells = cells.filter((cell) => cell.commission == null);
121121
const translated_std = getTranslation(save_the_date, language_code);
122122
const tt = useTranslationTable();
123+
const router = useRouter();
123124

124125
return (
125126
<>
@@ -147,21 +148,25 @@ function TranslatedSection(
147148
</td>
148149
</tr>
149150

150-
<tr>
151-
<td style={{ padding: "1rem 0 1rem 0" }}>
152-
<center>
153-
<a
154-
href="https://clic.epfl.ch/en-US/save-the-date/"
155-
style={{
156-
background: save_the_date.button_color || undefined,
157-
...BUTTON_STYLE,
158-
}}
159-
>
160-
{tt["translated-version"]}
161-
</a>
162-
</center>
163-
</td>
164-
</tr>
151+
{router.locale === save_the_date.language_button_target ? (
152+
<></>
153+
) : (
154+
<tr>
155+
<td style={{ padding: "1rem 0 1rem 0" }}>
156+
<center>
157+
<a
158+
href={`https://clic.epfl.ch/${save_the_date.language_button_target}/save-the-date/`}
159+
style={{
160+
background: save_the_date.button_color || undefined,
161+
...BUTTON_STYLE,
162+
}}
163+
>
164+
{tt["translated-version"]}
165+
</a>
166+
</center>
167+
</td>
168+
</tr>
169+
)}
165170

166171
<tr>
167172
<td>
@@ -342,6 +347,7 @@ export const getServerSideProps: GetServerSideProps<{
342347
"title_color",
343348
"button_color",
344349
{ translations: ["*"] },
350+
"language_button_target",
345351
],
346352
})
347353
),

0 commit comments

Comments
 (0)