parent
91c964b3f4
commit
809e5c33d0
8 changed files with 198 additions and 0 deletions
@ -0,0 +1,46 @@ |
||||
// it has style inside index.scss ---> // Start CheckBox Component && end CheckBox Component
|
||||
|
||||
import React from "react"; |
||||
|
||||
export default function Checkbox(props) { |
||||
return ( |
||||
<div> |
||||
<svg className="w-0 h-0 absolute pointer-events-none select-none"> |
||||
<symbol id="check" viewBox="0 0 12 10"> |
||||
<polyline |
||||
points="1.5 6 4.5 9 10.5 1" |
||||
strokeLinecap="round" |
||||
strokeLinejoin="round" |
||||
strokeWidth="2" |
||||
></polyline> |
||||
</symbol> |
||||
</svg> |
||||
|
||||
<div |
||||
className="checkbox-container flex flex-wrap justify-center items-center hover:bg-inherit border-box" |
||||
style={{ color: "#000", height: "30px" }} |
||||
> |
||||
<input |
||||
className="checkbox-input absolute hidden" |
||||
id="apples" |
||||
type="checkbox" |
||||
checked={props.checked} |
||||
/> |
||||
<label |
||||
className="checkbox flex rounded-sm transition-all duration-100 cursor-pointer select-none overflow-hidden" |
||||
style={{ padding: "6px 8px" }} |
||||
htmlFor="apples" |
||||
> |
||||
<span |
||||
className="align-bottom" |
||||
style={{ transform: "translate3d(0, 0, 0)" }} |
||||
> |
||||
<svg width="12px" height="10px"> |
||||
<use xlinkHref="#check"></use> |
||||
</svg> |
||||
</span> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
); |
||||
} |
@ -0,0 +1,39 @@ |
||||
import React from "react"; |
||||
import { |
||||
CircularProgressbar, |
||||
buildStyles, |
||||
CircularProgressbarWithChildren, |
||||
} from "react-circular-progressbar"; |
||||
|
||||
function CustomCircularProgressbar() { |
||||
const percentage = 66; |
||||
|
||||
return ( |
||||
<> |
||||
<h2>درست کار نکرد!!!</h2> |
||||
<div style={{ width: 200, height: 200 }}> |
||||
<CircularProgressbar value={percentage} text={percentage} /> |
||||
</div> |
||||
<div className="" style={{ width: 200, height: 200, marginTop: 20 }}> |
||||
<CircularProgressbarWithChildren |
||||
value={80} |
||||
styles={buildStyles({ |
||||
pathColor: "#f00", |
||||
trailColor: "transparent", |
||||
// strokeLinecap: "butt",
|
||||
})} |
||||
> |
||||
<CircularProgressbar |
||||
value={70} |
||||
styles={buildStyles({ |
||||
trailColor: "transparent", |
||||
// strokeLinecap: "butt",
|
||||
})} |
||||
/> |
||||
</CircularProgressbarWithChildren> |
||||
</div> |
||||
</> |
||||
); |
||||
} |
||||
|
||||
export default CustomCircularProgressbar; |
@ -0,0 +1,25 @@ |
||||
import React, { useState } from "react"; |
||||
|
||||
import CircularProgressbar from "./CircularProgressbar"; |
||||
|
||||
function ProgressBar() { |
||||
const list = { |
||||
1: <CircularProgressbar />, |
||||
}; |
||||
const [type, setType] = useState(1); |
||||
return ( |
||||
<div className="w-full flex flex-col items-center"> |
||||
<select |
||||
className="w-20 bg-gray-200 mb-10" |
||||
onChange={(e) => setType(e.target.value)} |
||||
> |
||||
{Object.keys(list).map((option, index) => ( |
||||
<option key={index}>{option}</option> |
||||
))} |
||||
</select> |
||||
{list[type]} |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
export default ProgressBar; |
Loading…
Reference in new issue