Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/components/ui/NewsletterEmbed.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
"use client";

import { useEffect, useState } from "react";

const NewsletterEmbed = ({ mobile = false, theme = "light" }) => {
const pageUrl =
typeof window !== "undefined"
? encodeURIComponent(window.location.href)
: "";
const [pageUrl, setPageUrl] = useState("");

useEffect(() => {
setPageUrl(encodeURIComponent(window.location.href));
}, []);

const src = `https://scaleengineer.com/embed/subscribe?theme=${theme}&utm_campaign=dsa_visualizer&utm_source=${pageUrl}`;
const wrapperClasses = mobile
? "block md:hidden w-full"
Expand Down
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/operations/comparison/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -117,4 +117,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/operations/deletion/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -432,4 +432,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/operations/insertion/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -379,4 +379,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/operations/merge/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -118,4 +118,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/operations/reverse/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -118,4 +118,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/operations/traversal/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -288,4 +288,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/types/circular/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -325,4 +325,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/types/doubly/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -364,4 +364,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/linkedList/types/singly/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";

import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {

const [theme, setTheme] = useState("light");

Expand Down Expand Up @@ -314,4 +314,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/queue/implementation/array/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down Expand Up @@ -225,4 +225,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/queue/implementation/linkedList/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down Expand Up @@ -184,4 +184,4 @@ const content = () => {
);
};

export default content;
export default Content;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down
4 changes: 2 additions & 2 deletions app/visualizer/queue/operations/isempty/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraphs = [
Expand Down Expand Up @@ -236,4 +236,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/queue/operations/isfull/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraphs = [
Expand Down Expand Up @@ -252,4 +252,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/queue/operations/peek-front/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down Expand Up @@ -224,4 +224,4 @@ const content = () => {
);
};

export default content;
export default Content;
2 changes: 1 addition & 1 deletion app/visualizer/queue/types/circular/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down
4 changes: 2 additions & 2 deletions app/visualizer/queue/types/deque/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down Expand Up @@ -256,4 +256,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/queue/types/priority/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraphs = [
Expand Down Expand Up @@ -247,4 +247,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/queue/types/singleEnded/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraphs = [
Expand Down Expand Up @@ -282,4 +282,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/searching/binarysearch/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import { useEffect, useState } from "react";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraphs = [
Expand Down Expand Up @@ -180,4 +180,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/searching/linearsearch/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import { useEffect, useState } from "react";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraphs = [
Expand Down Expand Up @@ -170,5 +170,5 @@ const content = () => {
);
};

export default content;
export default Content;

4 changes: 2 additions & 2 deletions app/visualizer/sorting/bubblesort/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down Expand Up @@ -218,4 +218,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/sorting/insertionsort/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();


Expand Down Expand Up @@ -237,4 +237,4 @@ const content = () => {
);
};

export default content;
export default Content;
4 changes: 2 additions & 2 deletions app/visualizer/sorting/mergesort/content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTheme } from "@/app/contexts/ThemeContext";
import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed";
import NewsletterEmbed from "@/app/components/ui/NewsletterEmbed";
import InContentAd from "@/app/components/ads/InContentAd";
const content = () => {
const Content = () => {
const { theme } = useTheme();

const paragraph = [
Expand Down Expand Up @@ -225,4 +225,4 @@ const content = () => {
);
};

export default content;
export default Content;
Loading
Loading