update src/components/AnimatedProgressBar/index.js, src/components/CardTrelloDesign/index.js and src/components/ProductSalesAmount/Design2/index.js

master
mahdi 3 years ago
parent 3586249922
commit 0f8fd5edeb
  1. 14
      src/components/AnimatedProgressBar/index.js
  2. 4
      src/components/CardTrelloDesign/index.js
  3. 14
      src/components/ProductSalesAmount/Design2/index.js

@ -12,7 +12,7 @@ const AnimatedProgressBar = ({ rangeWidth, parentBg, childBg }) => {
return ( return (
<div className={`flex-row w-full rounded-full h-2 ${parentBg}`}> <div className={`flex-row w-full rounded-full h-2 ${parentBg}`}>
<div <div
className={`h-2 rounded-full dark:bg-gray-300 duration-500 ${childBg}`} className={`h-full rounded-full dark:bg-gray-300 duration-500 ${childBg}`}
style={{ width: progressBar ? rangeWidth : 0 }} style={{ width: progressBar ? rangeWidth : 0 }}
></div> ></div>
</div> </div>
@ -26,3 +26,15 @@ AnimatedProgressBar.defaultProps = {
parentBg: "bg-gray-200", parentBg: "bg-gray-200",
childBg: "bg-gray-600", childBg: "bg-gray-600",
}; };
// const [rangePercent, setRangePercent] = useState(55);
// w-[${
// rangePercent + "%"
// }]
// className={
// "h-full bg-gray-300 " +
// `${rangePercent ? "w-[" + rangePercent + "%]" : ""}`
// }
// className={'h-full bg-gray-300"+ `${rangePercent ? 'w-[' + rangePercent + '%]' : ''}`}

@ -114,8 +114,8 @@ const CardTrelloDesign = ({
</div> </div>
{/* progressBar */} {/* progressBar */}
<AnimatedProgressBar <AnimatedProgressBar
rangeWidth={"39%"} rangeWidth={"10%"}
parentBg={"bg-[#E3E3E3]"} parentBg={"bg-[#E3E3E3] ltr"}
childBg={"bg-[#06BACE]"} childBg={"bg-[#06BACE]"}
/> />
</div> </div>

@ -1,18 +1,10 @@
import React, { useEffect, useState } from "react"; import React from "react";
import AnimatedProgressBar from "../../AnimatedProgressBar"; import AnimatedProgressBar from "../../AnimatedProgressBar";
import TitleSubtitle from "../../TitleSubtitle"; import TitleSubtitle from "../../TitleSubtitle";
import ellipse from "./Ellipse.svg"; import ellipse from "./Ellipse.svg";
const Design2 = ({ title, incomes }) => { const Design2 = ({ incomes }) => {
const [progressFlag, setProgressFlag] = useState(false);
useEffect(() => {
setTimeout(() => {
setProgressFlag(true);
}, 100);
}, []);
return ( return (
<div className="bg-white rounded shadow mx-auto py-7 px-4"> <div className="bg-white rounded shadow mx-auto py-7 px-4">
{/* title */} {/* title */}
@ -32,8 +24,6 @@ const Design2 = ({ title, incomes }) => {
export default Design2; export default Design2;
Design2.defaultProps = { Design2.defaultProps = {
title: "میزان فروش محصولات",
incomes: [ incomes: [
{ {
image: ellipse, image: ellipse,

Loading…
Cancel
Save