Skip to content

Commit 16d95ed

Browse files
committed
feat: 原文へのリンクをページ上部にも追加
1 parent 55b3e20 commit 16d95ed

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

website/src/components/templates/BaseTemplate.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,26 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
177177
<main class="flex-1 flex flex-col px-3.5 py-4 mb-8">
178178
<Breadcrumbs path={path} />
179179

180-
<div class="mt-4 flex flex-col gap-2">
180+
<div class="flex flex-col gap-2 my-4">
181181
<TranslationStatusAlert status={translationStatus} />
182182
</div>
183183

184+
{translationStatus !== "community" && (
185+
<div class="flex">
186+
<a
187+
href={`https://typst.app${route}`}
188+
target="_blank"
189+
rel="noopener noreferrer"
190+
class="inline-flex items-center text-sm underline text-gray-400 hover:text-gray-600 transition-colors"
191+
>
192+
<div class="w-4 h-4 mr-1 ">
193+
<WorldIcon />
194+
</div>
195+
原文(英語)を開く
196+
</a>
197+
</div>
198+
)}
199+
184200
<div class="prose max-w-none w-full my-6 flex-grow">
185201
{children}
186202
</div>

website/src/components/ui/common/TranslationStatusAlert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const TranslationStatusAlert: FC<TranslationStatusAlertProps> = ({
6767
return (
6868
<div
6969
class={twMerge(
70-
"border rounded-md p-4 mb-6",
70+
"border rounded-md p-4",
7171
config.bgColor,
7272
config.borderColor,
7373
config.textColor,

0 commit comments

Comments
 (0)