-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rebase * resolve conflit challengecard * improve ui iter-2 * combine filter and fix stat * fix filter, truncate description * fix challenge bug * finalize bubble, add active filter * add gap between switch and showcomplete * remove unnecessay style tag * change bubble color final
- Loading branch information
1 parent
8b32029
commit 6436193
Showing
9 changed files
with
1,618 additions
and
1,201 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import React from "react"; | ||
import { Badge } from "react-bootstrap"; | ||
import { FaTimes } from "react-icons/fa"; | ||
|
||
function FloatingStats({ | ||
totalEasy, | ||
totalMedium, | ||
totalHard, | ||
completedEasy, | ||
completedMedium, | ||
completedHard, | ||
}) { | ||
const totalChallenges = totalEasy + totalMedium + totalHard; | ||
const completedChallenges = completedEasy + completedMedium + completedHard; | ||
|
||
return ( | ||
<div | ||
style={{ | ||
position: "fixed", | ||
bottom: "80px", | ||
right: "20px", | ||
width: "220px", | ||
backgroundColor: "white", | ||
borderRadius: "10px", | ||
boxShadow: "0px 0px 10px rgba(0, 0, 0, 0.1)", | ||
padding: "15px", | ||
textAlign: "center", | ||
zIndex: 1000, | ||
}} | ||
> | ||
<div | ||
style={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "center", | ||
}} | ||
> | ||
<h5 style={{ margin: 0 }}>Stats</h5> | ||
<button | ||
onClick={() => setVisible(false)} | ||
style={{ | ||
background: "none", | ||
border: "none", | ||
cursor: "pointer", | ||
fontSize: "14px", | ||
}} | ||
> | ||
<FaTimes /> | ||
</button> | ||
</div> | ||
|
||
<div style={{ marginTop: "10px" }}> | ||
<div | ||
style={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
fontSize: "24px", | ||
fontWeight: "bold", | ||
color: "black", | ||
}} | ||
> | ||
{completedChallenges} / {totalChallenges} | ||
<div style={{ fontSize: "14px", color: "gray" }}> | ||
Overall Completed | ||
</div> | ||
</div> | ||
|
||
<div style={{ marginTop: "15px" }}> | ||
<div style={{ display: "flex", justifyContent: "space-between" }}> | ||
<Badge bg="success">Easy</Badge> | ||
<span> | ||
{completedEasy} / {totalEasy} | ||
</span> | ||
</div> | ||
<div | ||
style={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
marginTop: "8px", | ||
}} | ||
> | ||
<Badge style={{ backgroundColor: "#DAA520" }}>Medium</Badge> | ||
<span> | ||
{completedMedium} / {totalMedium} | ||
</span> | ||
</div> | ||
<div | ||
style={{ | ||
display: "flex", | ||
justifyContent: "space-between", | ||
marginTop: "8px", | ||
}} | ||
> | ||
<Badge bg="danger">Hard</Badge> | ||
<span> | ||
{completedHard} / {totalHard} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default FloatingStats; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.