Skip to content

Commit 75600d5

Browse files
committed
Rebased with latest develop
1 parent c61cd5b commit 75600d5

13 files changed

Lines changed: 580 additions & 117 deletions

File tree

app/[slug]/page.tsx

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ import RecorderGradientIcon from "@/app/components/theme/Icon/recorderGradientIc
2121
import SEOComponent from "@/app/components/theme/SEOComponent/SEOComponent";
2222
import { detectBrowser } from "@/app/libs/helpers";
2323
import EdgeIcon from "@/app/components/theme/Icon/edgeIcon";
24+
import { useTheme } from "@/app/contexts/themeContext";
2425

2526
const Page = ({ params: { slug } }: { params: { slug: string } }) => {
2627
const [browser, setBrowser] = useState("chrome");
28+
const { isLightTheme } = useTheme();
29+
const logoSrc = isLightTheme ? "/images/bb-logo-light.svg" : "/images/bb-logo.svg";
2730

2831
useEffect(() => {
2932
setBrowser(detectBrowser());
@@ -56,16 +59,16 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
5659
ogDescription={meta_data?.og_description}
5760
ogImage={meta_data?.og_image}
5861
/>
59-
<div className="md:max-w-[1170px] mx-auto">
62+
<div className={`md:max-w-[1170px] mx-auto ${DevelopmentToolsStyles.pageContainer}`}>
6063
<div className="px-3 md:px-auto mx-auto">
6164
{/*Hero cta section */}
6265
<section className="md:pt-0 pt-9">
63-
<div className="bg-[#090B0B] text-white flex flex-col items-center justify-center pl-6 pr-4 mt-10 rounded-lg">
66+
<div className={`bg-[#090B0B] text-white flex flex-col items-center justify-center pl-6 pr-4 mt-10 rounded-lg ${DevelopmentToolsStyles.promoPanel}`}>
6467
<div className="w-full flex md:flex-row flex-col md:items-center items-start md:justify-between justify-start gap-8 md:py-4 py-8 md:px-7">
6568
{/* Left Section */}
6669
<div className="text-left flex-1">
6770
<Image
68-
src="/images/bb-logo.svg"
71+
src={logoSrc}
6972
alt="BetterBugs Logo"
7073
className="mb-8"
7174
width={200}
@@ -86,7 +89,9 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
8689
</p>
8790
<div className="flex items-center gap-3 mt-6 mb-4">
8891
<Link target="_blank" href={Extension_URL}>
89-
<Button className="btn-primary flex items-center z-20 justify-center gap-3 rounded-full px-4">
92+
<Button
93+
className={`btn-primary flex items-center z-20 justify-center gap-3 rounded-full px-4 ${DevelopmentToolsStyles.addToChromeButton}`}
94+
>
9095
{browser === "edge" ? (
9196
<EdgeIcon className="w-7 h-7" />
9297
) : (
@@ -169,7 +174,7 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
169174
</div>
170175
</section>
171176

172-
<div className="md:pb-[70px] md:pt-[30px] py-[50px]">
177+
<div className={`md:pb-[70px] md:pt-[30px] py-[50px] ${DevelopmentToolsStyles.contentWrapper}`}>
173178
{/* Heading section */}
174179
{hero_section && (
175180
<section>
@@ -209,7 +214,7 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
209214
{/* Tools Panel - 20% width, fixed */}
210215
{development_tools_list?.length > 0 && (
211216
<div className="md:w-1/4 md:sticky left-0 md:top-8 top-2 h-full overflow-y-auto flex flex-col">
212-
<div className="bg-[#FFFFFF1A] p-4 rounded-xl">
217+
<div className={DevelopmentToolsStyles.sidePanel}>
213218
<div className="flex items-center mb-6">
214219
<h2 className="text-xl font-bold text-gray-800">
215220
Other Tools
@@ -218,7 +223,7 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
218223
{development_tools_list?.map((tool: any, index: any) => (
219224
<Link key={index} href={tool?.url}>
220225
<div
221-
className={`p-3 mb-2 cursor-pointer rounded-xl border-[1px] border-transparent hover:border-1 hover:border-primary bg-black text-white hover:text-primary`}
226+
className={`p-3 mb-2 cursor-pointer rounded-xl border-[1px] border-transparent hover:border-1 hover:border-primary bg-black text-white hover:text-primary ${DevelopmentToolsStyles.sidePanelItem}`}
222227
>
223228
{tool?.tool}
224229
</div>
@@ -884,12 +889,12 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
884889

885890
{/* cta section */}
886891
<section>
887-
<div className="bg-[#090B0B] text-white flex flex-col items-center justify-center pl-6 pr-4 mt-10">
892+
<div className={`bg-[#090B0B] text-white flex flex-col items-center justify-center pl-6 pr-4 mt-10 ${DevelopmentToolsStyles.promoPanel}`}>
888893
<div className="w-full flex md:flex-row flex-col md:items-center items-start md:justify-between justify-start gap-8 md:py-4 py-8 md:px-7">
889894
{/* Left Section */}
890895
<div className="text-left flex-1">
891896
<Image
892-
src="/images/bb-logo.svg"
897+
src={logoSrc}
893898
alt="BetterBugs Logo"
894899
className="mb-8"
895900
width={200}
@@ -910,7 +915,9 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
910915
</p>
911916
<div className="flex items-center gap-3 mt-6 mb-4">
912917
<Link target="_blank" href={Extension_URL}>
913-
<Button className="btn-primary flex items-center z-20 justify-center gap-3 rounded-full px-4">
918+
<Button
919+
className={`btn-primary flex items-center z-20 justify-center gap-3 rounded-full px-4 ${DevelopmentToolsStyles.addToChromeButton}`}
920+
>
914921
{browser === "edge" ? (
915922
<EdgeIcon className="w-7 h-7" />
916923
) : (
@@ -933,7 +940,10 @@ const Page = ({ params: { slug } }: { params: { slug: string } }) => {
933940
"https://www.loom.com/share/beb5310bed634e4783d10becd4a291f2?sid=7bcb9a6f-0290-4d5b-9eb0-12ed04e9167e"
934941
}
935942
>
936-
<PlayIcon className="hover:text-primary" />
943+
<PlayIcon
944+
className={isLightTheme ? "text-[#111827] hover:text-primary" : "hover:text-primary"}
945+
arrowFill={isLightTheme ? "#ffffff" : "#000000"}
946+
/>
937947
</Link>
938948
</div>
939949
<p className="text-sm mt-2 text-white">

app/components/comparisonsComponent/comparisonsStyles.module.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
);
2828
}
2929

30+
:global([data-theme="light"]) .ctaCardGridBg {
31+
background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
32+
border: 1px solid #e5e7eb;
33+
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06),
34+
inset 0 1px 0 rgba(255, 255, 255, 0.9);
35+
}
36+
3037
.collapse {
3138
:global(.ant-collapse) {
3239
background-color: transparent !important;

app/components/layout/Header/headerComponent.tsx

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import ProductMenuComponent from '../../headerMenuDropdownComponents/productMenu
1919
import SolutionMenuComponent from '../../headerMenuDropdownComponents/solutionMenuComponent';
2020
import ResourceMenuComponent from '../../headerMenuDropdownComponents/resourceMenuComponent';
2121
import ToolsMenuComponent from '../../headerMenuDropdownComponents/toolsMenuComponent';
22+
import { useTheme } from '@/app/contexts/themeContext';
2223

2324
const responsiveHeader = [
2425
// {
@@ -186,10 +187,50 @@ const CountdownTimer = () => {
186187
);
187188
};
188189

190+
const SunIcon = () => (
191+
<svg
192+
width="16"
193+
height="16"
194+
viewBox="0 0 24 24"
195+
fill="none"
196+
xmlns="http://www.w3.org/2000/svg"
197+
aria-hidden="true"
198+
>
199+
<circle cx="12" cy="12" r="4" stroke="currentColor" strokeWidth="2" />
200+
<path
201+
d="M12 2V5M12 19V22M22 12H19M5 12H2M19.07 4.93L16.95 7.05M7.05 16.95L4.93 19.07M19.07 19.07L16.95 16.95M7.05 7.05L4.93 4.93"
202+
stroke="currentColor"
203+
strokeWidth="2"
204+
strokeLinecap="round"
205+
/>
206+
</svg>
207+
);
208+
209+
const MoonIcon = () => (
210+
<svg
211+
width="16"
212+
height="16"
213+
viewBox="0 0 24 24"
214+
fill="none"
215+
xmlns="http://www.w3.org/2000/svg"
216+
aria-hidden="true"
217+
>
218+
<path
219+
d="M21 14.5A9 9 0 1 1 12.5 3C11.6 4.3 11.1 5.9 11.1 7.6C11.1 12 14.6 15.5 19 15.5C19.7 15.5 20.4 15.4 21 15.2V14.5Z"
220+
stroke="currentColor"
221+
strokeWidth="2"
222+
strokeLinecap="round"
223+
strokeLinejoin="round"
224+
/>
225+
</svg>
226+
);
227+
189228
const HeaderComponent = () => {
190229
const router = usePathname();
191230
const searchParams = useSearchParams();
192231
const utmSource = searchParams.get('utm_source');
232+
const { isLightTheme, setIsLightTheme } = useTheme();
233+
const logoSrc = isLightTheme ? '/images/bb-logo-light.svg' : '/images/bb-logo.svg';
193234
const { collapsed, setCollapsed }: LayoutContextModel =
194235
useContext(LayoutContext);
195236

@@ -323,11 +364,12 @@ const HeaderComponent = () => {
323364
<div className="container mx-auto flex items-center justify-between py-3">
324365
<Link href={`${WEB_URL}`} className="flex items-center">
325366
<Image
326-
src="/images/bb-logo.svg"
367+
src={logoSrc}
327368
width={190}
328369
height={32}
329370
alt="Logo"
330371
title="betterbugs-logo"
372+
className={hederStyles.bbLogo}
331373
priority
332374
/>
333375
</Link>
@@ -390,7 +432,16 @@ const HeaderComponent = () => {
390432
</li>
391433
))}
392434
</ul>
393-
<div className="ml-auto">
435+
<div className="ml-auto flex items-center">
436+
<button
437+
type="button"
438+
className={`${hederStyles.themeToggle} mr-2`}
439+
onClick={() => setIsLightTheme(!isLightTheme)}
440+
aria-label={`Switch to ${isLightTheme ? 'dark' : 'light'} mode`}
441+
aria-pressed={isLightTheme}
442+
>
443+
{isLightTheme ? <MoonIcon /> : <SunIcon />}
444+
</button>
394445
<Link
395446
href={`https://app.betterbugs.io/login${
396447
utmSource ? `?utm_source=${utmSource}` : ''
@@ -402,15 +453,15 @@ const HeaderComponent = () => {
402453
</div>
403454
</Link>
404455
</div>
405-
<div>
456+
<div className="flex items-center">
406457
<Link
407458
href={`https://app.betterbugs.io/login${
408459
utmSource ? `?utm_source=${utmSource}` : ''
409460
}`}
410461
target="_blank"
411462
>
412463
<Button
413-
className={`font-medium flex items-center rounded-full border !border-light-primary btn-gradient ${
464+
className={`${hederStyles.getStartedButton} font-medium flex items-center rounded-full border !border-light-primary btn-gradient ${
414465
isScrolled
415466
? 'scroll-gradient !text-base py-5 px-6'
416467
: 'bg-[#FFFFFF0D] !text-white/80 !text-base py-5 px-6'
@@ -438,24 +489,34 @@ const HeaderComponent = () => {
438489
</div>
439490
<Link href={`${WEB_URL}`}>
440491
<Image
441-
src="/images/bb-logo.svg"
492+
src={logoSrc}
442493
width={150}
443494
height={32}
444495
alt="Logo"
445496
title="betterbugs-logo"
497+
className={hederStyles.bbLogo}
446498
priority
447499
/>
448500
</Link>
449501
</div>
450-
<div className="ml-auto">
502+
<div className="ml-auto flex items-center">
503+
<button
504+
type="button"
505+
className={`${hederStyles.themeToggle} mr-3`}
506+
onClick={() => setIsLightTheme(!isLightTheme)}
507+
aria-label={`Switch to ${isLightTheme ? 'dark' : 'light'} mode`}
508+
aria-pressed={isLightTheme}
509+
>
510+
{isLightTheme ? <MoonIcon /> : <SunIcon />}
511+
</button>
451512
<Link
452513
href={`https://app.betterbugs.io/login${
453514
utmSource ? `?utm_source=${utmSource}` : ''
454515
}`}
455516
target="_blank"
456517
>
457518
<Button
458-
className={`btn-primary font-medium flex items-center rounded-full border !border-light-primary text-[#FFFFFF0D] hover:bg-primary scroll-gradient !text-base px-4 !h-10`}
519+
className={`${hederStyles.getStartedButton} btn-primary font-medium flex items-center rounded-full border !border-light-primary text-[#FFFFFF0D] hover:bg-primary scroll-gradient !text-base px-4 !h-10`}
459520
>
460521
Get started
461522
</Button>

app/components/layout/Header/headerStyles.module.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,37 @@
8282
border-radius: 15px;
8383
}
8484
}
85+
86+
.themeToggle {
87+
align-items: center;
88+
background: rgba(255, 255, 255, 0.08);
89+
border: 1px solid rgba(255, 255, 255, 0.2);
90+
border-radius: 999px;
91+
color: white;
92+
cursor: pointer;
93+
display: inline-flex;
94+
height: 36px;
95+
justify-content: center;
96+
transition: background-color 0.2s ease, color 0.2s ease;
97+
width: 36px;
98+
99+
&:hover {
100+
background: rgba(255, 255, 255, 0.16);
101+
}
102+
103+
:global([data-theme="light"]) & {
104+
background: rgba(17, 24, 39, 0.06);
105+
border-color: rgba(17, 24, 39, 0.2);
106+
color: #111827;
107+
108+
&:hover {
109+
background: rgba(17, 24, 39, 0.12);
110+
}
111+
}
112+
}
113+
114+
:global([data-theme="light"]) .getStartedButton {
115+
background: rgba(17, 24, 39, 0.88);
116+
border-color: rgba(17, 24, 39, 0.88);
117+
color: rgba(255, 255, 255, 0.9);
118+
}

0 commit comments

Comments
 (0)