Skip to content

Commit d1a2770

Browse files
committed
feat: enhance streak display with new icon and styling adjustments
1 parent fa162ac commit d1a2770

5 files changed

Lines changed: 40 additions & 18 deletions

File tree

src/assets/App.css

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,29 +1164,34 @@ Producthunt item
11641164
width: 40px;
11651165
height: 40px;
11661166
border-radius: 50%;
1167-
border: 1px solid var(--tooltip-accent-color);
1167+
border: 2px solid #ff8f1f;
11681168
}
11691169

11701170
.streak {
11711171
position: absolute;
11721172
display: inline-block;
1173-
bottom: -12px;
1173+
bottom: -8px;
11741174
left: 0;
11751175
right: 0;
11761176
color: white;
11771177

11781178
.content {
1179-
background-color: var(--tooltip-accent-color);
1180-
font-size: 10px;
1179+
background-color: #995826;
1180+
font-size: 11px;
11811181
border-radius: 12px;
11821182
font-weight: bold;
1183-
padding: 2px 8px;
1183+
border: 2px solid black;
1184+
padding: 1px 6px 1px 22px;
11841185
display: inline-flex;
11851186
align-items: center;
11861187
justify-content: center;
1188+
color: white;
11871189
}
11881190
.icon {
1189-
font-size: 12px;
1191+
width: 2.2em;
1192+
position: absolute;
1193+
left: 0;
1194+
top: -2px;
11901195
}
11911196
}
11921197
}

src/assets/icons/fire_icon.svg

Lines changed: 5 additions & 0 deletions
Loading

src/components/Layout/Header.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { BsFillBookmarksFill, BsFillGearFill, BsMoonFill } from 'react-icons/bs'
33
import { CgTab } from 'react-icons/cg'
44
import { FaUser } from 'react-icons/fa'
55
import { IoMdSunny } from 'react-icons/io'
6-
import { MdDoDisturbOff, MdFlashOn } from 'react-icons/md'
6+
import { MdDoDisturbOff } from 'react-icons/md'
77
import { Link, useLocation, useNavigate } from 'react-router-dom'
8+
import { ReactComponent as StreakIcon } from 'src/assets/icons/fire_icon.svg'
89
import { ReactComponent as HackertabLogo } from 'src/assets/logo.svg'
910
import { SearchBar } from 'src/components/Elements/SearchBar'
1011
import { UserTags } from 'src/components/Elements/UserTags'
@@ -13,7 +14,6 @@ import { Changelog } from 'src/features/changelog'
1314
import { identifyUserTheme, trackDNDDisable, trackThemeSelect } from 'src/lib/analytics'
1415
import { useUserPreferences } from 'src/stores/preferences'
1516
import { Button, CircleButton } from '../Elements'
16-
1717
export const Header = () => {
1818
const { openAuthModal, user, isConnected } = useAuth()
1919

@@ -97,7 +97,7 @@ export const Header = () => {
9797
<img className="profileImage s" src={user?.imageURL} />
9898
<div className="streak">
9999
<span className="content">
100-
<MdFlashOn className="icon" /> {user?.streak || 1}
100+
<StreakIcon className="icon" /> {user?.streak || 1}
101101
</span>
102102
</div>
103103
</>

src/features/settings/components/GeneralSettings/GeneralSettings.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React, { useState } from 'react'
2-
import { FaFire, FaGithub } from 'react-icons/fa'
2+
import { FaGithub } from 'react-icons/fa'
33
import { FcGoogle } from 'react-icons/fc'
44
import { IoCheckmarkOutline } from 'react-icons/io5'
55
import Toggle from 'react-toggle'
66
import 'react-toggle/style.css'
7+
import { ReactComponent as StreakIcon } from 'src/assets/icons/fire_icon.svg'
78
import { Button, ChipsSet, ConfirmModal } from 'src/components/Elements'
89
import { Footer } from 'src/components/Layout'
910
import { SettingsContentLayout } from 'src/components/Layout/SettingsContentLayout'
@@ -64,9 +65,9 @@ const UserInfo = ({ user }: UserInfoProps) => {
6465
<div className="streaks">
6566
<p className="title">
6667
You're on{' '}
67-
<span>
68-
{' '}
69-
<FaFire color="orange" size={18} /> <b>{pluralize(user.streak || 1, 'day')} streak</b>
68+
<span className="highlight">
69+
<StreakIcon className="icon" />
70+
{pluralize(user.streak || 1, 'day')} streak
7071
</span>
7172
</p>
7273
<div>

src/features/settings/components/GeneralSettings/generalSettings.css

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,22 @@ Select styles
135135
flex-direction: column;
136136
row-gap: 16px;
137137
align-self: flex-start;
138-
}
139-
.streaks .title {
140-
margin: 0;
141-
padding: 0;
142-
font-size: 0.9em;
138+
139+
.title {
140+
margin: 0;
141+
padding: 0;
142+
font-size: 0.9em;
143+
}
144+
.icon {
145+
width: 1.6em;
146+
vertical-align: bottom;
147+
position: relative;
148+
top: 2px;
149+
}
150+
.highlight {
151+
font-weight: 900;
152+
color: #ff8f1f;
153+
}
143154
}
144155

145156
.streaks ul.streaksWeek::before {

0 commit comments

Comments
 (0)