Skip to content

Commit

Permalink
feat: 天気予報情報を画面に適用
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkk11 committed Sep 24, 2024
1 parent d3b0798 commit d552448
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as LocationTitle from "@/features/weather/components/location_title"
import * as WeatherForecast from "@/features/weather/components/weather_forecast"
import * as WeatherInfo from "@/features/weather/components/weather_info"
import * as WeatherInfoDetail from "@/features/weather/components/weather_info_detail"
import { Day } from "@/features/weather/const"
Expand Down Expand Up @@ -26,9 +27,14 @@ export const Container = () => {
children: <WeatherInfoDetail.Container {...weatherInfoCurrentProps} />,
} satisfies WeatherInfo.ContainerProps

const weatherForecastProps = {
forecast: data.forecast,
} satisfies WeatherForecast.ContainerProps

const presenterProps = {
locationTitleNode: <LocationTitle.Container {...locationTitleProps} />,
weatherInfoNode: <WeatherInfo.Container {...weatherInfoProps} />,
weatherForecastNode: <WeatherForecast.Container {...weatherForecastProps} />,
} satisfies PresenterProps
return <Presenter {...presenterProps} />
}
2 changes: 2 additions & 0 deletions src/features/weather/components/weather_overview/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as LocationTitle from "@/features/weather/components/location_title"
import * as WeatherForecast from "@/features/weather/components/weather_forecast"
import * as WeatherInfo from "@/features/weather/components/weather_info"

import * as styles from "./loading.css"
Expand All @@ -8,6 +9,7 @@ export const Loading = () => {
<div className={styles.module}>
<LocationTitle.Loading />
<WeatherInfo.Loading />
<WeatherForecast.Loading />
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Meta, StoryObj } from "@storybook/react"
import { BrowserRouter } from "react-router-dom"

import * as LocationTitle from "@/features/weather/components/location_title"
import * as WeatherForecast from "@/features/weather/components/weather_forecast"
import * as WeatherInfo from "@/features/weather/components/weather_info"
import * as WeatherInfoDetail from "@/features/weather/components/weather_info_detail"
import { mock } from "@/features/weather/services/forecast/mock"
Expand All @@ -21,7 +23,15 @@ const meta = {
}
/>
),
weatherForecastNode: <WeatherForecast.Container forecast={mock.forecast} />,
},
decorators: [
(Story) => (
<BrowserRouter>
<Story />
</BrowserRouter>
),
],
} satisfies Meta<typeof Presenter>
export default meta

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import * as styles from "./presenter.css"
export type PresenterProps = {
locationTitleNode: ReactNode
weatherInfoNode: ReactNode
weatherForecastNode: ReactNode
}

export const Presenter = ({ ...props }: PresenterProps) => {
return (
<div className={styles.module}>
{props.locationTitleNode}
{props.weatherInfoNode}
{props.weatherForecastNode}
</div>
)
}

0 comments on commit d552448

Please sign in to comment.