Skip to content

Commit 6991e0e

Browse files
committed
feat: Use tailwind in header.
1 parent f01d4f3 commit 6991e0e

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

src/assets/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ code {
2727
@theme {
2828
--color-ht-100: oklch(0.9 0.0221 250.23);
2929
--color-ht-200: oklch(0.83 0.0314 249.73);
30-
--color-ht-900: oklch(0.453 0.0179 251.34);
30+
--color-ht-900: oklch(0.3455 0.0507 251.49);
3131
}
3232

3333
@layer base {

src/components/Elements/SearchBar/SearchBar.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,22 @@ export const SearchBar = () => {
2828
}, [])
2929

3030
return (
31-
<form className="searchBar" onSubmit={handleSubmit}>
31+
<form
32+
className="z-[1] inline-flex flex-1 items-center rounded-full bg-white py-2 sm:relative sm:mx-0 sm:my-auto sm:flex-grow-1 dark:bg-ht-100"
33+
onSubmit={handleSubmit}>
3234
{usedSearchEngine?.default === false ? (
33-
<HiSparkles className="searchBarIcon" />
35+
<HiSparkles className="mx-[16px] size-[22px] rounded-full" />
3436
) : (
3537
<img
36-
className={'searchBarIcon'}
38+
className={'mx-[16px] size-[24px] rounded-full bg-white p-[2px]'}
3739
src={`/searchengine_logos/${usedSearchEngine.label.toLowerCase()}_logo.svg`}
3840
/>
3941
)}
4042
<input
4143
ref={keywordsInputRef}
4244
type="text"
4345
name="keyword"
44-
className="searchBarInput"
46+
className="box-border w-full text-ht-900 focus:outline-none"
4547
placeholder={`Ask ${usedSearchEngine.label}`}
4648
/>
4749
</form>

src/components/Elements/UserTags/UserTags.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ export const UserTags = () => {
66
const { userSelectedTags } = useUserPreferences()
77

88
return (
9-
<div className="tags">
9+
<div className="flex w-full flex-wrap items-center gap-2">
1010
{userSelectedTags.map((tag, index) => (
11-
<span key={index} className="tag">
11+
<span
12+
key={index}
13+
className="rounded-2xl bg-ht-900 px-[8px] py-[2px] font-medium text-white dark:bg-ht-200">
1214
{tag.value}
1315
</span>
1416
))}
15-
<Link to="/settings/topics" className="tag tagHoverable" aria-label="Open settings">
16-
<TiPlus className="tagIcon" />
17-
</Link>
17+
<div className="rounded-2xl bg-ht-900 px-[8px] py-[4px] font-medium text-white hover:bg-ht-200 dark:bg-ht-200 dark:hover:bg-ht-900">
18+
<Link to="/settings/topics" aria-label="Open settings">
19+
<TiPlus className="relative mt-[-2px] fill-white dark:hover:fill-black" />
20+
</Link>
21+
</div>
1822
</div>
1923
)
2024
}

src/components/Layout/Header.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ export const Header = () => {
5656

5757
return (
5858
<>
59-
<header className="AppHeader">
60-
<span className="AppName">
61-
<i className="logo">
62-
<CgTab />
59+
<header className="sticky top-0 z-[1] mx-[1%] mt-[10px] mb-0 flex flex-row flex-wrap content-center items-center gap-[10px] md:h-auto">
60+
<span className="flex items-center pt-[4px] md:w-auto md:grow-0">
61+
<i className="me-[8px]">
62+
<CgTab size={24} />
6363
</i>{' '}
6464
<Link to="/">
65-
<HackertabLogo aria-label="hackertab.dev" className="logoText" />
65+
<HackertabLogo aria-label="hackertab.dev" className="h-[16px] w-auto fill-ht-900" />
6666
</Link>
6767
<Changelog />
6868
</span>
6969
<SearchBar />
70-
<div className="buttonsFlex extras">
70+
<div className="inline-flex flex-row items-center gap-[8px]">
7171
{isDNDModeActive() && (
72-
<Button onClick={onUnpauseClicked} className="dndButton">
72+
<Button onClick={onUnpauseClicked} className="font-bold">
7373
<MdDoDisturbOff />
7474
Unpause
7575
</Button>
@@ -86,7 +86,7 @@ export const Header = () => {
8686
</CircleButton>
8787
<CircleButton
8888
isLoading={isConnecting}
89-
className={clsx('profileImageContainer', !isConnected && 'overflowHidden')}
89+
className={clsx('relative', !isConnected && 'overflow-hidden')}
9090
onClick={() => {
9191
if (isConnected) {
9292
navigate('/settings/general')
@@ -96,15 +96,19 @@ export const Header = () => {
9696
}}>
9797
{isConnected ? (
9898
<>
99-
<img className="profileImage" src={user?.imageURL} />
100-
<div className="streak">
101-
<span className="content">
102-
<StreakIcon className="icon" /> {user?.streak || 1}
103-
</span>
99+
<img
100+
className="size-[40px] rounded-full outline-2 outline-amber-600"
101+
src={user?.imageURL}
102+
/>
103+
<div className="absolute mr-0 -mb-12 ml-0 inline-block">
104+
<div className="flex items-center justify-end rounded-[12px] border-2 border-ht-100 bg-amber-600 text-[11px] font-bold text-white">
105+
<StreakIcon className="-mt-[2px] ml-0 w-[2.2em]" />{' '}
106+
<span className="me-2 justify-self-end">{user?.streak || 1}</span>
107+
</div>
104108
</div>
105109
</>
106110
) : (
107-
<AvatarPlaceholder className="avatarPlaceholder" />
111+
<AvatarPlaceholder className="mt-[10px] size-[34px] rounded-[20px]" />
108112
)}
109113
</CircleButton>
110114
</div>

0 commit comments

Comments
 (0)