-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added streak display component acc to figma
- Loading branch information
1 parent
e1702be
commit e9af22c
Showing
6 changed files
with
48 additions
and
28 deletions.
There are no files selected for viewing
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
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,30 @@ | ||
import React, { useContext } from "react"; | ||
import { StreakContext } from "@/hooks/StreakContext"; | ||
import { getPhrase } from "@/components/header/StreakPhrase"; | ||
import fire from "../../assets/fire.svg"; | ||
|
||
const StreakDisplay: React.FC = () => { | ||
const { currentStreak } = useContext(StreakContext); | ||
const phrase = getPhrase(currentStreak); | ||
|
||
return ( | ||
<div className="bg-[#D03641] min-w-[210px] max-w-max h-[55px] rounded-md px-3 pt-0 inline-flex items-center justify-between text-white"> | ||
<div className="text-left flex-1"> | ||
<p className="text-sm font-bold leading-tight uppercase"> | ||
{phrase.split("!")[0]}! | ||
</p> | ||
<p className="text-sm font-bold leading-tight uppercase"> | ||
{phrase.split("!")[1]}! | ||
</p> | ||
</div> | ||
<div className="relative flex-shrink-0"> | ||
<img src={fire} alt="Fire" className="w-10 h-10" /> | ||
<span className="absolute font-black font-primary text-1xl text-white bottom-0 left-1/2 transform -translate-x-1/2"> | ||
{currentStreak} | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StreakDisplay; |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// streakPhrases.ts | ||
export interface StreakPhrase { | ||
min: number; | ||
max: number; | ||
|
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