Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/components/app-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const AppNavigation = () => {
flexDirection: "column",
gap: 4,
}}
display="flex"
display="none"
>
<Typography
component="h1"
Expand Down Expand Up @@ -108,9 +108,6 @@ const AppNavigation = () => {
<MenuContainer
sx={{
px: 3,
borderTopWidth: 1,
borderTopStyle: "solid",
borderTopColor: "monochrome.300",
}}
>
<MenuButton
Expand All @@ -128,11 +125,7 @@ const AppNavigation = () => {
/>
<MenuButton
title={t({ id: "home.menu.map-view", message: "Map view" })}
active={
asPath === "/map" ||
asPath.includes("municipality") ||
asPath.includes("canton")
}
active={asPath === "/map"}
href={"/map"}
//FIXME: alter MenuButton for searchbar spacing
sx={{
Expand All @@ -143,6 +136,24 @@ const AppNavigation = () => {
},
}}
/>
{asPath.includes("canton") ||
asPath.includes("municipality") ||
asPath.includes("operator") ? (
<MenuButton
title={t({ id: "home.menu.details", message: "Details" })}
active={true}
href={"/map"}
//FIXME: alter MenuButton for searchbar spacing
sx={{
".MuiButtonBase-root": {
py: {
md: 6,
},
},
}}
/>
) : null}

<Box sx={{ flex: 1 }} />
<Search />
</MenuContainer>
Expand Down
9 changes: 4 additions & 5 deletions src/components/detail-page/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useRouter } from "next/router";
import { Fragment, useState } from "react";

import { SafeHydration } from "src/components/hydration";
import { MapLink } from "src/components/links";
import { Entity } from "src/domain/data";
import { Icon } from "src/icons";
import { useIsMobile } from "src/lib/use-mobile";
Expand Down Expand Up @@ -89,13 +88,13 @@ export const DetailPageBanner = ({
return (
<Box
sx={{
py: 5,
bgcolor: "background.paper",
pt: 5,
pb: 0,
width: "100%",
}}
id="main-content"
>
<Box
{/* <Box
display="grid"
sx={{
mb: { md: 6 },
Expand Down Expand Up @@ -129,7 +128,7 @@ export const DetailPageBanner = ({
<Trans id="detail.maplink">Back to map view</Trans>
</UILink>
</Box>
</Box>
</Box> */}

<Box sx={{ mx: "auto", my: 2 }}>
<Typography
Expand Down
15 changes: 4 additions & 11 deletions src/components/detail-page/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const DetailsPageHeader = ({ children }: DetailsPageBaseProps) => {

export const DetailsPageTitle = ({ children }: DetailsPageBaseProps) => {
return (
<Typography variant="h1" component={"h2"}>
<Typography variant="h2" component={"h2"}>
{children}
</Typography>
);
Expand Down Expand Up @@ -154,21 +154,13 @@ export const DetailsPageLayout = ({
<title>{title}</title>
</Head>
<ApplicationLayout>
<Box
sx={{
borderBottomWidth: "1px",
borderBottomStyle: "solid",
borderBottomColor: "monochrome.300",
}}
>
<Box>
<ContentWrapper
sx={{
flexGrow: 1,
backgroundColor: "background.paper",
}}
>
{BannerContent}
</ContentWrapper>
></ContentWrapper>
</Box>
<Box
sx={{
Expand All @@ -190,6 +182,7 @@ export const DetailsPageLayout = ({
download={download}
selector={!isMobile && SidebarContent ? SidebarContent : null}
>
{BannerContent}
{MainContent}
</DetailPageContentLayout>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const PriceDistributionHistograms = ({ id, entity }: SectionProps) => {
>
<CardTitle>
<Trans id="detail.card.title.prices.distribution">
Prize distribution in Switzerland
Price distribution in Switzerland
</Trans>
</CardTitle>
<CardDescription>
Expand Down
24 changes: 24 additions & 0 deletions src/components/detail-page/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ export const DetailsPageSidebar = (props: SectionProps) => {
Electricity tariffs
</Trans>
</SidebarItem>
<SidebarItem href={`/${entity}/${id}#components`}>
<Trans id="details.page.navigation.price-components-item">
Price components
</Trans>
</SidebarItem>
<SidebarItem href={`/${entity}/${id}#evolution`}>
<Trans id="details.page.navigation.tariff-development-item">
Tariff development
</Trans>
</SidebarItem>
<SidebarItem
href={`/${entity}/${id}#distribution
#main-content`}
>
<Trans id="details.page.navigation.price-distribution-item">
Price distribution in Switzerland
</Trans>
</SidebarItem>
<SidebarItem href={`/${entity}/${id}#comparison`}>
<Trans id="details.page.navigation.canton-comparison-item">
Canton comparison
</Trans>
</SidebarItem>

{/* FIXME: Make this only a preview and add a coming soon label */}
{sunshineFlag && entity === "operator" ? (
<SafeHydration>
Expand Down
2 changes: 1 addition & 1 deletion src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const Header = ({
<SwissFederalCiHeader
longTitle={t({
id: "header.long-title",
message: "Federal Electricity Commission ElCom",
message: "Electricity tariffs in Switzerland",
})}
shortTitle="ElCom"
rootHref="/"
Expand Down
1 change: 1 addition & 0 deletions src/components/operator-documents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export const OperatorDocuments = ({ id }: { id: string }) => {
startIcon={<Icon name="download" size={20} />}
onClick={handleOpen}
color="tertiary"
sx={{ flexShrink: 0 }}
>
<Typography
variant="body2"
Expand Down
35 changes: 25 additions & 10 deletions src/locales/aa/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ msgstr "detail.card.title.prices.distribution"
msgid "detail.card.title.prices.evolution"
msgstr "detail.card.title.prices.evolution"

#: src/components/detail-page/banner.tsx
msgid "detail.maplink"
msgstr "detail.maplink"

#: src/components/detail-page/banner.tsx
msgid "detail.municipalities"
msgstr "detail.municipalities"
Expand All @@ -121,6 +117,10 @@ msgstr "detail.operator"
msgid "detail.operators"
msgstr "detail.operators"

#: src/components/detail-page/sidebar.tsx
msgid "details.page.navigation.canton-comparison-item"
msgstr "details.page.navigation.canton-comparison-item"

#: src/components/detail-page/sidebar.tsx
msgid "details.page.navigation.costs-and-tariffs-item"
msgstr "details.page.navigation.costs-and-tariffs-item"
Expand All @@ -141,6 +141,14 @@ msgstr "details.page.navigation.operational-standards-item"
msgid "details.page.navigation.power-stability-item"
msgstr "details.page.navigation.power-stability-item"

#: src/components/detail-page/sidebar.tsx
msgid "details.page.navigation.price-components-item"
msgstr "details.page.navigation.price-components-item"

#: src/components/detail-page/sidebar.tsx
msgid "details.page.navigation.price-distribution-item"
msgstr "details.page.navigation.price-distribution-item"

#: src/components/detail-page/sidebar.tsx
msgid "details.page.navigation.sunshine-indicators-title"
msgstr "details.page.navigation.sunshine-indicators-title"
Expand All @@ -149,6 +157,10 @@ msgstr "details.page.navigation.sunshine-indicators-title"
msgid "details.page.navigation.sunshine-overview-item"
msgstr "details.page.navigation.sunshine-overview-item"

#: src/components/detail-page/sidebar.tsx
msgid "details.page.navigation.tariff-development-item"
msgstr "details.page.navigation.tariff-development-item"

#: src/components/info-dialog.tsx
msgid "dialog.close"
msgstr "dialog.close"
Expand Down Expand Up @@ -381,6 +393,10 @@ msgstr "home.hero-section.primary-cta"
msgid "home.hero-section.title"
msgstr "home.hero-section.title"

#: src/components/app-layout.tsx
msgid "home.menu.details"
msgstr "home.menu.details"

#: src/components/app-layout.tsx
msgid "home.menu.map-view"
msgstr "home.menu.map-view"
Expand Down Expand Up @@ -1179,9 +1195,9 @@ msgstr "sunshine.costs-and-tariffs.energy-tariffs"
msgid "sunshine.costs-and-tariffs.energy-tariffs-comparison-title"
msgstr "sunshine.costs-and-tariffs.energy-tariffs-comparison-title"

#: src/components/info-dialog-props.ts
#: src/components/map-details-chart-adapters.tsx
#: src/pages/sunshine/[entity]/[id]/costs-and-tariffs.tsx
#: src/pages/sunshine/[entity]/[id]/costs-and-tariffs.tsx
msgid "sunshine.costs-and-tariffs.energy-tariffs-trend"
msgstr "sunshine.costs-and-tariffs.energy-tariffs-trend"

Expand Down Expand Up @@ -1218,19 +1234,19 @@ msgstr "sunshine.costs-and-tariffs.net-tariffs"
msgid "sunshine.costs-and-tariffs.net-tariffs-comparison-title"
msgstr "sunshine.costs-and-tariffs.net-tariffs-comparison-title"

#: src/components/info-dialog-props.ts
#: src/components/map-details-chart-adapters.tsx
#: src/pages/sunshine/[entity]/[id]/costs-and-tariffs.tsx
#: src/pages/sunshine/[entity]/[id]/costs-and-tariffs.tsx
msgid "sunshine.costs-and-tariffs.net-tariffs-trend"
msgstr "sunshine.costs-and-tariffs.net-tariffs-trend"

#: src/pages/sunshine/[entity]/[id]/overview.tsx
msgid "sunshine.costs-and-tariffs.net-tariffs.overview"
msgstr "sunshine.costs-and-tariffs.net-tariffs.overview"

#: src/components/info-dialog-props.ts
#: src/components/map-details-chart-adapters.tsx
#: src/components/network-costs-trend-card.tsx
#: src/pages/sunshine/[entity]/[id]/costs-and-tariffs.tsx
msgid "sunshine.costs-and-tariffs.network-cost-trend"
msgstr "sunshine.costs-and-tariffs.network-cost-trend"

Expand Down Expand Up @@ -1409,7 +1425,6 @@ msgstr "sunshine.operational-standards.title"
msgid "sunshine.overview-sunshine.description"
msgstr "sunshine.overview-sunshine.description"

#: src/pages/sunshine/[entity]/[id]/overview.tsx
#: src/pages/sunshine/[entity]/[id]/overview.tsx
#: src/pages/sunshine/[entity]/[id]/overview.tsx
msgid "sunshine.overview-sunshine.title"
Expand Down Expand Up @@ -1507,7 +1522,7 @@ msgstr "sunshine.power-stability.saidi-trend.overview"
msgid "sunshine.power-stability.saidi.comparison-card-title"
msgstr "sunshine.power-stability.saidi.comparison-card-title"

#: src/pages/sunshine/[entity]/[id]/power-stability.tsx
#: src/components/info-dialog-props.ts
msgid "sunshine.power-stability.saidi.info-dialog-label"
msgstr "sunshine.power-stability.saidi.info-dialog-label"

Expand All @@ -1532,7 +1547,7 @@ msgstr "sunshine.power-stability.saifi-trend.overview"
msgid "sunshine.power-stability.saifi.comparison-card-title"
msgstr "sunshine.power-stability.saifi.comparison-card-title"

#: src/pages/sunshine/[entity]/[id]/power-stability.tsx
#: src/components/info-dialog-props.ts
msgid "sunshine.power-stability.saifi.info-dialog-label"
msgstr "sunshine.power-stability.saifi.info-dialog-label"

Expand Down
Loading