Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/links #327

Merged
merged 2 commits into from
Mar 22, 2022
Merged
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
4 changes: 2 additions & 2 deletions contents/home-page/home.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ support:
cards:
- title: Domande frequenti
description: Scopri i dettagli dell’iniziativa e le informazioni chiave sulle opportunità del PNRR
isModal: false
link: /supporto/faq
- title: Contatti
description: Compila il modulo per inviarci i tuoi suggerimenti o per avere chiarimenti sull’iniziativa
isModal: true
link: /supporto/ricevi-aggiornamenti
heroMain:
category: 'le misure del pnrr'
title: Il punto di accesso alle risorse per la transizione digitale della PA
Expand Down
15 changes: 2 additions & 13 deletions src/layouts/IndexPage.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect } from 'react';
import React, { useEffect } from 'react';
import { createUseStyles } from 'react-jss';
import { announce } from '@react-aria/live-announcer';
import {
Expand All @@ -20,7 +20,6 @@ import { HomeCarousel } from '../components/carousel/HomeCarousel';
import { SEO } from '../components/SEO';
import seo from '../../contents/seo.yml';
import labels from '../../contents/labels.yml';
import { GlobalStateContext } from '../context/globalContext';
import { SupportSection } from './faq/SupportSection';
import { OpportunitySection } from './home/OpportunitySection';

Expand All @@ -47,7 +46,6 @@ const useStyles = createUseStyles({

export const IndexPage = () => {
const classes = useStyles();
const [, dispatch] = useContext(GlobalStateContext);

useEffect(() => {
announce('Pagina caricata ' + name);
Expand Down Expand Up @@ -101,16 +99,7 @@ export const IndexPage = () => {
titleId="home-italia-digitale"
/>
<HeroCarousel content={heroCarouselNews} title={heroCarouselNewsTitle} />
<SupportSection
supportList={support.cards}
title={support.title}
buttonLabel={support.buttonLabel}
handleToggle={() => {
dispatch({
type: 'SET:TOGGLE_MODAL_MESSAGE',
});
}}
/>
<SupportSection supportList={support.cards} title={support.title} buttonLabel={support.buttonLabel} />
</>
);
};
26 changes: 4 additions & 22 deletions src/layouts/faq/SupportSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const useStyles = createUseStyles({

export const SupportSection = (props) => {
const classes = useStyles();
const { title, supportList, buttonLabel, handleToggle } = props;
const { title, supportList, buttonLabel } = props;
return (
<>
<section className="section section-muted" aria-labelledby="support-section">
Expand All @@ -128,25 +128,8 @@ export const SupportSection = (props) => {
<Row>
{supportList.map((card) => (
<Col key={card.title} md={5} lg={4} xl={3} className={classes.colCard}>
{card.isModal ? (
<div
role="button"
tabIndex="0"
onKeyPress={handleToggle}
onClick={handleToggle}
className={classes.resetButton}
>
<Card teaser noWrapper className={classes.cardWrapper}>
<CardBody>
<CardTitle tag="h5" className={classes.cardTitle}>
{card.title}
</CardTitle>
<CardText className={classes.cardText}>{card.description}</CardText>
</CardBody>
</Card>
</div>
) : (
<Link to="/supporto/faq" className={classes.cleanLink}>
{
<Link to={card.link} className={classes.cleanLink}>
<Card teaser noWrapper className={classes.cardWrapper}>
<CardBody>
<CardTitle tag="h5" className={classes.cardTitle}>
Expand All @@ -156,7 +139,7 @@ export const SupportSection = (props) => {
</CardBody>
</Card>
</Link>
)}
}
</Col>
))}
</Row>
Expand Down Expand Up @@ -185,5 +168,4 @@ SupportSection.propTypes = {
title: PropTypes.string,
supportList: PropTypes.array,
buttonLabel: PropTypes.string,
handleToggle: PropTypes.func,
};
16 changes: 4 additions & 12 deletions src/layouts/support/Assistance.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/* eslint-disable prettier/prettier */
import React, { useContext } from 'react';
import React from 'react';
import { createUseStyles } from 'react-jss';
import { Button } from 'design-react-kit';
import { Link } from 'gatsby';
import { HeroTitle } from '../../components/hero/HeroTitle';
import { HeroBody } from '../../components/hero/HeroBody';
import { HeroCtaContainer } from '../../components/hero/HeroCtaContainer';
import { HeroGraphic } from '../../components/hero/HeroGraphic';
import { Hero } from '../../components/hero/Hero';
import content from '../../../contents/support-page/support.yml';
import { GlobalStateContext } from '../../context/globalContext';

const {
heroAssistance: { title, body, btnText },
Expand Down Expand Up @@ -37,7 +36,6 @@ const useStyle = createUseStyles({

export const Assistance = () => {
const classes = useStyle();
const [, dispatch] = useContext(GlobalStateContext);

return (
<React.Fragment>
Expand All @@ -47,15 +45,9 @@ export const Assistance = () => {
<HeroTitle title={title} className={classes.heroTitle} />
<HeroBody html={body} />
<HeroCtaContainer>
<Button
color="primary"
className={classes.heroBtn}
onClick={() => {
dispatch({ type: 'SET:TOGGLE_MODAL_MESSAGE' });
}}
>
<Link to="/supporto/assistenza" className={`${classes.heroBtn} btn btn-primary`}>
{btnText}
</Button>
</Link>
</HeroCtaContainer>
</div>
<HeroGraphic className="col-lg-6 text-center mt-4 mt-lg-0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UpdatesPage } from '../layouts/UpdatesPage';
import { UpdatesPage } from '../../layouts/UpdatesPage';

const Page = () => <UpdatesPage title="Ricevi Aggiornamenti" />;
export default Page;