한국 경기 한국 좌측 고정, 국가명 한글 통일
This commit is contained in:
1 parent
8580bbb713
commit
90d00a817b
5 files changed
+111
-38
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import ShareButton from "./ShareButton";
|
||||
import LangSwitch from "./LangSwitch";
|
||||
import { type Lang, dict } from "@/lib/i18n";
|
||||
@@ -16,13 +16,23 @@ export default function Hero({
|
||||
lang?: Lang;
|
||||
}) {
|
||||
const t = dict(lang);
|
||||
const navigate = useNavigate();
|
||||
const home = lang === "en" ? "/?lang=en" : "/";
|
||||
// 뒤로가기: 앱 내 이력이 있으면 직전 페이지로 그대로 복귀(전체 일정의 선택 날짜 보존),
|
||||
// 없으면(공유 링크로 직접 진입 등) 전체 일정으로 이동.
|
||||
const goBack = (e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
const idx = (window.history.state?.idx as number | undefined) ?? 0;
|
||||
if (idx > 0) navigate(-1);
|
||||
else navigate(home);
|
||||
};
|
||||
return (
|
||||
<header className="pt-5 text-center">
|
||||
{back && (
|
||||
<div className="mb-3 flex items-center justify-between">
|
||||
<Link
|
||||
to={home}
|
||||
onClick={goBack}
|
||||
className="flex items-center gap-1.5 rounded-full border border-white/12 bg-white/8 px-[18px] py-[9px] text-[18px] font-bold text-white/85 active:scale-95"
|
||||
>
|
||||
{t.back}
|
||||
|
||||
Reference in new issue
Block a user