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

Commit d13e34f

Browse files
committed
Merge branch 'main' into release
2 parents 0d9e047 + 96dbf90 commit d13e34f

File tree

18 files changed

+953
-304
lines changed

18 files changed

+953
-304
lines changed

Diff for: .env.example

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
NEXT_PUBLIC_API_KEY=
2+
NEXT_PUBLIC_AUTH_DOMAIN=
3+
NEXT_PUBLIC_PROJECT_ID=
4+
NEXT_PUBLIC_STORAGE_BUCKET=
5+
NEXT_PUBLIC_MESSAGING_SENDER_ID=
6+
NEXT_PUBLIC_APP_ID=
7+
NEXT_PUBLIC_MEASUREMENT_ID=

Diff for: .github/workflows/deploy.yml

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ jobs:
7272
- uses: stefanzweifel/git-auto-commit-action@v4
7373
with:
7474
commit_message: 'convert: Resize all images and convert to webp.'
75-
7675

7776
# Build job
7877
build:

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ yarn-error.log*
2727

2828
# local env files
2929
.env*.local
30+
.env
3031

3132
# vercel
3233
.vercel

Diff for: .prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"singleQuote": true
5+
}

Diff for: app/_component/Analytics.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use client';
2+
3+
import { logEvent } from 'firebase/analytics';
4+
import { usePathname } from 'next/navigation';
5+
import { useEffect } from 'react';
6+
import { analytics } from '../firebase';
7+
8+
export default function Analytics() {
9+
const pathname = usePathname();
10+
11+
useEffect(() => {
12+
if (!analytics) return;
13+
logEvent(analytics, 'page_view', {
14+
page_location: pathname,
15+
});
16+
}, [pathname]);
17+
18+
return <></>;
19+
}

Diff for: app/_component/MultipleMenuButton.tsx

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
"use client";
1+
'use client';
22

3-
import { useState } from "react";
4-
import MenuButton from "./MenuButton";
5-
import { ArrowUpIcon } from "@/components/icons";
6-
import { css } from "@/styled-system/css";
7-
import { Page } from "@/types";
3+
import { useState } from 'react';
4+
import MenuButton from './MenuButton';
5+
import { ArrowUpIcon } from '@/components/icons';
6+
import { css } from '@/styled-system/css';
7+
import { Page } from '@/types';
88

