Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/Layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Transition from '../Transition';
import Navbar from '../Navbar';
import Head from './Head';
import Footer from '../Footer';
import MigrationNotice from '../MigrationNotice';
import './index.scss';

if (typeof window !== 'undefined') {
Expand All @@ -17,6 +18,7 @@ const Layout = ({ children, location }) => (
<div className="layout">
<Head />
<Navbar location={location} />
<MigrationNotice />
<Transition location={location}>
<div className="container-fluid">{children}</div>
</Transition>
Expand Down
38 changes: 38 additions & 0 deletions src/components/MigrationNotice/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useState, useEffect } from 'react';
import './index.scss';

function MigrationNotice() {
const [isVisible, setIsVisible] = useState(false);

useEffect(() => {
const hasSeenNotice = localStorage.getItem('migration-notice-seen');
if (!hasSeenNotice) {
setIsVisible(true);
}
}, []);

const handleClose = () => {
setIsVisible(false);
localStorage.setItem('migration-notice-seen', 'true');
};

if (!isVisible) return null;

return (
<div className="migration-notice">
<div className="migration-notice-content">
<span>
⚠️ このブログ記事は&nbsp;
<a href="https://yumenomatayume.net" target="_blank" rel="noopener noreferrer">
yumenomatayume.net
</a>
&nbsp;のブログページへ移行しました。
2026/3/31 に本サイトは閉鎖し、新しいサイトにリダイレクトされます。
</span>
<button type="button" className="close-btn" onClick={handleClose}>×</button>
</div>
</div>
);
}

export default MigrationNotice;
48 changes: 48 additions & 0 deletions src/components/MigrationNotice/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.migration-notice {
background: #dc3545;
color: white;
padding: 0.75rem 0;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

.migration-notice-content {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;

span {
flex: 1;
font-size: 0.9rem;
line-height: 1.4;
}

.close-btn {
background: none;
border: none;
color: white;
font-size: 18px;
cursor: pointer;
padding: 0.25rem;
opacity: 0.8;
flex-shrink: 0;

&:hover {
opacity: 1;
}
}
}

@media (max-width: 768px) {
.migration-notice-content {
span {
font-size: 0.85rem;
}
}
}
}