@@ -5,18 +5,40 @@ import React,{ useState,useEffect } from 'react';
55import { listBlogsWithCategoriesAndTaglists } from '../../actions/blog' ;
66import { API } from '../../config' ;
77import Card from "../../components/blog/Card" ;
8+ import LabelIcon from '@material-ui/icons/Label' ;
9+ import CategoryIcon from '@material-ui/icons/Category' ;
810
911
1012const Blogs = ( { blogs, categories, taglists, size} ) => {
1113 const listAndDisplayAllBlogs = ( ) => {
1214 return blogs . map ( ( blog , index ) => (
1315 < article key = { index } >
1416 < Card blog = { blog } />
15- < hr style = { { backgroundColor :"white" , height :"2px" , width :"100%" } } />
17+ < hr style = { { backgroundColor :"white" , height :"2px" , width :"100%" , filter : "blur(3px)" } } />
1618 </ article >
1719 ) )
1820 }
1921
22+ const listAndDisplayAllTheCategories = ( ) => {
23+ return categories . map ( ( cat , index ) => {
24+ return (
25+ < Link href = { `/categories/${ cat . slug } ` } key = { index } >
26+ < a className = "btn btn-sm btn-success mr-1 ml-1 mt-3" > { cat . name } </ a >
27+ </ Link >
28+ )
29+ } )
30+ } ;
31+
32+ const listAndDisplayAllTheTaglists = ( ) => {
33+ return taglists . map ( ( tagg , index ) => {
34+ return (
35+ < Link key = { index } href = { `/taglists/${ tagg . slug } ` } >
36+ < a className = "btn btn-sm btn-info mr-1 ml-1 mt-3 mb-4" > { tagg . name } </ a >
37+ </ Link >
38+ )
39+ } )
40+ } ;
41+
2042 return (
2143 < >
2244 < Layout >
@@ -27,7 +49,13 @@ const Blogs = ({blogs,categories,taglists,size}) => {
2749 < h1 className = "display-4 font-weight-bold text-center" > Tech Blogs</ h1 >
2850 </ div >
2951 < section >
30- < p > show categories and tags</ p >
52+ < div className = "pb-5 text-center" >
53+ < CategoryIcon style = { { color :"limegreen" } } /> { listAndDisplayAllTheCategories ( ) }
54+ < br />
55+ < LabelIcon style = { { color :"teal" } } /> { listAndDisplayAllTheTaglists ( ) }
56+ { /* {JSON.stringify(taglists)} */ }
57+ { /* {JSON.stringify(categories)} */ }
58+ </ div >
3159 </ section >
3260 </ header >
3361 </ div >
0 commit comments