Skip to content

Commit 77c8a0b

Browse files
committed
Add: TMK Banner
1 parent d924fd8 commit 77c8a0b

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

components/Banner.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React, { useState } from "react";
2+
import { LinkPreview } from "./LinkPreview";
3+
4+
export default function Banner() {
5+
const [visible, setVisible] = useState(true);
6+
return (
7+
<div className="dark:text-white">
8+
{visible && (
9+
<div className="text-sm md:text-md px-10 relative mx-auto text-center bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 py-3 font-normal">
10+
📣 Tailwind Master Kit: 100+ Professional, ready to embed &nbsp;
11+
<a
12+
href="https://tailwindmasterkit.com"
13+
target="__blank"
14+
className="underline font-semibold"
15+
>
16+
Tailwind Components
17+
</a>
18+
<button
19+
className="absolute right-0 mr-2"
20+
onClick={() => setVisible(false)}
21+
>
22+
<svg
23+
xmlns="http://www.w3.org/2000/svg"
24+
class="h-6 w-6"
25+
fill="none"
26+
viewBox="0 0 24 24"
27+
stroke="currentColor"
28+
className="h-4 w-4"
29+
>
30+
<path
31+
stroke-linecap="round"
32+
stroke-linejoin="round"
33+
stroke-width="2"
34+
d="M6 18L18 6M6 6l12 12"
35+
/>
36+
</svg>
37+
</button>
38+
</div>
39+
)}
40+
</div>
41+
);
42+
}

pages/_app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ThemeProvider } from "next-themes";
44
import { useEffect } from "react";
55
import { useRouter } from "next/router";
66
import * as gtag from "@/lib/gtag";
7+
import Banner from "@/components/Banner";
78

89
import MDXComponents from "@/components/MDXComponents";
910

@@ -22,6 +23,7 @@ function MyApp({ Component, pageProps }) {
2223
return (
2324
<ThemeProvider attribute="class">
2425
<MDXProvider components={MDXComponents}>
26+
<Banner />
2527
<Component {...pageProps} />
2628
</MDXProvider>
2729
</ThemeProvider>

0 commit comments

Comments
 (0)