|
1 | 1 | "use client"; |
2 | 2 | import { useEffect, useState } from "react"; |
| 3 | +import DailyDSAEmbed from "@/app/components/ui/DailyDSAEmbed"; |
3 | 4 |
|
4 | 5 | const content = () => { |
5 | 6 | const [theme, setTheme] = useState("light"); |
6 | | - const [mounted, setMounted] = useState(false); |
7 | | - |
8 | 7 | useEffect(() => { |
9 | 8 | const updateTheme = () => { |
10 | 9 | const savedTheme = localStorage.getItem("theme") || "light"; |
11 | 10 | setTheme(savedTheme); |
12 | 11 | }; |
13 | 12 |
|
14 | 13 | updateTheme(); |
15 | | - setMounted(true); |
16 | 14 |
|
17 | 15 | window.addEventListener("storage", updateTheme); |
18 | 16 | window.addEventListener("themeChange", updateTheme); |
@@ -96,35 +94,8 @@ const content = () => { |
96 | 94 |
|
97 | 95 | return ( |
98 | 96 | <main className="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-5 md:gap-4"> |
99 | | - <div className="col-span-1"> |
100 | | - <div className="hidden md:block"> |
101 | | - {mounted && ( |
102 | | - <iframe |
103 | | - key={theme} |
104 | | - src={ |
105 | | - theme === "dark" |
106 | | - ? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark" |
107 | | - : "https://hw.glich.co/resources/embed/daily/dsa?theme=light" |
108 | | - } |
109 | | - width="100%" |
110 | | - height="400" |
111 | | - title="Daily DSA Challenge" |
112 | | - ></iframe> |
113 | | - )} |
114 | | - </div> |
115 | | - <div className="flex justify-center"> |
116 | | - <span className="text-xs hidden md:block"> |
117 | | - Daily DSA Challenge by{" "} |
118 | | - <a |
119 | | - href="https://hw.glich.co/resources/daily" |
120 | | - target="_blank" |
121 | | - className="underline hover:text-blue-500 duration-300" |
122 | | - > |
123 | | - Hello World |
124 | | - </a> |
125 | | - </span> |
126 | | - </div> |
127 | | - </div> |
| 97 | + |
| 98 | + <DailyDSAEmbed mobile={false} theme={theme} /> |
128 | 99 | <article className="col-span-4 max-w-4xl bg-white dark:bg-neutral-950 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden mb-8"> |
129 | 100 | {/* Queue Array Implementation Overview */} |
130 | 101 | <section className="p-6 border-b border-gray-100 dark:border-gray-700"> |
@@ -261,33 +232,7 @@ const content = () => { |
261 | 232 | </article> |
262 | 233 |
|
263 | 234 | {/* Mobile iframe at bottom */} |
264 | | - <div className="block md:hidden w-full"> |
265 | | - {mounted && ( |
266 | | - <iframe |
267 | | - key={theme} |
268 | | - src={ |
269 | | - theme === "dark" |
270 | | - ? "https://hw.glich.co/resources/embed/daily/dsa?theme=dark" |
271 | | - : "https://hw.glich.co/resources/embed/daily/dsa?theme=light" |
272 | | - } |
273 | | - width="100%" |
274 | | - height="320" |
275 | | - title="Daily DSA Challenge" |
276 | | - ></iframe> |
277 | | - )} |
278 | | - <div className="flex justify-center pb-8"> |
279 | | - <span className="text-xs"> |
280 | | - Daily DSA Challenge by{" "} |
281 | | - <a |
282 | | - href="https://hw.glich.co/resources/daily" |
283 | | - target="_blank" |
284 | | - className="underline hover:text-blue-500 duration-300" |
285 | | - > |
286 | | - Hello World |
287 | | - </a> |
288 | | - </span> |
289 | | - </div> |
290 | | - </div> |
| 235 | + <DailyDSAEmbed mobile theme={theme} /> |
291 | 236 | </main> |
292 | 237 | ); |
293 | 238 | }; |
|
0 commit comments