diff --git a/src/App.tsx b/src/App.tsx index 3c7c6ee..eb4b58b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,6 +6,7 @@ import { persistQueryClient } from '@tanstack/query-persist-client-core'; import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'; import { get as getItem, set as setItem, del as removeItem } from 'idb-keyval'; +import DomainTransferInfo from '@/components/DomainTransferInfo'; import useColorTheme from '@/hooks/useColorTheme'; import i18nextInstance from '@/i18n/i18n'; import { I18NextProvider } from '@/i18n/useTranslation'; @@ -48,12 +49,14 @@ const App: Component = () => { return ( - - } /> - } /> - } /> - } /> - + + + } /> + } /> + } /> + } /> + + ); diff --git a/src/components/DomainTransferInfo.tsx b/src/components/DomainTransferInfo.tsx new file mode 100644 index 0000000..1dd341c --- /dev/null +++ b/src/components/DomainTransferInfo.tsx @@ -0,0 +1,47 @@ +import { createSignal, Show, type Component, type JSX } from 'solid-js'; + +import XMark from 'heroicons/24/outline/x-mark.svg'; + +import SafeLink from '@/components/utils/SafeLink'; +import { useTranslation } from '@/i18n/useTranslation'; + +const isPermittedDomain = (url: URL | Location) => + url.host === 'rabbit.syusui.net' || url.host.startsWith('localhost'); + +const DomainTransferInfo: Component<{ children: JSX.Element }> = (props) => { + const i18n = useTranslation(); + const [showContent, setShowContent] = createSignal(false); + + return ( + +

{i18n()('domainTransfer.announcementHead')}

+
{i18n()('domainTransfer.announcementDescription')}
+ + + {i18n()('domainTransfer.howToMigrateSettings')} + + + + } + > + {props.children} +
+ ); +}; + +export default DomainTransferInfo; diff --git a/src/locales/en.ts b/src/locales/en.ts index 56738f9..9d2840d 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -188,4 +188,10 @@ export default { signerUnavailable: 'Please install NIP-07 browser extension.', loginWithSigner: 'Login with NIP-07 browser extension', }, + domainTransfer: { + announcementHead: 'Rabbit has moved to the new domain', + announcementDescription: 'Please update your bookmark and links', + howToMigrateSettings: 'How to migrate settings', + close: 'Close', + }, } satisfies typeof ja; diff --git a/src/locales/ja.ts b/src/locales/ja.ts index 18cc935..9fe55d4 100644 --- a/src/locales/ja.ts +++ b/src/locales/ja.ts @@ -185,4 +185,10 @@ export default { signerUnavailable: '利用にはNIP-07に対応した拡張機能が必要です。', loginWithSigner: 'NIP-07 拡張機能でログイン', }, + domainTransfer: { + announcementHead: 'Rabbitは新しいドメインに移りました', + announcementDescription: 'ブックマークやリンクの更新をお願いします', + howToMigrateSettings: '設定の移行方法について', + close: '閉じる', + }, };