File tree Expand file tree Collapse file tree
src/features/settings/components/GeneralSettings Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React , { useState } from 'react'
2- import { FaGithub } from 'react-icons/fa'
2+ import { FaFire , FaGithub } from 'react-icons/fa'
33import { FcGoogle } from 'react-icons/fc'
4+ import { IoCheckmarkOutline } from 'react-icons/io5'
45import Toggle from 'react-toggle'
56import 'react-toggle/style.css'
67import { Button , ChipsSet , ConfirmModal } from 'src/components/Elements'
@@ -58,6 +59,32 @@ const UserInfo = ({ user }: UserInfoProps) => {
5859 </ Button >
5960 </ div >
6061 </ div >
62+
63+ < div className = "streaks" >
64+ < p className = "title" >
65+ You're on{ ' ' }
66+ < span >
67+ { ' ' }
68+ < FaFire color = "orange" size = { 18 } /> < b > { user . streak || 1 } days streak</ b >
69+ </ span >
70+ </ p >
71+ < div >
72+ < ul className = "streaksWeek" >
73+ { Array . from ( { length : 5 } , ( _ , i ) => {
74+ const streak = user . streak || 1
75+ if ( i < streak ) {
76+ return (
77+ < li className = "day checked" >
78+ < IoCheckmarkOutline />
79+ </ li >
80+ )
81+ } else {
82+ return < li className = "day" > </ li >
83+ }
84+ } ) }
85+ </ ul >
86+ </ div >
87+ </ div >
6188 </ div >
6289 )
6390}
Original file line number Diff line number Diff line change @@ -129,3 +129,54 @@ Select styles
129129 align-items : center;
130130 column-gap : 4px ;
131131}
132+
133+ .streaks {
134+ display : flex;
135+ flex-direction : column;
136+ row-gap : 16px ;
137+ align-self : flex-start;
138+ }
139+ .streaks .title {
140+ margin : 0 ;
141+ padding : 0 ;
142+ font-size : 0.9em ;
143+ }
144+
145+ .streaks ul .streaksWeek ::before {
146+ content : '' ;
147+ display : block;
148+ width : 100% ;
149+ height : 1px ;
150+ background-color : var (--card-content-divider );
151+ z-index : 1 ;
152+ position : absolute;
153+ margin-top : 9px ;
154+ }
155+ .streaks ul .streaksWeek {
156+ position : relative;
157+ margin : 0 ;
158+ padding : 0 ;
159+ display : flex;
160+ flex-direction : row;
161+ gap : 20px ;
162+ list-style-type : none;
163+ overflow : hidden;
164+ }
165+
166+ .streaks .day {
167+ color : white;
168+ display : flex;
169+ align-items : center;
170+ justify-content : center;
171+ width : 16px ;
172+ height : 16px ;
173+ border-radius : 20px ;
174+ border : 1px solid var (--card-content-divider );
175+ background-color : var (--card-content-divider );
176+ z-index : 2 ;
177+ }
178+
179+ .streaks .day .checked {
180+ border : 2px solid # 18bc2d ;
181+ background-color : # 18bc2d ;
182+ }
You can’t perform that action at this time.
0 commit comments