@@ -3,14 +3,14 @@ import styled from 'styled-components';
33import { useQuery , useMutation , useQueryClient } from '@tanstack/react-query' ;
44import { useTranslation } from 'react-i18next' ;
55import { 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' ;
88import ComplexList from '../components/complexes/organisms/ComplexList' ;
99import type { Complex } from '../types/complex' ;
1010
1111const 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
2626const PageTitleWrapper = styled . div `
27- margin-bottom: 2.5rem; /* 40px */
27+ margin-bottom: 2.5rem;
2828 text-align: center;
2929` ;
3030
3131const 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
3838const 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' ; // ボタンコンポーネントをインポート
4645import { fetchComplexes , deleteComplex } from '../services/api' ;
4746
48- const AddButtonWrapper = styled . div `
49- text-align: center;
50- margin-top: 2rem; /* 32px */
51- ` ;
52-
5347const 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