update 4 files and delete 1 file

master
mahdi andalib 3 years ago
parent 313d66d50b
commit cb406a4b33
  1. 19
      src/components/Blogss/design1/index.js
  2. 17
      src/components/CardTrelloDesign/index.js
  3. 18
      src/components/MiniComponents/CommentIcon/index.js
  4. 6
      src/components/MiniComponents/RelativeCircle/index.js
  5. 28
      src/components/MiniComponents/index.js
  6. 14
      src/redux/data.js

@ -1,13 +1,12 @@
import RelativeCircle from "../../RelativeCircle"; import CommentIcon from "../../MiniComponents/CommentIcon";
import RelativeCircle from "../../MiniComponents/RelativeCircle";
const BlogDesign1 = ({ const BlogDesign1 = ({
blogTitle, blogTitle,
blogExcerpt, blogExcerpt,
blogAuthor, blogAuthor,
blogComments, blogComments,
commentNum,
featuredImage, featuredImage,
commentIcon,
}) => { }) => {
return ( return (
<div className="w-fit flex items-strech justify-around p-4 bg-white"> <div className="w-fit flex items-strech justify-around p-4 bg-white">
@ -39,14 +38,11 @@ const BlogDesign1 = ({
<p className="text-sm text-[#818181] ml-2 font-light"> <p className="text-sm text-[#818181] ml-2 font-light">
{blogComments} {blogComments}
</p> </p>
<div class="relative"> <CommentIcon
<img class="w-7 rounded-full" src={commentIcon} alt="" /> commentClassName="w-7"
<RelativeCircle commentNum={"26"}
className={ className="w-5 h-5 bg-[#818181] text-white text-[10px] font-sansbold absolute top-0 right-0 transform translate-x-1 -translate-y-2"
"font-sansbold absolute top-0 right-0 transform translate-x-2 -translate-y-2 text-[10px] bg-[#818181] text-white " />
}
/>
</div>
</div> </div>
)} )}
</div> </div>
@ -68,5 +64,4 @@ BlogDesign1.defaultProps = {
commentNum: `26`, commentNum: `26`,
featuredImage: "images/blog-featured-image.jpg", featuredImage: "images/blog-featured-image.jpg",
commentIcon: "images/light-gray-comment-icon.svg",
}; };

@ -9,6 +9,9 @@ import messageText from "./images/message-text.svg";
import ProfilePicNextToEachOther from "../ProfilePicNextToEachOther"; import ProfilePicNextToEachOther from "../ProfilePicNextToEachOther";
import AnimatedProgressBar from "../AnimatedProgressBar"; import AnimatedProgressBar from "../AnimatedProgressBar";
import RelativeCircle from "../MiniComponents/RelativeCircle";
import CommentIcon from "../MiniComponents/CommentIcon";
const CardTrelloDesign = ({ const CardTrelloDesign = ({
circle, circle,
commnets, commnets,
@ -72,14 +75,12 @@ const CardTrelloDesign = ({
<span className="text-xs ml-0.5 text-[10px] text-[#707070]"> <span className="text-xs ml-0.5 text-[10px] text-[#707070]">
10 10
</span> </span>
<div className="relative"> <CommentIcon
<img icon={messageText}
src={messageText} commentClassName="w-5"
alt="comment-icon" commentNum={false}
class="w-5 rounded-full" className="w-2.5 h-2.5 bg-[#0AABFF] absolute top-0 left-0 transfrom -translate-x-0.5 border-white"
/> />
<span class="absolute bottom-3 right-3 w-2.5 h-2.5 border-2 border-white bg-[#0AABFF] rounded-full"></span>
</div>
</div> </div>
)} )}
{showTag && {showTag &&

@ -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",
};

@ -3,7 +3,7 @@ import React from "react";
const RelativeCircle = ({ commentNum, className }) => { const RelativeCircle = ({ commentNum, className }) => {
return ( return (
<span <span
class={`w-6 h-6 flex flex-col items-center justify-center text-center rounded-full border-2 ${className}`} class={`flex flex-col items-center justify-center rounded-full border-2 ${className}`}
> >
{commentNum} {commentNum}
</span> </span>
@ -13,6 +13,6 @@ const RelativeCircle = ({ commentNum, className }) => {
export default RelativeCircle; export default RelativeCircle;
RelativeCircle.defaultProps = { RelativeCircle.defaultProps = {
commentNum: "26", commentNum: "44",
className: "", className: "w-7 w-7 bg-red-600 text-white border-blue-400",
}; };

@ -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;

@ -9,6 +9,9 @@ import Banners from "../components/Banners";
import Blogss from "../components/Blogss"; import Blogss from "../components/Blogss";
import CardTrelloDesign from "../components/CardTrelloDesign"; import CardTrelloDesign from "../components/CardTrelloDesign";
// mini components
import MiniComponents from "../components/MiniComponents";
// import ButtonDesign from "./components/buttonDesign/ButtonDesign"; // import ButtonDesign from "./components/buttonDesign/ButtonDesign";
// import ProductDesign from "./components/productDesign/ProductDesign"; // import ProductDesign from "./components/productDesign/ProductDesign";
// import ProductTags from "./components/productTags/ProductTags"; // import ProductTags from "./components/productTags/ProductTags";
@ -199,6 +202,17 @@ const components = [
code: null, code: null,
}, },
}, },
// mini components
{
name: "Mini Components",
author: "Andalib",
props: [],
content: {
name: "Mini Components used in Main Components",
component: <MiniComponents />,
code: null,
},
},
]; ];
export default components; export default components;

Loading…
Cancel
Save