Skip to content
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
2 changes: 1 addition & 1 deletion public/page-data/index/page-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"componentChunkName": "component---src-pages-index-js",
"path": "/",
"result": {"pageContext":{}},
"staticQueryHashes": ["1128713364","1687125271","176670904","3498872882","3858639830","4070604734","4109181808","854109855","882490824"]}
"staticQueryHashes": ["1128713364","1687125271","176670904","2432702713","3498872882","3858639830","4109181808","854109855","882490824"]}
11 changes: 8 additions & 3 deletions src/components/BlogPage/BlogContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const Blog = () => {
const bannerData = useBanner()
const blogData = useBlog()
const data = blogData?.allStrapiBlogCategory?.nodes
const dataArticles = blogData?.allStrapiArticle?.nodes

const bannerBlog = bannerData?.allStrapiBanners?.nodes.find(
banner => banner.page === "blog" && banner.type === "bgColor"
Expand All @@ -22,6 +23,8 @@ const Blog = () => {
banner => banner.page === "blog" && banner.type === "actionCall"
)

const filterArticle = data.map(category => dataArticles.filter(article => category.name === article.blog_category.name))

const {
pageTitle,
pageDescription,
Expand All @@ -44,9 +47,10 @@ const Blog = () => {
<h3 dangerouslySetInnerHTML={{ __html: bannerBlog.summary }} />
</div>
)}
{data?.map((article, idx) => (
<BlogGrid key={idx} title={article.name}>
{article?.article?.map((item, idx) => (

{filterArticle?.map((category, idx) => (
<BlogGrid key={idx} title={category[0]?.blog_category?.name}>
{category.map((item, idx) => (
<BlogArticle
key={idx}
image={item.image}
Expand All @@ -60,6 +64,7 @@ const Blog = () => {
))}
</div>
)}

{bannerActionCall && <BannerActionCall banner={bannerActionCall} />}
</Layout>
)
Expand Down
26 changes: 15 additions & 11 deletions src/hooks/useBlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ const useBlog = () => {
allStrapiBlogCategory {
nodes {
name
article {
title
summary
slug
image {
url
localFile {
childImageSharp {
gatsbyImageData
}
}
}
allStrapiArticle(sort: { fields: published_at, order: DESC }) {
nodes {
title
summary
slug
image {
localFile {
childImageSharp {
gatsbyImageData
}
}
}
blog_category {
name
}
}
}
allStrapiBlogPage {
Expand All @@ -35,4 +39,4 @@ const useBlog = () => {
return query
}

export default useBlog
export default useBlog
2 changes: 1 addition & 1 deletion src/templates/BlogItemDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const query = graphql`
image {
localFile {
childImageSharp {
gatsbyImageData(width: 200)
gatsbyImageData(width: 150, height: 150)
}
}
}
Expand Down
50 changes: 30 additions & 20 deletions src/templates/BlogItemDetail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@
&__container {
width: 100%;
margin: 0 auto;
padding: 4rem 1rem 3rem;
// padding: 4rem 1rem 3rem;

p {
font-size: $small;
}
}

&__description-author {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

&__description {
margin-bottom: 2rem;
padding: 2rem 1rem;
Expand Down Expand Up @@ -95,7 +102,7 @@
justify-content: center;
align-items: center;
width: 100%;
max-width: 765px;
max-width: 420px;
padding: 15px;
margin: 20px 0;
background: $grey-light;
Expand All @@ -105,9 +112,14 @@
}

&__box-author-image {
width: 100%;
display: flex;
justify-content: center;
align-items: center;

img {
width: 120px;
height: 120px;
width: 130px;
height: 130px;
margin: 10px auto;
border-radius: 50%;
object-fit: cover;
Expand Down Expand Up @@ -246,16 +258,6 @@
margin: 1.5rem 1rem;
}

&__box-author-image {
flex-basis: 65%;
text-align: center;

img {
width: 175px;
height: 150px;
}
}

&__box-autor-description {
width: 90%;
padding: 0 1rem;
Expand All @@ -270,6 +272,13 @@
padding-right: 5rem;
}

&__description-author {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}

&__description {
padding: 4rem 2rem 3rem;

Expand Down Expand Up @@ -301,12 +310,6 @@
}
}

&__description-author {
display: flex;
justify-content: center;
margin: 3rem 0 1rem;
}

&__box-author {
margin: .7rem;
}
Expand All @@ -327,6 +330,13 @@
}
}

&__box-author-image {
img {
width: 150px;
height: 130px;
}
}

&__sidebar {
&__blog-card {
flex-direction: row;
Expand Down