-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2627 from gulfofmaine/next-platforms
Platform pages using Next.js app router
- Loading branch information
Showing
116 changed files
with
994 additions
and
1,497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function BelowMapDefault() { | ||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use client" | ||
import { usePathname } from "next/navigation" | ||
import { Superlatives } from "Features/ERDDAP/Superlatives/index" | ||
|
||
export function HomeSuperlatives() { | ||
const path = usePathname() | ||
|
||
if (path === "/") { | ||
return <Superlatives /> | ||
} | ||
|
||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { HomeSuperlatives } from "./home" | ||
|
||
export default async function IndexBelowMap() { | ||
return ( | ||
<DehydratedPlatforms> | ||
<HomeSuperlatives /> | ||
</DehydratedPlatforms> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function CatchAll() { | ||
return null | ||
} |
11 changes: 11 additions & 0 deletions
11
app/(platformMap)/@bottom/platform/[platformId]/current_conditions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client" | ||
import { UsePlatform } from "Features/ERDDAP/hooks" | ||
import { ErddapCurrentPlatformConditions } from "Features/ERDDAP/Platform/Observations/CurrentConditions" | ||
|
||
export function CurrentConditions({ platformId }: { platformId: string }) { | ||
return ( | ||
<UsePlatform platformId={platformId}> | ||
{({ platform }) => <ErddapCurrentPlatformConditions platform={platform} />} | ||
</UsePlatform> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
app/(platformMap)/@bottom/platform/[platformId]/forecast/[standardName]/forecast.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use client" | ||
import { UsePlatform } from "Features/ERDDAP/hooks" | ||
import { useUnitSystem } from "Features/Units" | ||
import { Forecast } from "Features/ERDDAP/Platform/Forecasts/Page" | ||
|
||
export function ForecastChart({ platformId, standardName }: { platformId: string; standardName: string }) { | ||
const unitSystem = useUnitSystem() | ||
|
||
return ( | ||
<UsePlatform platformId={platformId}> | ||
{({ platform }) => <Forecast platform={platform} forecast_type={standardName} unitSystem={unitSystem} />} | ||
</UsePlatform> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/(platformMap)/@bottom/platform/[platformId]/forecast/[standardName]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { ForecastChart } from "./forecast" | ||
|
||
export default function ForecastPage({ params }: { params: { platformId: string; standardName: string } }) { | ||
return ( | ||
<DehydratedPlatforms> | ||
<ForecastChart {...params} /> | ||
</DehydratedPlatforms> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
app/(platformMap)/@bottom/platform/[platformId]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { PlatformTabs } from "./tabs" | ||
|
||
export default async function PlatformTabsLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<DehydratedPlatforms> | ||
<div style={{ marginTop: "1rem" }}> | ||
<PlatformTabs /> | ||
{children} | ||
</div> | ||
</DehydratedPlatforms> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/(platformMap)/@bottom/platform/[platformId]/observations/[standardName]/chart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client" | ||
import { ErddapObservedCondition } from "Features/ERDDAP/Platform/Observations/Condition" | ||
import { UsePlatform } from "Features/ERDDAP/hooks" | ||
|
||
export function ObservationChart({ platformId, standardName }: { platformId: string; standardName: string }) { | ||
return ( | ||
<UsePlatform platformId={platformId}> | ||
{({ platform }) => <ErddapObservedCondition platform={platform} standardName={standardName} />} | ||
</UsePlatform> | ||
) | ||
} |
15 changes: 15 additions & 0 deletions
15
app/(platformMap)/@bottom/platform/[platformId]/observations/[standardName]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { ObservationChart } from "./chart" | ||
|
||
export default function ObservedPlot({ | ||
params: { platformId, standardName }, | ||
}: { | ||
params: { platformId: string; standardName: string } | ||
}) { | ||
return ( | ||
<DehydratedPlatforms> | ||
<ObservationChart platformId={platformId} standardName={standardName} /> | ||
</DehydratedPlatforms> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
app/(platformMap)/@bottom/platform/[platformId]/observations/all/all_observations.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use client" | ||
import { UsePlatform } from "Features/ERDDAP/hooks" | ||
import { useUnitSystem } from "Features/Units" | ||
import { ErddapAllObservationsTable } from "Features/ERDDAP/Platform/Observations/Table/all" | ||
|
||
export function AllObservations({ platformId }: { platformId: string }) { | ||
const unitSystem = useUnitSystem() | ||
|
||
return ( | ||
<UsePlatform platformId={platformId}> | ||
{({ platform }) => <ErddapAllObservationsTable platform={platform} unitSystem={unitSystem} />} | ||
</UsePlatform> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/(platformMap)/@bottom/platform/[platformId]/observations/all/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { AllObservations } from "./all_observations" | ||
|
||
export default function AllObservationsPage({ params: { platformId } }: { params: { platformId: string } }) { | ||
return ( | ||
<DehydratedPlatforms> | ||
<AllObservations platformId={platformId} /> | ||
</DehydratedPlatforms> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/(platformMap)/@bottom/platform/[platformId]/observations/wind/chart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use client" | ||
import { ErddapWindObservedCondition } from "Features/ERDDAP/Platform/Observations/WindCondition" | ||
import { UsePlatform } from "Features/ERDDAP/hooks" | ||
|
||
export function WindChart({ platformId }: { platformId: string }) { | ||
return ( | ||
<UsePlatform platformId={platformId}> | ||
{({ platform }) => <ErddapWindObservedCondition platform={platform} />} | ||
</UsePlatform> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/(platformMap)/@bottom/platform/[platformId]/observations/wind/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { WindChart } from "./chart" | ||
|
||
export default function WindPlot({ params: { platformId } }: { params: { platformId: string } }) { | ||
return ( | ||
<DehydratedPlatforms> | ||
<WindChart platformId={platformId} /> | ||
</DehydratedPlatforms> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DehydratedPlatforms } from "Features/ERDDAP/hooks/DehydrateComponent" | ||
|
||
import { CurrentConditions } from "./current_conditions" | ||
|
||
export default function CurrentConditionsPage({ params: { platformId } }: { params: { platformId: string } }) { | ||
return ( | ||
<DehydratedPlatforms> | ||
<CurrentConditions platformId={platformId} /> | ||
</DehydratedPlatforms> | ||
) | ||
} |
Oops, something went wrong.