diff --git a/public/page-data/index/page-data.json b/public/page-data/index/page-data.json
index d044da83..64bd0e56 100644
--- a/public/page-data/index/page-data.json
+++ b/public/page-data/index/page-data.json
@@ -2,4 +2,4 @@
"componentChunkName": "component---src-pages-index-js",
"path": "/",
"result": {"pageContext":{}},
- "staticQueryHashes": ["1128713364","1687125271","176670904","3498872882","3858639830","4070604734","4109181808","854109855","882490824"]}
\ No newline at end of file
+ "staticQueryHashes": ["1128713364","1687125271","176670904","2432702713","3498872882","3858639830","4109181808","854109855","882490824"]}
\ No newline at end of file
diff --git a/src/components/BlogPage/BlogContainer.js b/src/components/BlogPage/BlogContainer.js
index 290b6456..45715857 100644
--- a/src/components/BlogPage/BlogContainer.js
+++ b/src/components/BlogPage/BlogContainer.js
@@ -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"
@@ -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,
@@ -44,9 +47,10 @@ const Blog = () => {
)}
- {data?.map((article, idx) => (
-
- {article?.article?.map((item, idx) => (
+
+ {filterArticle?.map((category, idx) => (
+
+ {category.map((item, idx) => (
{
))}
)}
+
{bannerActionCall && }
)
diff --git a/src/hooks/useBlog.js b/src/hooks/useBlog.js
index e3aec237..d27001f8 100644
--- a/src/hooks/useBlog.js
+++ b/src/hooks/useBlog.js
@@ -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 {
@@ -35,4 +39,4 @@ const useBlog = () => {
return query
}
-export default useBlog
\ No newline at end of file
+export default useBlog
diff --git a/src/templates/BlogItemDetail.js b/src/templates/BlogItemDetail.js
index a3cfa785..d3ee35da 100644
--- a/src/templates/BlogItemDetail.js
+++ b/src/templates/BlogItemDetail.js
@@ -87,7 +87,7 @@ export const query = graphql`
image {
localFile {
childImageSharp {
- gatsbyImageData(width: 200)
+ gatsbyImageData(width: 150, height: 150)
}
}
}
diff --git a/src/templates/BlogItemDetail.scss b/src/templates/BlogItemDetail.scss
index a3c4889f..523bf69e 100644
--- a/src/templates/BlogItemDetail.scss
+++ b/src/templates/BlogItemDetail.scss
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -301,12 +310,6 @@
}
}
- &__description-author {
- display: flex;
- justify-content: center;
- margin: 3rem 0 1rem;
- }
-
&__box-author {
margin: .7rem;
}
@@ -327,6 +330,13 @@
}
}
+ &__box-author-image {
+ img {
+ width: 150px;
+ height: 130px;
+ }
+ }
+
&__sidebar {
&__blog-card {
flex-direction: row;