parent
313d66d50b
commit
cb406a4b33
6 changed files with 79 additions and 23 deletions
@ -0,0 +1,18 @@ |
|||||||
|
import React from "react"; |
||||||
|
import RelativeCircle from "../RelativeCircle"; |
||||||
|
|
||||||
|
const CommentIcon = ({ icon, commentClassName, className, commentNum }) => { |
||||||
|
return ( |
||||||
|
<div className="relative"> |
||||||
|
<img className={`${commentClassName}`} src={icon} alt="comment-icon" /> |
||||||
|
<RelativeCircle commentNum={commentNum} className={className} /> |
||||||
|
</div> |
||||||
|
); |
||||||
|
}; |
||||||
|
|
||||||
|
export default CommentIcon; |
||||||
|
|
||||||
|
CommentIcon.defaultProps = { |
||||||
|
icon: "images/light-gray-comment-icon.svg", |
||||||
|
commentClassName: "w-10", |
||||||
|
}; |
@ -0,0 +1,28 @@ |
|||||||
|
import React, { useState } from "react"; |
||||||
|
|
||||||
|
import CommentIcon from "./CommentIcon"; |
||||||
|
import RelativeCircle from "./RelativeCircle"; |
||||||
|
|
||||||
|
function Blogs() { |
||||||
|
const list = { |
||||||
|
1: <CommentIcon />, |
||||||
|
2: <RelativeCircle />, |
||||||
|
}; |
||||||
|
const [type, setType] = useState(1); |
||||||
|
|
||||||
|
return ( |
||||||
|
<div className="w-full flex flex-col items-center"> |
||||||
|
<select |
||||||
|
className="w-20 bg-gray-200 mb-20" |
||||||
|
onChange={(e) => setType(e.target.value)} |
||||||
|
> |
||||||
|
{Object.keys(list).map((option, index) => ( |
||||||
|
<option key={index}>{option}</option> |
||||||
|
))} |
||||||
|
</select> |
||||||
|
{list[type]} |
||||||
|
</div> |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
export default Blogs; |
Loading…
Reference in new issue