update App.js, src/components/CardTrelloDesign/index.js, src/components/NewTagDesign/index.js and src/components/ProfilePicNextToEachOther/index.js

master
mahdi 3 years ago
parent 9bf243447c
commit 50fbe402d5
  1. 4
      src/App.js
  2. 19
      src/components/CardTrelloDesign/index.js
  3. 49
      src/components/NewTagDesign/index.js
  4. 8
      src/components/ProfilePicNextToEachOther/index.js

@ -128,7 +128,7 @@ function App() {
{/* ---------------------------- not usable ---------------------------- */} {/* ---------------------------- not usable ---------------------------- */}
{/* <ProductTags /> */} {/* <ProductTags /> */}
{/* <NewTagDesign /> */} <NewTagDesign />
{/* <CounterDesign /> */} {/* <CounterDesign /> */}
@ -162,7 +162,7 @@ function App() {
{/* <CourseChapter /> */} {/* <CourseChapter /> */}
{/* <Design1 /> */} {/* <Design1 /> */}
<Design2 /> {/* <Design2 /> */}
{/* <SidebarMenu /> */} {/* <SidebarMenu /> */}
{/* <SidebarDesign2 /> */} {/* <SidebarDesign2 /> */}

@ -93,21 +93,14 @@ const CardTrelloDesign = ({
</div> </div>
</div> </div>
)} )}
{showTag && {showTag &&
tags.map((tag) => ( tags.map((tag) => (
<NewTagDesign <NewTagDesign
title={tag.title} title={tag.title}
align={"flex-row-reverse"} tagClassName={`flex-row-reverse rounded-sm p-1 text-xs ${tag.className}`}
titleColor={`${tag.color}`} iconClassName={"w-4 mr-0 ml-1"}
tagBgColor={`${tag.backgroundColor}`}
border={"border-none"}
borderRadius={"rounded-sm"}
iconWidth={"w-4"}
marginRight="mr-0"
marginLeft="ml-1"
icon={tag.icon} icon={tag.icon}
paddingY={"p-1"}
paddingX={"p-1"}
/> />
))} ))}
</div> </div>
@ -148,14 +141,12 @@ CardTrelloDesign.defaultProps = {
tags: [ tags: [
{ {
title: "29 فروردین", title: "29 فروردین",
color: "text-[#007987]", className: "text-[#007987] bg-[#06BACE33]",
backgroundColor: "bg-[#06BACE33]",
icon: clock, icon: clock,
}, },
{ {
title: "12 از 13", title: "12 از 13",
color: "text-[#FFAA00]", className: "text-[#FFAA00] bg-[#FFAA0033]",
backgroundColor: "bg-[#FFAA0033]",
icon: nike, icon: nike,
}, },
], ],

@ -2,35 +2,11 @@ import React from "react";
import blackCancleIcon from "./black-cancle-icon.svg"; import blackCancleIcon from "./black-cancle-icon.svg";
const NewTagDesign = ({ const NewTagDesign = ({ title, icon, tagClassName, iconClassName }) => {
titleColor,
title,
tagBgColor,
tagBorderColor,
icon,
fontSize,
fontWeight,
border,
borderRadius,
iconWidth,
marginRight,
marginLeft,
align,
paddingY,
paddingX,
}) => {
return ( return (
<button <button className={`flex items-center ${tagClassName}`}>
className={`flex ${align} ${fontWeight} items-center ${borderRadius} ${paddingY} ${paddingX} ${border} ${fontSize} ${titleColor} ${tagBorderColor} ${tagBgColor} `}
>
{title} {title}
{icon && ( {icon && <img src={icon} alt="" className={` ${iconClassName}`} />}
<img
src={icon}
alt=""
className={`${marginRight} ${marginLeft} ${iconWidth}`}
/>
)}
</button> </button>
); );
}; };
@ -39,19 +15,10 @@ export default NewTagDesign;
NewTagDesign.defaultProps = { NewTagDesign.defaultProps = {
title: "کتاب", title: "کتاب",
align: "flex-row",
titleColor: "text-blue-600", tagClassName:
tagBgColor: "bg-blue-300", "flex flex-row items-center text-blue-600 text-xs font-sansbold p-1 p-2 bg-blue-300 border-2 border-blue-600 rounded-full",
border: "border-2", iconClassName: "w-2.5 mr-5 ml-4",
borderRadius: "rounded-full",
tagBorderColor: "border-blue-600",
fontSize: "text-xs",
fontWeight: "font-bold",
iconWidth: "w-2.5",
marginRight: "mr-5",
paddingY: "p-2",
paddingX: "p-1",
marginLeft: "ml-4",
// for icons
icon: blackCancleIcon, icon: blackCancleIcon,
}; };

@ -14,9 +14,8 @@ const ProfilePicNextToEachOther = ({ users, num, marginLeft, width }) => {
<img <img
key={i} key={i}
src={user.picture} src={user.picture}
className={`rounded-full ${width}`} className={`rounded-full ml-0.5 ${width}`}
alt="profile-pic" alt="profile-pic"
style={{ marginLeft: `${marginLeft}` }}
/> />
{Number(i) === num - 1 && ( {Number(i) === num - 1 && (
<div class="flex items-center justify-center w-10 h-10 text-xs font-medium text-white bg-gray-700 border-2 border-gray-700 rounded-full hover:bg-gray-600"> <div class="flex items-center justify-center w-10 h-10 text-xs font-medium text-white bg-gray-700 border-2 border-gray-700 rounded-full hover:bg-gray-600">
@ -33,8 +32,9 @@ export default ProfilePicNextToEachOther;
ProfilePicNextToEachOther.defaultProps = { ProfilePicNextToEachOther.defaultProps = {
num: 8, num: 8,
marginLeft: "-10px",
width: "w-10", circleClass: "w-10",
users: [ users: [
{ {
picture: profilePic1, picture: profilePic1,

Loading…
Cancel
Save