feat: align frontend languages with posts api
This commit is contained in:
@@ -3,6 +3,7 @@ import { useState } from "react";
|
||||
import { Link, Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import { ArkLogoMark } from "../components/ArkLogoMark";
|
||||
import { useI18n, type Lang } from "../i18n";
|
||||
import { LANG_OPTIONS } from "../i18nLanguages";
|
||||
import { adminUiPrefix } from "../adminPaths";
|
||||
|
||||
type PublicNavWhich =
|
||||
@@ -165,9 +166,11 @@ export function PublicLayout() {
|
||||
onChange={(e) => setLang(e.target.value as Lang)}
|
||||
aria-label={t("langLabel")}
|
||||
>
|
||||
<option value="zh-TW">繁體中文</option>
|
||||
<option value="zh-CN">简体中文</option>
|
||||
<option value="en">English</option>
|
||||
{LANG_OPTIONS.map((option) => (
|
||||
<option key={option.code} value={option.code}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<button
|
||||
@@ -194,6 +197,21 @@ export function PublicLayout() {
|
||||
className="flex-1 bg-transparent text-sm outline-none placeholder:text-[#777985]"
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-1 flex items-center gap-2 rounded-full border border-ark-line bg-[#1a1b20] px-3 py-2">
|
||||
<Globe size={16} className="shrink-0 text-ark-gold/80" />
|
||||
<select
|
||||
className="w-full bg-transparent text-sm text-neutral-200 outline-none"
|
||||
value={lang}
|
||||
onChange={(e) => setLang(e.target.value as Lang)}
|
||||
aria-label={t("langLabel")}
|
||||
>
|
||||
{LANG_OPTIONS.map((option) => (
|
||||
<option key={option.code} value={option.code}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<Link
|
||||
to="/"
|
||||
className={navClassName(na("home"))}
|
||||
|
||||
Reference in New Issue
Block a user