Skip to content

Commit 25ae1a7

Browse files
committed
Added footer
1 parent 89126e0 commit 25ae1a7

3 files changed

Lines changed: 69 additions & 34 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
4+
const FooterWrapper = styled.footer`
5+
position: fixed;
6+
bottom: 1rem;
7+
left: 1rem;
8+
z-index: 1000;
9+
width: calc(100% - 2rem);
10+
`;
11+
12+
const FooterContentContainer = styled.div`
13+
max-width: 100%;
14+
margin: 0 auto;
15+
padding: 0 2vw;
16+
display: flex;
17+
align-items: center;
18+
justify-content: space-between;
19+
height: 3rem;
20+
`;
21+
22+
const AuthorName = styled.p`
23+
font-size: 0.875rem; /* 14px */
24+
font-weight: 500;
25+
`;
26+
27+
const ComplexCount = styled.p`
28+
font-size: 0.875rem; /* 14px */
29+
font-weight: 500;
30+
`;
31+
32+
interface FooterProps {
33+
totalComplexes: number;
34+
}
35+
36+
const Footer: React.FC<FooterProps> = ({ totalComplexes }) => {
37+
return (
38+
<FooterWrapper>
39+
<FooterContentContainer>
40+
<AuthorName>Yusuke Seki</AuthorName>
41+
{totalComplexes > 0 && <ComplexCount>{totalComplexes}</ComplexCount>}
42+
</FooterContentContainer>
43+
</FooterWrapper>
44+
);
45+
};
46+
47+
export default Footer;

frontend/src/components/common/molecules/Header.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@ import Button from '../atoms/Button';
55
// import { useNavigate } from 'react-router-dom';
66

77
const HeaderWrapper = styled.header`
8-
background-color: rgba(210, 213, 204, 0.6);
9-
backdrop-filter: blur(10px);
8+
background-color: transparent;
109
position: fixed;
1110
top: 1rem;
1211
left: 1rem;
1312
border-radius: 2rem;
1413
z-index: 1000;
1514
width: calc(100% - 2rem);
16-
box-shadow: 0 0 16px rgba(0, 0, 0, 0.1);
1715
`;
1816

1917
const NavContainer = styled.div`
2018
max-width: 100%;
2119
margin: 0 auto;
22-
padding: 0 2rem;
20+
padding: 0 2vw;
2321
display: flex;
2422
align-items: center;
2523
justify-content: space-between;
@@ -80,7 +78,7 @@ const Header: React.FC<HeaderProps> = ({ onAddNewComplex }) => {
8078
</Button>
8179
</LanguageSwitcher>
8280
</div>
83-
<Button variant="primary" size="small" onClick={onAddNewComplex}>
81+
<Button variant="primary" size="medium" onClick={onAddNewComplex}>
8482
+ {t('addNewComplexButton')}
8583
</Button>
8684
</NavContainer>

frontend/src/pages/ComplexesPage.tsx

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import styled from 'styled-components';
33
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
44
import { useTranslation } from 'react-i18next';
55
import { useNavigate } from 'react-router-dom';
6-
import Header from '../components/common/molecules/Header'; // Headerは残す
7-
// import Footer from '../components/footer/Footer';
6+
import Header from '../components/common/molecules/Header';
7+
import Footer from '../components/common/molecules/Footer';
88
import ComplexList from '../components/complexes/organisms/ComplexList';
99
import type { Complex } from '../types/complex';
1010

1111
const PageWrapper = styled.div`
1212
display: flex;
13-
padding-top: 8rem;
13+
padding-top: 8rem 0 5rem;
1414
flex-direction: column;
1515
min-height: 100vh;
1616
`;
@@ -19,37 +19,31 @@ const MainContent = styled.main`
1919
flex-grow: 1;
2020
max-width: 1200px;
2121
margin: 0 auto;
22-
padding: 2rem 1rem; /* 32px 16px */
22+
padding: 2rem 1rem;
2323
width: 100%;
2424
`;
2525

2626
const PageTitleWrapper = styled.div`
27-
margin-bottom: 2.5rem; /* 40px */
27+
margin-bottom: 2.5rem;
2828
text-align: center;
2929
`;
3030

3131
const PageTitle = styled.h2`
32-
font-size: 2.25rem; /* 36px */
32+
font-size: 2.25rem;
3333
font-weight: 700;
3434
color: #1d1d1f;
35-
margin-bottom: 0.5rem; /* 8px */
35+
margin-bottom: 0.5rem;
3636
`;
3737

3838
const PageSubtitle = styled.p`
39-
font-size: 1.125rem; /* 18px */
40-
color: #58585b; /* Apple風のサブテキストカラー */
39+
font-size: 1.125rem;
40+
color: #58585b;
4141
max-width: 600px;
4242
margin: 0 auto;
4343
`;
4444

45-
import Button from '../components/common/atoms/Button'; // ボタンコンポーネントをインポート
4645
import { fetchComplexes, deleteComplex } from '../services/api';
4746

48-
const AddButtonWrapper = styled.div`
49-
text-align: center;
50-
margin-top: 2rem; /* 32px */
51-
`;
52-
5347
const ComplexesPage: React.FC = () => {
5448
const queryClient = useQueryClient();
5549
const { t } = useTranslation();
@@ -138,21 +132,17 @@ const ComplexesPage: React.FC = () => {
138132
<PageTitle>{t('complexesPageTitle')}</PageTitle>
139133
<PageSubtitle>{t('complexesPageSubtitle')}</PageSubtitle>
140134
</PageTitleWrapper>
141-
{/* 新規登録ボタンをページコンテンツ内に追加 */}
142-
<AddButtonWrapper>
143-
<Button variant="primary" onClick={handleAddNewComplex}>
144-
+ {t('addNewComplexButton')}
145-
</Button>
146-
</AddButtonWrapper>
147-
<ComplexList
148-
complexes={complexes} // TanStack Queryがデータを管理
149-
onViewGoals={handleViewGoals}
150-
onEdit={handleEditComplex}
151-
onDelete={handleDeleteComplex}
152-
onAddNewComplex={handleAddNewComplex}
153-
/>
135+
{!isLoading && !error && (
136+
<ComplexList
137+
complexes={complexes}
138+
onViewGoals={handleViewGoals}
139+
onEdit={handleEditComplex}
140+
onDelete={handleDeleteComplex}
141+
onAddNewComplex={handleAddNewComplex}
142+
/>
143+
)}
154144
</MainContent>
155-
{/* <Footer /> */} {/* フッターは必要に応じて追加 */}
145+
<Footer totalComplexes={complexes.length} />
156146
</PageWrapper>
157147
);
158148
};

0 commit comments

Comments
 (0)