Skip to content

Commit

Permalink
Merge pull request #44 from fiqus/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
JeronimoC23 authored Feb 3, 2022
2 parents abd0556 + 16db5f0 commit 7ab0e15
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 33 deletions.
69 changes: 40 additions & 29 deletions src/blogTemplates/blogPost.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { graphql } from "gatsby";
import { changeLocale } from "gatsby-plugin-react-intl";
import { useEffect } from "react";
import styled from 'styled-components'
import Img from "gatsby-image"
import data from '../content/content.json'
Expand Down Expand Up @@ -114,15 +113,16 @@ const PostContent = styled.div`
p{
margin-bottom:30px;
}
h2{
font-size: .88rem;
line-height: 23px;
color: ${styles.colors.purplePrimary};
font-weight: ${styles.fontWeight.bold};
margin-bottom: 20px;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 15px;
}
figure{
margin-bottom: 30px;
max-width: 320px;
Expand Down Expand Up @@ -202,18 +202,23 @@ const TagsTitle = styled.h4`
const Btn = styled(Button)`
display: flex;
justify-content: center;
width: fit-content;
margin-left: auto;
margin-right: auto;
`

export default function Post({ data, props }) {
export default function Post({ data: {allMarkdownRemark: { edges }} }) {
deckDeckGoHighlightElement();
const { html, frontmatter: post } = data.markdownRemark;
const intl = useIntl();

useEffect(() => {
if (post.lang !== "es") {
changeLocale(post.lang);
}
}, [post.lang]);
let post = edges[0].node.frontmatter;
let html = "";
const postFiqus = edges.forEach((e) => {
const { frontmatter: p } = e.node;
if (p.lang === intl.locale) {
post = p;
html = e.node.html;
}
})

return (
<PostContainer>
Expand All @@ -225,7 +230,7 @@ export default function Post({ data, props }) {
<BreadcrumbContainer>
<BreadcrumbWrapper>
<Breadcrumb>
<BlogLink to='/blog'>Blog</BlogLink> {post.title}
<BlogLink to='/blog'>Blog</BlogLink> / {post.title}
</Breadcrumb>
</BreadcrumbWrapper>
</BreadcrumbContainer>
Expand Down Expand Up @@ -257,28 +262,34 @@ export default function Post({ data, props }) {
);
}


export const pageQuery = graphql`
query PostQuery($slug: String!) {
markdownRemark(frontmatter: { slug: { eq: $slug } }) {
html
frontmatter {
lang
type
title
author
slug
date
tags
image{
childImageSharp {
fluid(maxWidth: 800) {
...GatsbyImageSharpFluid
query ($slug: String!) {
allMarkdownRemark(filter: {frontmatter: { type: {eq: "post"}, slug: { eq: $slug } }}){
edges {
node {
id
html
frontmatter {
lang
type
title
author
slug
date
tags
image{
childImageSharp {
fluid(maxWidth: 800) {
...GatsbyImageSharpFluid
}
}
}
imageCredits
}
timeToRead
}
imageCredits
}
timeToRead
}
}
`;
22 changes: 22 additions & 0 deletions src/components/common/SectionHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@ const ImageContainer = styled.div`
margin-right: 17px;`
}
}}
${props => {
if (props.section === 'labs') {
return `
svg {
width: 100%!important;
height: auto!important;
}
`
}
}}
}
@media (min-width: ${styles.breakpoints.m}px) and (max-width: ${styles.breakpoints.l}px){
${props => {
if (props.section === 'cultura') {
return `
svg {
width: 100%!important;
height: auto!important;
}
`
}
}}
}
`
Expand Down
2 changes: 1 addition & 1 deletion src/components/modules/FeaturedService.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ const FeaturedService = (props) => {
<FeaturedServiceWrapper ishomepage={props.ishomepage}>
<FeaturedServiceLink
ishomepage={props.ishomepage}
to='/servicios/#capacitacion'
to={intl.formatMessage({id: "service_subsection.link"})}
>
<ImageContainer ishomepage={props.ishomepage}>
<FeaturedServiceImage
Expand Down
3 changes: 2 additions & 1 deletion src/content/intl/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"title": "Training",
"description": "We provide technical and/or cooperative training for organizations, cooperatives and companies in which we seek to share in a friendly and systematized way the knowledge obtained in the technological and cooperative fields.",
"image" : "capacitacion",
"featuredServiceImageAlt" : "Training animated image"
"featuredServiceImageAlt" : "Training animated image",
"link": "servicios/#capacitacion"
},
"culture" : {
"title": "Culture",
Expand Down
3 changes: 2 additions & 1 deletion src/content/intl/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
"title": "Capacitación",
"description": "Realizamos capacitaciones técnicas y/o de cooperativismo para organizaciones, cooperativas y empresas donde buscamos transmitir de forma amena y sistematizada los conocimientos adquiridos en el ámbito tecnológico y cooperativo.",
"image" : "capacitacion",
"featuredServiceImageAlt" : "Capacitación, ilustración animada"
"featuredServiceImageAlt" : "Capacitación, ilustración animada",
"link": "servicios/#capacitacion"
},
"culture" : {
"title": "Cultura",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/labs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const pageQuery = graphql`
tags
image{
childImageSharp {
fluid(maxWidth: 800) {
fluid(maxWidth: 1500, quality: 50) {
...GatsbyImageSharpFluid
}
}
Expand Down

0 comments on commit 7ab0e15

Please sign in to comment.