99
type Props = {
1010
pages: Page[];
@@ -17,45 +17,45 @@ export default function MultiMenuButton({ pages }: Props) {
1717
return (
1818
<div
1919
className={css({
20-
position: "relative",
20+
position: 'relative',
2121
})}
2222
>
2323
<button
2424
className={css({
25-
padding: "2px 5px 0",
26-
fontSize: "sm",
27-
cursor: "pointer",
28-
textAlign: "left",
29-
display: "flex",
30-
transition: "color 0.3s",
25+
padding: '2px 5px 0',
26+
fontSize: 'sm',
27+
cursor: 'pointer',
28+
textAlign: 'left',
29+
display: 'flex',
30+
transition: 'color 0.3s',
3131

32-
_hover: { color: "primary.300" },
32+
_hover: { color: 'primary.300' },
3333
})}
3434
onClick={() => setOpened((prev) => !prev)}
3535
>
3636
<ArrowUpIcon
3737
className={css({
38-
fontSize: "1.5rem",
39-
transition: "transform 0.3s",
38+
fontSize: '1.5rem',
39+
transition: 'transform 0.3s',
4040
})}
4141
style={{
42-
transform: opened ? "rotate(0deg)" : "rotate(180deg)",
42+
transform: opened ? 'rotate(0deg)' : 'rotate(180deg)',
4343
}}
4444
/>
4545
Other
4646
</button>
4747

4848
<div
4949
className={css({
50-
height: "30px",
51-
backgroundColor: "primary.500",
52-
position: "absolute",
53-
bottom: "-100%",
54-
top: "calc(100% + 5px)",
50+
height: '30px',
51+
backgroundColor: 'primary.500',
52+
position: 'absolute',
53+
bottom: '-100%',
54+
top: 'calc(100% + 5px)',
5555
left: 0,
56-
overflow: "hidden",
57-
transition: "height 0.3s",
58-
borderRadius: "0 0 5px 5px",
56+
overflow: 'hidden',
57+
transition: 'height 0.3s',
58+
borderRadius: '0 0 5px 5px',
5959
})}
6060
style={{
6161
height: opened ? `${pages.length * 30 + 5}px` : 0,
@@ -65,10 +65,10 @@ export default function MultiMenuButton({ pages }: Props) {
6565
<div
6666
key={page.id}
6767
className={css({
68-
lineHeight: "30px",
69-
paddingInline: "10px",
70-
textWrap: "nowrap",
71-
textAlign: "center",
68+
lineHeight: '30px',
69+
paddingInline: '10px',
70+
textWrap: 'nowrap',
71+
textAlign: 'center',
7272
})}
7373
onClick={() => setOpened(false)}
7474
>

Diff for: app/_component/header/base.tsx

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
"use client";
1+
'use client';
22

3-
import MenuButton from "../MenuButton";
4-
import MultiMenuButton from "../MultipleMenuButton";
5-
import Battery from "./battery";
6-
import Clock from "./clock";
7-
import Logo from "./logo";
8-
import { css } from "@/styled-system/css";
9-
import { Page } from "@/types";
3+
import MenuButton from '../MenuButton';
4+
import MultiMenuButton from '../MultipleMenuButton';
5+
import Battery from './battery';
6+
import Clock from './clock';
7+
import Logo from './logo';
8+
import { css } from '@/styled-system/css';
9+
import { Page } from '@/types';
1010

1111
type Props = {
1212
pages: Page[];
1313
};
1414

1515
export default function HeaderBase({ pages }: Props) {
16-
const singlePages = pages.filter((page) => !page.other && page.path !== "/");
16+
const singlePages = pages.filter((page) => !page.other && page.path !== '/');
1717
const multiPages = pages.filter((page) => page.other);
1818

1919
return (
2020
<header
2121
className={css({
22-
height: "40px",
23-
padding: "0 10px",
24-
backgroundColor: "primary.500",
25-
position: "fixed",
22+
height: '40px',
23+
padding: '0 10px',
24+
backgroundColor: 'primary.500',
25+
position: 'fixed',
2626
top: 0,
2727
left: 0,
2828
right: 0,
2929
zIndex: 1000,
30-
display: "none",
31-
alignItems: "center",
32-
gap: "10px",
30+
display: 'none',
31+
alignItems: 'center',
32+
gap: '10px',
3333

3434
sm: {
35-
display: "flex",
35+
display: 'flex',
3636
},
3737
})}
3838
>
@@ -50,7 +50,7 @@ export default function HeaderBase({ pages }: Props) {
5050

5151
<span
5252
className={css({
53-
marginInline: "auto",
53+
marginInline: 'auto',
5454
})}
5555
/>
5656

Diff for: app/_component/sections/notice/Announce.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import NoticeCard from "./Card";
2-
import { getNotices } from "@/components/loadFiles";
3-
import { css } from "@/styled-system/css";
1+
import NoticeCard from './Card';
2+
import { getNotices } from '@/components/loadFiles';
3+
import { css } from '@/styled-system/css';
44

55
export default function Notice() {
66
const notices = getNotices();
@@ -12,23 +12,23 @@ export default function Notice() {
1212
return (
1313
<section
1414
className={css({
15-
padding: "50px 0",
16-
textAlign: "center",
15+
padding: '50px 0',
16+
textAlign: 'center',
1717
})}
1818
>
1919
<h2
2020
className={css({
21-
paddingBottom: "30px",
22-
fontSize: "2rem",
21+
paddingBottom: '30px',
22+
fontSize: '2rem',
2323
})}
2424
>
2525
お知らせ
2626
</h2>
2727

2828
<div
2929
className={css({
30-
marginInline: "auto",
31-
maxWidth: "800px",
30+
marginInline: 'auto',
31+
maxWidth: '800px',
3232
})}
3333
>
3434
{displayNotices.map((notice) => (

Diff for: app/_component/sections/notice/Card.tsx

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
"use client";
1+
'use client';
22

3-
import Md2Html from "@/components/md2html";
4-
import { formatdate } from "@/components/util";
5-
import { css } from "@/styled-system/css";
6-
import { mdStyle } from "@/styled-system/patterns";
7-
import { NoticePage } from "@/types";
3+
import Md2Html from '@/components/md2html';
4+
import { formatdate } from '@/components/util';
5+
import { css } from '@/styled-system/css';
6+
import { mdStyle } from '@/styled-system/patterns';
7+
import { NoticePage } from '@/types';
88

99
type Props = {
1010
notice: NoticePage;
@@ -19,22 +19,22 @@ export default function NoticeCard(props: Props) {
1919
<div
2020
key={notice.id}
2121
className={css({
22-
padding: "40px",
23-
textAlign: "start",
24-
borderBottom: "1px solid rgba(0, 0, 0, 0.2)",
22+
padding: '40px',
23+
textAlign: 'start',
24+
borderBottom: '1px solid rgba(0, 0, 0, 0.2)',
2525

26-
"&:nth-child(1)": {
27-
borderTop: "1px solid rgba(0, 0, 0, 0.2)",
26+
'&:nth-child(1)': {
27+
borderTop: '1px solid rgba(0, 0, 0, 0.2)',
2828
},
2929
})}
3030
// 期限が過ぎたお知らせは非表示
31-
style={{ display: now < notice.deadline.getTime() ? "block" : "none" }}
31+
style={{ display: now < notice.deadline.getTime() ? 'block' : 'none' }}
3232
>
3333
<p>
3434
<span>{formatdate(notice.meta.created_at)}</span>
3535
<span
3636
className={css({
37-
marginLeft: "10px",
37+
marginLeft: '10px',
3838
})}
3939
>
4040
[{notice.category}]
@@ -43,16 +43,16 @@ export default function NoticeCard(props: Props) {
4343

4444
<h3
4545
className={css({
46-
fontSize: "1.5rem",
47-
fontWeight: "bold",
46+
fontSize: '1.5rem',
47+
fontWeight: 'bold',
4848
})}
4949
>
5050
{notice.meta.title}
5151
</h3>
5252

5353
<Md2Html
5454
className={mdStyle({
55-
style: "a-only",
55+
style: 'a-only',
5656
})}
5757
content={notice.content}
5858
/>

Diff for: app/firebase.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Import the functions you need from the SDKs you need
2+
import { getAnalytics } from 'firebase/analytics';
3+
import { initializeApp } from 'firebase/app';
4+
5+
// Your web app's Firebase configuration
6+
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
7+
const firebaseConfig = {
8+
apiKey: process.env.NEXT_PUBLIC_API_KEY,
9+
authDomain: process.env.NEXT_PUBLIC_AUTH_DOMAIN,
10+
projectId: process.env.NEXT_PUBLIC_PROJECT_ID,
11+
storageBucket: process.env.NEXT_PUBLIC_STORAGE_BUCKET,
12+
messagingSenderId: process.env.NEXT_PUBLIC_MESSAGING_SENDER_ID,
13+
appId: process.env.NEXT_PUBLIC_APP_ID,
14+
measurementId: process.env.NEXT_PUBLIC_MEASUREMENT_ID,
15+
};
16+
17+
const firebaseApp = initializeApp(firebaseConfig);
18+
const analytics = getAnalytics(firebaseApp);
19+
20+
export { firebaseApp, analytics };

Diff for: app/layout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Inter } from 'next/font/google';
33
import React from 'react';
44
import './globals.css';
55
import 'swiper/css/bundle';
6+
import Analytics from './_component/Analytics';
67
import Footer from './_component/footer';
78
import Header from './_component/header/header';
89
import { getPages } from '@/components/loadFiles';
@@ -57,6 +58,7 @@ export default function RootLayout({ children }: Props) {
5758
<Header pages={pages} />
5859
{children}
5960
<Footer />
61+
<Analytics />
6062
</body>
6163
</html>
6264
);

Diff for: app/page.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import AboutSection from "./_component/sections/About";
2-
import ImageSection from "./_component/sections/Image";
3-
import Notice from "./_component/sections/notice/Announce";
4-
import RecentPosts from "./_component/sections/recentpost/RecentPosts";
5-
import TopSection from "./_component/sections/top/Top";
6-
import { getPages, getPosts, getTopImages } from "@/components/loadFiles";
1+
import AboutSection from './_component/sections/About';
2+
import ImageSection from './_component/sections/Image';
3+
import Notice from './_component/sections/notice/Announce';
4+
import RecentPosts from './_component/sections/recentpost/RecentPosts';
5+
import TopSection from './_component/sections/top/Top';
6+
import { getPages, getPosts, getTopImages } from '@/components/loadFiles';
77

88
export default function Home() {
99
const pages = getPages();
1010
const posts = getPosts();
1111

12-
const topPage = pages.find((page) => page.path === "/");
13-
const mdContents = topPage ? topPage.content.split("---") : [];
12+
const topPage = pages.find((page) => page.path === '/');
13+
const mdContents = topPage ? topPage.content.split('---') : [];
1414
const imagepathes = getTopImages();
1515
const hero =
16-
imagepathes.find((image) => image.name.startsWith("hero")) ||
16+
imagepathes.find((image) => image.name.startsWith('hero')) ||
1717
imagepathes.slice(-1)[0];
1818
const others = imagepathes.filter((image) => image.name !== hero.name);
1919

0 commit comments

Comments
 (0)