Skip to content

Commit

Permalink
add additional support with links
Browse files Browse the repository at this point in the history
  • Loading branch information
wbglaeser committed Feb 16, 2025
1 parent 934e8ac commit d666b9f
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,22 @@
},
"additional_support": {
"de": {
"title": "Für mehr Informationen und Fragen zur Antragsstellung, Anspruch, etc. wenden Sie sich an Ihre lokale Wohngeldbehörde. Einen ersten Eindruck über die Mögliche Wohngeldhöhe bietet der offizielle Wohngeld-Rechner des Bundesministerium für Wohnen, Stadtentwicklung und Bauwesen",
"url": "https://www.bmwsb.bund.de/Webs/BMWSB/DE/themen/stadt-wohnen/wohnraumfoerderung/wohngeld/wohngeldrechner-2023-artikel.html"
"title": "Für mehr Informationen und Fragen zur Antragsstellung, Anspruch, etc. wenden Sie sich an Ihre lokale Wohngeldbehörde. Einen ersten Eindruck über die Mögliche Wohngeldhöhe bietet der offizielle Wohngeld-Rechner des Bundesministerium für Wohnen, Stadtentwicklung und Bauwesen.",
"links": [
{
"title": "Wohngeldrechner 2023",
"url": "https://www.bmwsb.bund.de/Webs/BMWSB/DE/themen/stadt-wohnen/wohnraumfoerderung/wohngeld/wohngeldrechner-2023-artikel.html"
}
]
},
"en": {
"title": "For more information and questions about the application process, entitlement, etc., please contact your local housing benefit authority. The official housing benefit calculator of the Federal Ministry of Housing, Urban Development and Construction provides a first impression of the possible housing benefit amount.",
"url": "https://www.bmwsb.bund.de/Webs/BMWSB/DE/themen/stadt-wohnen/wohnraumfoerderung/wohngeld/wohngeldrechner-2023-artikel.html"
"links": [
{
"title": "Housing benefit calculator 2023",
"url": "https://www.bmwsb.bund.de/Webs/BMWSB/DE/themen/stadt-wohnen/wohnraumfoerderung/wohngeld/wohngeldrechner-2023-artikel.html"
}
]
}
},
"legal_basis": {
Expand Down
2 changes: 2 additions & 0 deletions src/ui/language/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const translations = {
eligibilityBtn: "Check eligibility",
whatIsIt: "What is ",
requiredDocuments: "Which documents do I need?",
additionalSupport: "Where can I get additional support?",
rulesTable: {
header: "Who is eligible?",
yourAnswer: "Your answer",
Expand Down Expand Up @@ -378,6 +379,7 @@ const translations = {
eligibilityBtn: "Anspruch prüfen",
whatIsIt: "Was ist ",
requiredDocuments: "Welche Dokumente benötige ich?",
additionalSupport: "Wo kann ich zusätzliche Unterstützung erhalten?",
rulesTable: {
header: "Wer ist anspruchsberechtigt?",
yourAnswer: "Deine Antwort",
Expand Down
9 changes: 8 additions & 1 deletion src/ui/screens/benefit-page/BenefitPageScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import useFetchBenefitPageData from './hooks/useFetchBenefitPageData';
import { useMetadataStore } from '../../storage/zustand';
import BenefitPageRequiredDocuments from './components/BenefitPageRequiredDocuments';
import ContentBox from '../../shared-components/ContentBox';
import BenefitPageSupport from './components/BenefitPageSupport';
import theme from '../../../theme';

const BenefitPageScreen = () => {
const {id} = useParams();
Expand Down Expand Up @@ -79,14 +81,19 @@ const BenefitPageScreen = () => {
<Divider />
<ContentBox>
<Typography variant="h6">{t('app.benefitPage.whatIsIt')}{benefitPageData.title}</Typography>
<Typography variant="body1">{benefitPageData.description || t('app.noData')}</Typography>
<Typography sx={{ marginTop: theme.spacing(1) }} variant="body1">{benefitPageData.description || t('app.noData')}</Typography>
</ContentBox>
<BenefitPageRules benefitId={id} validated_status={validated_status} />
{
benefitPageData.requiredDocuments.length > 0 && (
<BenefitPageRequiredDocuments requiredDocuments={benefitPageData.requiredDocuments} />
)
}
{
benefitPageData.additionalSupport.title && (
<BenefitPageSupport additionalSupport={benefitPageData.additionalSupport} />
)
}
</Box>
</AppScreenWrapper>
</Layout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { HBox, VBox } from "../../../shared-components/LayoutBoxes";
import useTranslation from "../../../language/useTranslation";
import ContentPasteIcon from '@mui/icons-material/ContentPaste';
import ContentBox from "../../../shared-components/ContentBox";
import theme from '../../../../theme';

const BenefitPageRequiredDocuments = ({ requiredDocuments }) => {
const { t } = useTranslation();
Expand All @@ -28,7 +29,7 @@ const BenefitPageRequiredDocuments = ({ requiredDocuments }) => {
</HBox>
{
showRequiredDocuments && (
<Collapse in={showRequiredDocuments}>
<Collapse in={showRequiredDocuments} sx={{ marginTop: theme.spacing(1) }}>
<VBox>
{requiredDocuments.map((doc, index) => (
<HBox key={index}>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/screens/benefit-page/components/BenefitPageRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useFetchData from "../../../shared-hooks/useFetchData";
import useBenefitPageRules from "../hooks/useBenefitPageRules";
import { VBox, HBox } from "../../../shared-components/LayoutBoxes";
import ContentBox from "../../../shared-components/ContentBox";
import theme from "../../../../theme";

const BenefitPageRules = ({ benefitId, validated_status }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -42,7 +43,7 @@ const BenefitPageRules = ({ benefitId, validated_status }) => {
</HBox>
{
showRules && (
<Collapse in={showRules}>
<Collapse in={showRules} sx={{ marginTop: theme.spacing(1) }}>
<VBox gap={1}>
{rules &&
rules.map((rule, index) => (
Expand Down
61 changes: 61 additions & 0 deletions src/ui/screens/benefit-page/components/BenefitPageSupport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React, { useState } from 'react';
import { Button, Typography } from "@mui/material";
import IconButton from "@mui/material/IconButton";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import Collapse from "@mui/material/Collapse";
import { HBox, VBox } from "../../../shared-components/LayoutBoxes";
import useTranslation from "../../../language/useTranslation";
import ContentBox from "../../../shared-components/ContentBox";
import theme from '../../../../theme';
import OpenInNewIcon from '@mui/icons-material/OpenInNew';

const BenefitPageSupport = ({ additionalSupport }) => {
const { t } = useTranslation();
const [showAdditionalSupport, setShowAdditionalSupport] = useState(false);

return (
<ContentBox sx={{ width: "100%" }}>
<HBox sx={{ alignItems: "center", cursor: "pointer" }} onClick={() => setShowAdditionalSupport(!showAdditionalSupport)}>
<Typography variant="h6">{t('app.benefitPage.additionalSupport')}</Typography>
<IconButton
sx={{
transition: "transform 0.3s",
transform: showAdditionalSupport ? "rotate(180deg)" : "rotate(0deg)",
marginLeft: "8px",
}}
>
<ExpandMoreIcon />
</IconButton>
</HBox>
{
showAdditionalSupport && (
<Collapse in={showAdditionalSupport} sx={{ marginTop: theme.spacing(1) }}>
<VBox gap={2}>
<Typography variant="body1">{additionalSupport.title}</Typography>
{
additionalSupport.links && (
<VBox gap={1}>
{
additionalSupport.links.map((link, index) => (
<a key={index} href={link.url} target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'none', color: 'inherit' }}>
<Button variant="outlined">
<HBox gap={1}>
<OpenInNewIcon />
<Typography variant="body1">{link.title}</Typography>
</HBox>
</Button>
</a>
))
}
</VBox>
)
}
</VBox>
</Collapse>
)
}
</ContentBox>
);
}

export default BenefitPageSupport;

0 comments on commit d666b9f

Please sign in to comment.