Skip to content
This repository has been archived by the owner on Feb 2, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
SatooRu65536 committed Jan 29, 2025
2 parents 1756f6a + c07cd34 commit 948c9ef
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
59 changes: 36 additions & 23 deletions app/_component/sections/notice/Announce.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
import ImageSection from '../Image';
import NoticeCard from './Card';
import { getNotices } from '@/components/loadFiles';
import { css } from '@/styled-system/css';

export default function Notice() {
interface Props {
img: string;
}

export default function Notice({ img }: Props) {
const notices = getNotices();
// ビルド時点での期限が過ぎたお知らせは表示しないï
const displayNotices = notices.filter(
(n) => n.deadline.getTime() > Date.now(),
);

if (displayNotices.length === 0) {
return null;
}

return (
<section
className={css({
padding: '50px 0',
textAlign: 'center',
})}
>
<h2
<>
<section
className={css({
paddingBottom: '30px',
fontSize: '2rem',
padding: '50px 0',
textAlign: 'center',
})}
>
お知らせ
</h2>
<h2
className={css({
paddingBottom: '30px',
fontSize: '2rem',
})}
>
お知らせ
</h2>

<div
className={css({
marginInline: 'auto',
maxWidth: '800px',
})}
>
{displayNotices.map((notice) => (
<NoticeCard key={notice.id} notice={notice} />
))}
</div>
</section>
<div
className={css({
marginInline: 'auto',
maxWidth: '800px',
})}
>
{displayNotices.map((notice) => (
<NoticeCard key={notice.id} notice={notice} />
))}
</div>
</section>

<ImageSection img={img} />
</>
);
}
3 changes: 1 addition & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default function Home() {
return (
<main>
<TopSection message={mdContents[0]} images={[hero, ...others]} />
<Notice />
<ImageSection img={imagepathes[0].path} />
<Notice img={imagepathes[0].path} />
<RecentPosts posts={posts} />
{mdContents.splice(1).map((content, index) => {
return (
Expand Down

0 comments on commit 948c9ef

Please sign in to comment.