Orri sekundarioak css modulesera pasatzen ditu (#14)

* refactor: extract component

* refactor: extract component

* refactor: use comonent

* feat: Orrialde basikoa CSS modulesera pasatzen du

* chore: erabiltzen ez den konponentea kentzen du

* feat: Oina CSS modulesera pasatzen du

* refactor: CSS variable

* chore: erabiltzen ez den tema kentzen du

* chore: erabiltzen ez den objektua kentzen du

* chore: dependentziak kentzen ditu
This commit is contained in:
Aitor Urrutia
2023-12-26 11:43:01 +01:00
committed by GitHub
parent 311e25cdd7
commit 2646b21712
36 changed files with 209 additions and 783 deletions

View File

@@ -1,30 +1,16 @@
import React from 'react';
import { Helmet } from 'react-helmet';
import { Link } from 'gatsby';
import { PageProps } from 'gatsby';
import { Container } from '../components/Container';
import { Gainburua } from '../components/Gainburua';
import { GlobalStyles } from '../ui/GlobalStyles';
import { SEO } from '../components/SEO';
import { NotFound } from '../views/NotFound';
const NotFoundPage: React.FC = () => {
const NotFoundPage: React.FC<PageProps> = ({ location }) => {
return (
<>
<Helmet
title={`Ez dugu orria topatu | Laba`}
htmlAttributes={{ lang: 'eu' }}
/>
<SEO title="Ez dugu orria topatu" location={location} />
<GlobalStyles />
<Gainburua />
<Container>
<main>
<h1>Ez dugu orria topatu</h1>
<br />
<Link to="/">Hasierara bueltatu</Link>
</main>
</Container>
<NotFound />
</>
);
};

View File

@@ -1,24 +1,16 @@
import { graphql, PageProps, useStaticQuery } from 'gatsby';
import React from 'react';
import { GlobalStyles } from '../ui/GlobalStyles';
import { Container } from '../components/Container';
import ReactMarkdown from 'react-markdown';
import styled from 'styled-components';
import { font, fontWeight, size } from '../ui/theme';
import { rem } from 'polished';
import { Gainburua } from '../components/Gainburua';
import { Oina } from '../components/Oina';
import { graphql, PageProps, useStaticQuery } from 'gatsby';
import { SEO } from '../components/SEO';
import { RegularPage } from '../views/RegularPage';
import { RegularPageContent } from '../views/RegularPage/RegularPageContent';
interface DataProps {
strapiLegeOharra: {
izenburua: string;
edukia: string;
};
strapiLegeOharra: RegularPageContent;
}
const LegeOharra: React.VFC<PageProps> = ({ location }) => {
const LegeOharra: React.FC<PageProps> = ({ location }) => {
const { strapiLegeOharra } = useStaticQuery<DataProps>(graphql`
{
strapiLegeOharra {
@@ -32,64 +24,9 @@ const LegeOharra: React.VFC<PageProps> = ({ location }) => {
<>
<SEO title={strapiLegeOharra.izenburua} location={location} />
<GlobalStyles />
<Gainburua />
<Container>
<Atala>
<Edukia>{strapiLegeOharra.edukia}</Edukia>
</Atala>
</Container>
<Oina />
<RegularPage content={strapiLegeOharra} />
</>
);
};
const Atala = styled.section`
padding-top: ${rem(size.base)};
`;
const Edukia = styled(ReactMarkdown)`
font-weight: ${fontWeight.regular};
${font.base()};
p:not(-last-child) {
margin-bottom: ${rem(size.base)};
}
h1 {
${font.gargantuan()};
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.base)};
}
h2 {
${font.huge()};
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.base)};
}
h3 {
${font.large()};
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.base)};
}
h4 {
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.mini)};
}
ul {
margin-bottom: ${rem(size.base)};
}
li {
list-style: disc inside;
margin-bottom: ${rem(size.small)};
}
`;
export default LegeOharra;

View File

@@ -1,25 +1,16 @@
import { graphql, PageProps, useStaticQuery } from 'gatsby';
import React from 'react';
import { GlobalStyles } from '../ui/GlobalStyles';
import remarkGfm from 'remark-gfm';
import { Container } from '../components/Container';
import ReactMarkdown from 'react-markdown';
import styled from 'styled-components';
import { colors, font, fontWeight, size } from '../ui/theme';
import { rem } from 'polished';
import { Gainburua } from '../components/Gainburua';
import { Oina } from '../components/Oina';
import { graphql, PageProps, useStaticQuery } from 'gatsby';
import { SEO } from '../components/SEO';
import { RegularPage } from '../views/RegularPage/RegularPage';
import { RegularPageContent } from '../views/RegularPage/RegularPageContent';
interface DataProps {
strapiPribatutasunPolitika: {
izenburua: string;
edukia: string;
};
strapiPribatutasunPolitika: RegularPageContent;
}
const PribatutasunPolitika: React.VFC<PageProps> = ({ location }) => {
const PribatutasunPolitika: React.FC<PageProps> = ({ location }) => {
const { strapiPribatutasunPolitika } = useStaticQuery<DataProps>(graphql`
{
strapiPribatutasunPolitika {
@@ -33,83 +24,9 @@ const PribatutasunPolitika: React.VFC<PageProps> = ({ location }) => {
<>
<SEO title={strapiPribatutasunPolitika.izenburua} location={location} />
<GlobalStyles />
<Gainburua />
<Container>
<Atala>
<Edukia>{strapiPribatutasunPolitika.edukia}</Edukia>
</Atala>
</Container>
<Oina />
<RegularPage content={strapiPribatutasunPolitika} />
</>
);
};
const Atala = styled.section`
padding-top: ${rem(size.base)};
`;
const Edukia = styled(ReactMarkdown).attrs({ remarkPlugins: [remarkGfm] })`
font-weight: ${fontWeight.regular};
${font.base()};
p:not(-last-child) {
margin-bottom: ${rem(size.base)};
}
h1 {
${font.gargantuan()};
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.base)};
}
h2 {
${font.huge()};
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.base)};
}
h3 {
${font.large()};
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.base)};
}
h4 {
font-weight: ${fontWeight.bold};
margin-bottom: ${rem(size.mini)};
}
ul {
margin-bottom: ${rem(size.base)};
}
li {
list-style: disc inside;
margin-bottom: ${rem(size.small)};
}
table {
margin-bottom: ${rem(size.base)};
}
th {
padding: ${size.small}px;
}
td {
padding: ${size.small}px;
border: 1px solid ${colors.beltza};
}
hr {
border: 2px solid ${colors.horia};
margin-bottom: ${rem(size.base)};
margin-top: ${rem(size.base)};
}
`;
export default PribatutasunPolitika;