Karpetak ordenatzen ditu (#15)
* refactor: extract hooks * refactor: naming * refactor: naming * refactor: domain karpeta atontzen du * fix: og image konpontzen du * refactor: move component * refactor: move component * refactor: move component * refactor: move component
@@ -3,8 +3,6 @@ import { Helmet } from 'react-helmet';
|
||||
|
||||
import { PageProps } from 'gatsby';
|
||||
|
||||
import ogImagePath from '../images/og-image.jpeg';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
description?: string;
|
||||
@@ -18,7 +16,7 @@ export const SEO: React.FC<Props> = ({ title, description, location }) => (
|
||||
|
||||
<meta
|
||||
name="og:image"
|
||||
content={`${location.protocol}//${location.host}${ogImagePath}`}
|
||||
content={`${location.protocol}//${location.host}/og-image.jpeg`}
|
||||
/>
|
||||
<meta name="og:image:height" content="669" />
|
||||
<meta name="og:image:width" content="1205" />
|
||||
|
||||
20
front/src/domain/basicPage/hooks/useLegeOharraContent.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { graphql, useStaticQuery } from 'gatsby';
|
||||
|
||||
import { RegularPageContent } from '../RegularPageContent';
|
||||
|
||||
interface DataProps {
|
||||
strapiLegeOharra: RegularPageContent;
|
||||
}
|
||||
|
||||
export function useLegeOharraContent(): RegularPageContent {
|
||||
const { strapiLegeOharra } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiLegeOharra {
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
return strapiLegeOharra;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { graphql, useStaticQuery } from 'gatsby';
|
||||
|
||||
import { RegularPageContent } from '../RegularPageContent';
|
||||
|
||||
interface DataProps {
|
||||
strapiPribatutasunPolitika: RegularPageContent;
|
||||
}
|
||||
|
||||
export function usePribatutasunPolitikaContent(): RegularPageContent {
|
||||
const { strapiPribatutasunPolitika } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiPribatutasunPolitika {
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
return strapiPribatutasunPolitika;
|
||||
}
|
||||
21
front/src/domain/hasiera/hooks/useHasieraContent.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { graphql, useStaticQuery } from 'gatsby';
|
||||
|
||||
import { HasieraContent } from '../HasieraContent';
|
||||
|
||||
interface DataProps {
|
||||
strapiHasiera: HasieraContent;
|
||||
}
|
||||
|
||||
export function useHasieraContent(): HasieraContent {
|
||||
const { strapiHasiera } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiHasiera {
|
||||
deskribapena
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
return strapiHasiera;
|
||||
}
|
||||
7
front/src/domain/kafetegia/KafetegiaContent.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { MenuKonponentea } from './hooks/useKafetegiaContent';
|
||||
|
||||
export interface KafetegiaContent {
|
||||
deskribapena: string;
|
||||
izenburua: string;
|
||||
menua: MenuKonponentea[];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { graphql, useStaticQuery } from 'gatsby';
|
||||
|
||||
import { ProduktuaDTO } from '../domain/dtos/ProduktuaDTO';
|
||||
import { KafetegiaData } from './KafetegiaData';
|
||||
import { ProduktuaDTO } from '../dtos/ProduktuaDTO';
|
||||
import { KafetegiaContent } from '../KafetegiaContent';
|
||||
|
||||
export type MenuKonponentea =
|
||||
| {
|
||||
@@ -24,7 +24,7 @@ interface DataProps {
|
||||
};
|
||||
}
|
||||
|
||||
export function useKafetegiaData(): KafetegiaData {
|
||||
export function useKafetegiaContent(): KafetegiaContent {
|
||||
const {
|
||||
strapiKafetegia: { izenburua, deskribapena, menua },
|
||||
} = useStaticQuery<DataProps>(graphql`
|
||||
|
Before Width: | Height: | Size: 83 KiB |
26
front/src/pages/PribatutasunPolitika.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
|
||||
import { graphql, PageProps, useStaticQuery } from 'gatsby';
|
||||
|
||||
import { SEO } from '../components/SEO';
|
||||
import { RegularPage } from '../views/RegularPage/RegularPage';
|
||||
import { DataProps } from './pribatutasun-politika';
|
||||
|
||||
export const PribatutasunPolitika: React.FC<PageProps> = ({ location }) => {
|
||||
const { strapiPribatutasunPolitika } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiPribatutasunPolitika {
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SEO title={strapiPribatutasunPolitika.izenburua} location={location} />
|
||||
|
||||
<RegularPage content={strapiPribatutasunPolitika} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,35 +1,23 @@
|
||||
import React from 'react';
|
||||
|
||||
import { graphql, PageProps, useStaticQuery } from 'gatsby';
|
||||
import { PageProps } from 'gatsby';
|
||||
|
||||
import { SEO } from '../components/SEO';
|
||||
import { useHasieraContent } from '../domain/hasiera/hooks/useHasieraContent';
|
||||
import { Hasiera } from '../views/Hasiera/Hasiera';
|
||||
import { HasieraContent } from '../views/Hasiera/HasieraContent';
|
||||
|
||||
interface DataProps {
|
||||
strapiHasiera: HasieraContent;
|
||||
}
|
||||
|
||||
const IndexPage: React.FC<PageProps> = ({ location }) => {
|
||||
const { strapiHasiera } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiHasiera {
|
||||
deskribapena
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
const content = useHasieraContent();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SEO
|
||||
title={strapiHasiera.izenburua}
|
||||
description={strapiHasiera.deskribapena}
|
||||
title={content.izenburua}
|
||||
description={content.deskribapena}
|
||||
location={location}
|
||||
/>
|
||||
|
||||
<Hasiera content={strapiHasiera} />
|
||||
<Hasiera content={content} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -3,11 +3,11 @@ import React from 'react';
|
||||
import { PageProps } from 'gatsby';
|
||||
|
||||
import { SEO } from '../components/SEO';
|
||||
import { useKafetegiaData } from '../viewQueries/useKafetegiaData';
|
||||
import { useKafetegiaContent } from '../domain/kafetegia/hooks/useKafetegiaContent';
|
||||
import { Kafetegia } from '../views/Kafetegia';
|
||||
|
||||
const KafetegiaPage: React.FC<PageProps> = ({ location }) => {
|
||||
const content = useKafetegiaData();
|
||||
const content = useKafetegiaContent();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
import React from 'react';
|
||||
|
||||
import { graphql, PageProps, useStaticQuery } from 'gatsby';
|
||||
import { PageProps } from 'gatsby';
|
||||
|
||||
import { SEO } from '../components/SEO';
|
||||
import { useLegeOharraContent } from '../domain/basicPage/hooks/useLegeOharraContent';
|
||||
import { RegularPage } from '../views/RegularPage';
|
||||
import { RegularPageContent } from '../views/RegularPage/RegularPageContent';
|
||||
|
||||
interface DataProps {
|
||||
strapiLegeOharra: RegularPageContent;
|
||||
}
|
||||
|
||||
const LegeOharra: React.FC<PageProps> = ({ location }) => {
|
||||
const { strapiLegeOharra } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiLegeOharra {
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
const content = useLegeOharraContent();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SEO title={strapiLegeOharra.izenburua} location={location} />
|
||||
<SEO title={content.izenburua} location={location} />
|
||||
|
||||
<RegularPage content={strapiLegeOharra} />
|
||||
<RegularPage content={content} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
import React from 'react';
|
||||
|
||||
import { graphql, PageProps, useStaticQuery } from 'gatsby';
|
||||
import { PageProps } from 'gatsby';
|
||||
|
||||
import { SEO } from '../components/SEO';
|
||||
import { usePribatutasunPolitikaContent } from '../domain/basicPage/hooks/usePribatutasunPolitikaContent';
|
||||
import { RegularPage } from '../views/RegularPage/RegularPage';
|
||||
import { RegularPageContent } from '../views/RegularPage/RegularPageContent';
|
||||
|
||||
interface DataProps {
|
||||
strapiPribatutasunPolitika: RegularPageContent;
|
||||
}
|
||||
|
||||
const PribatutasunPolitika: React.FC<PageProps> = ({ location }) => {
|
||||
const { strapiPribatutasunPolitika } = useStaticQuery<DataProps>(graphql`
|
||||
{
|
||||
strapiPribatutasunPolitika {
|
||||
izenburua
|
||||
edukia
|
||||
}
|
||||
}
|
||||
`);
|
||||
const content = usePribatutasunPolitikaContent();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SEO title={strapiPribatutasunPolitika.izenburua} location={location} />
|
||||
<SEO title={content.izenburua} location={location} />
|
||||
|
||||
<RegularPage content={strapiPribatutasunPolitika} />
|
||||
<RegularPage content={content} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { MenuKonponentea } from './useKafetegiaData';
|
||||
|
||||
export interface KafetegiaData {
|
||||
deskribapena: string;
|
||||
izenburua: string;
|
||||
menua: MenuKonponentea[];
|
||||
}
|
||||
@@ -2,11 +2,11 @@ import React from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
|
||||
import Gezia from '../../assets/gezia.svg';
|
||||
import { Container } from '../../components/Container';
|
||||
import { Gainburua } from '../../components/Gainburua';
|
||||
import { Oina } from '../../components/Oina';
|
||||
import { HasieraContent } from '../../domain/hasiera/HasieraContent';
|
||||
import { Container } from '../components/Container';
|
||||
import { Gainburua } from '../components/Gainburua';
|
||||
import { Oina } from '../components/Oina';
|
||||
import * as styles from './Hasiera.module.scss';
|
||||
import { HasieraContent } from './HasieraContent';
|
||||
|
||||
interface Props {
|
||||
content: HasieraContent;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import React from 'react';
|
||||
|
||||
import { AlergenoLegenda } from '../../components/AlergenoLegenda';
|
||||
import { Container } from '../../components/Container';
|
||||
import { Gainburua } from '../../components/Gainburua';
|
||||
import { Oina } from '../../components/Oina';
|
||||
import { produktuaFactory } from '../../domain/factories/produktuaFactory';
|
||||
import { KafetegiaData } from '../../viewQueries/KafetegiaData';
|
||||
import { produktuaFactory } from '../../domain/kafetegia/factories/produktuaFactory';
|
||||
import { KafetegiaContent } from '../../domain/kafetegia/KafetegiaContent';
|
||||
import { Container } from '../components/Container';
|
||||
import { Gainburua } from '../components/Gainburua';
|
||||
import { Oina } from '../components/Oina';
|
||||
import { AlergenoLegenda } from './components/AlergenoLegenda';
|
||||
import { ProduktuZerrenda } from './components/ProduktuZerrenda';
|
||||
import * as styles from './Kafetegia.module.scss';
|
||||
|
||||
export const Kafetegia: React.FC<{ content: KafetegiaData }> = ({
|
||||
export const Kafetegia: React.FC<{ content: KafetegiaContent }> = ({
|
||||
content,
|
||||
}) => {
|
||||
const { izenburua, deskribapena, menua } = content;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '../../styles/tools/mediaQueries.scss';
|
||||
@import '../../../../styles/tools/mediaQueries.scss';
|
||||
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { mapAlergenoIdentifikadoreaToIzena } from '../../domain/mappers/mapAlergenoIdentifikadoreaToIzena';
|
||||
import { mapAlergenoIdentifikadoreaToZenbakia } from '../../domain/mappers/mapAlergenoIdentifikadoreaToZenbakia';
|
||||
import { AlergenoIdentifikadorea } from '../../domain/models/AlergenoIdentifikadorea';
|
||||
import { mapAlergenoIdentifikadoreaToIzena } from '../../../../domain/kafetegia/mappers/mapAlergenoIdentifikadoreaToIzena';
|
||||
import { mapAlergenoIdentifikadoreaToZenbakia } from '../../../../domain/kafetegia/mappers/mapAlergenoIdentifikadoreaToZenbakia';
|
||||
import { AlergenoIdentifikadorea } from '../../../../domain/kafetegia/models/AlergenoIdentifikadorea';
|
||||
import * as styles from './AlergenoLegenda.module.scss';
|
||||
import { AlergenoLogoa } from './AlergenoLogoa';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { AlergenoIdentifikadorea } from '../../domain/models/AlergenoIdentifikadorea';
|
||||
import { AlergenoIdentifikadorea } from '../../../../domain/kafetegia/models/AlergenoIdentifikadorea';
|
||||
import Apioa from './assets/alergenoak/apioa.svg';
|
||||
import Arraina from './assets/alergenoak/arraina.svg';
|
||||
import Arrautzak from './assets/alergenoak/arrautzak.svg';
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import BeganoaLogo from '../../../../assets/beganoa.svg';
|
||||
import EkologikoaLogo from '../../../../assets/ekologikoa.svg';
|
||||
import { Produktua } from '../../../../domain/models/Produktua';
|
||||
import { Produktua } from '../../../../domain/kafetegia/models/Produktua';
|
||||
import * as styles from './ProduktuZerrenda.module.scss';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -2,8 +2,8 @@ import React from 'react';
|
||||
|
||||
import { Link } from 'gatsby';
|
||||
|
||||
import { Container } from '../../components/Container';
|
||||
import { Gainburua } from '../../components/Gainburua';
|
||||
import { Container } from '../components/Container';
|
||||
import { Gainburua } from '../components/Gainburua';
|
||||
|
||||
export const NotFound: React.FC = () => (
|
||||
<>
|
||||
|
||||
@@ -3,11 +3,11 @@ import ReactMarkdown from 'react-markdown';
|
||||
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
import { Container } from '../../components/Container';
|
||||
import { Gainburua } from '../../components/Gainburua';
|
||||
import { Oina } from '../../components/Oina';
|
||||
import { RegularPageContent } from '../../domain/basicPage/RegularPageContent';
|
||||
import { Container } from '../components/Container';
|
||||
import { Gainburua } from '../components/Gainburua';
|
||||
import { Oina } from '../components/Oina';
|
||||
import * as styles from './RegularPage.module.scss';
|
||||
import { RegularPageContent } from './RegularPageContent';
|
||||
|
||||
interface Props {
|
||||
content: RegularPageContent;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '../../styles/tools/mediaQueries.scss';
|
||||
@import '../../../styles/tools/mediaQueries.scss';
|
||||
|
||||
.wrapper {
|
||||
margin-left: auto;
|
||||
@@ -1,6 +1,6 @@
|
||||
@import '../../styles/tools/mediaQueries.scss';
|
||||
@import '../../styles/tools/mixins/font.scss';
|
||||
@import '../../styles/tools/mixins/container.scss';
|
||||
@import '../../../styles/tools/mediaQueries.scss';
|
||||
@import '../../../styles/tools/mixins/font.scss';
|
||||
@import '../../../styles/tools/mixins/container.scss';
|
||||
|
||||
.geziaWrapper {
|
||||
display: none;
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { classNames } from '../../utilities/classnames';
|
||||
import { classNames } from '../../../utilities/classnames';
|
||||
import Gezia from './assets/gezia.svg';
|
||||
import Logo from './assets/logo.svg';
|
||||
import { AtalaName } from './AtalaName';
|
||||
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import { Link } from 'gatsby';
|
||||
|
||||
import { classNames } from '../../../../utilities/classnames';
|
||||
import { classNames } from '../../../../../utilities/classnames';
|
||||
import * as styles from './DesktopNabigazioa.module.scss';
|
||||
|
||||
import type { AtalaName } from '../../AtalaName';
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '../../../../styles/tools/mixins/font.scss';
|
||||
@import '../../../../../styles/tools/mixins/font.scss';
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
@@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import InstagramLogo from '../../../../assets/instagram.svg';
|
||||
import TwitterLogo from '../../../../assets/twitter.svg';
|
||||
import { classNames } from '../../../../utilities/classnames';
|
||||
import InstagramLogo from '../../../../../assets/instagram.svg';
|
||||
import TwitterLogo from '../../../../../assets/twitter.svg';
|
||||
import { classNames } from '../../../../../utilities/classnames';
|
||||
import * as styles from './KontaktuDatuak.module.scss';
|
||||
|
||||
interface Props {
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '../../../../styles/tools/mixins/font.scss';
|
||||
@import '../../../../../styles/tools/mixins/font.scss';
|
||||
|
||||
.kontaktuaWrapper {
|
||||
display: flex;
|
||||
|
Before Width: | Height: | Size: 309 KiB After Width: | Height: | Size: 309 KiB |