Skip to content

Commit

Permalink
include streak-block svg's and grayscale no-streakers
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanhollman committed Feb 12, 2024
1 parent 66e1eb6 commit b509067
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/assets/streak-block-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/streak-block-flame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/streak-block-star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
padding: 10px 5px;

background-color: rgb(255, 200, 0);
background-image: url("https://d35aaqx5ub95lt.cloudfront.net/images/profile/92bd1526f88a4bea08ff2d5ad9783311.svg");
background-image: url("/src/assets/streak-block-background.svg");
background-repeat: no-repeat;
background-size: 100% 100%;
border-color: rgb(255, 200, 0);
border-style: solid solid none;

&.inactive {
filter: grayscale(100%);
}

.icon {
border-style: none;
}
Expand All @@ -27,6 +31,7 @@
left: 18px;
width: 21px;
}

.star-position-b {
position: absolute;
height: 27px;
Expand Down
29 changes: 6 additions & 23 deletions src/components/StreakView/User/StreakBlock/StreakBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import styles from "./StreakBlock.module.less";
import starSvg from "../../../../assets/streak-block-star.svg";
import flameSvg from "../../../../assets/streak-block-flame.svg";

type StreakBlockProps = {
days: number;
Expand All @@ -8,18 +10,14 @@ export const StreakBlock = (props: StreakBlockProps) => {

return (
<div className={styles.streakBlock}>
<div className={styles.container}>
<div className={`${styles.container} ${!isActive && styles.inactive}`}>
{isActive && (
<>
<Star positionClass={styles.starPositionA} />
<Star positionClass={styles.starPositionB} />
</>
)}
{isActive ? (
<Flame positionClass={styles.flamePosition} />
) : (
<DisabledFlame positionClass={styles.flamePosition} />
)}
<Flame positionClass={styles.flamePosition} />
<div className={styles.streakNumberWrapper}>
<h1>{props.days}</h1>
<span>Day streak</span>
Expand All @@ -31,27 +29,12 @@ export const StreakBlock = (props: StreakBlockProps) => {

const Star = (props: { positionClass: string }) => {
return (
<img
className={`${styles.icon} ${props.positionClass}`}
src="https://d35aaqx5ub95lt.cloudfront.net/images/profile/f68d647fdc1536870945a5c84f3b3b82.svg"
/>
<img className={`${styles.icon} ${props.positionClass}`} src={starSvg} />
);
};

const Flame = (props: { positionClass: string }) => {
return (
<img
className={`${styles.icon} ${props.positionClass}`}
src="https://d35aaqx5ub95lt.cloudfront.net/images/profile/8a6dca76019d059a81c4c7c1145aa7a4.svg"
/>
);
};

const DisabledFlame = (props: { positionClass: string }) => {
return (
<img
className={`${styles.icon} ${props.positionClass}`}
src="https://d35aaqx5ub95lt.cloudfront.net/images/icons/ba95e6081679d9d7e8c132da5cfce1ec.svg"
/>
<img className={`${styles.icon} ${props.positionClass}`} src={flameSvg} />
);
};

0 comments on commit b509067

Please sign in to comment.