diff --git a/src/css/Components/articlesbycategory.css b/src/css/Components/articlesbycategory.css
new file mode 100644
index 0000000..a458dfc
--- /dev/null
+++ b/src/css/Components/articlesbycategory.css
@@ -0,0 +1,21 @@
+#categoryName{
+ color : white;
+ text-align: left;
+ font-family: 'Wellfleet', cursive;
+ font-size:max(2.5vw,30px);
+}
+
+#categoryBlock{
+ width:60vw;
+ margin-bottom:5vh;
+}
+
+#bulles{
+ display:flex;
+}
+
+#underlinment{
+ background-color: white;
+ width:30%;
+ height:0.3vh;
+}
\ No newline at end of file
diff --git a/src/js/Components/ArticlesByCategory.js b/src/js/Components/ArticlesByCategory.js
index 9a60d14..567d82d 100644
--- a/src/js/Components/ArticlesByCategory.js
+++ b/src/js/Components/ArticlesByCategory.js
@@ -1,5 +1,5 @@
import React from 'react';
-import '../../css/Components/articles.css'
+import '../../css/Components/articlesbycategory.css'
import ArticleDetails from './ArticleDetails'
class ArticlesByCategory extends React.Component {
@@ -12,10 +12,16 @@ class ArticlesByCategory extends React.Component {
}
componentDidMount(){
- console.log(this.props.articles)
this.splitArticlesCategories()
}
+ componentDidUpdate(){
+
+ if (this.props.onSearch){
+ // implémenter une fonction de recherche en React sur articles
+ }
+ }
+
splitArticlesCategories = () => {
let counterTab = 0;
let divided = [];
@@ -36,17 +42,21 @@ class ArticlesByCategory extends React.Component {
render() {
+ console.log(this.state.articles)
return (
{this.state.articles[0][0] &&
this.state.articles.map((divided) =>
- <>
-
{divided[0].category.name}
- {divided.map((article) =>
-
- )}
- >
+
+
{divided[0].category.name}
+
+
+ {divided.map((article) =>
+
+ )}
+
+
)
}
diff --git a/src/js/Components/Sort.js b/src/js/Components/Sort.js
index 44f370e..e868455 100644
--- a/src/js/Components/Sort.js
+++ b/src/js/Components/Sort.js
@@ -19,7 +19,6 @@ class Sort extends Component {