Skip to content

Commit cba28ad

Browse files
authored
Minor UI Changes (#272)
* ✨ added github star counter * ✨ updated styling of banner * ✨ added Banner in footer of docs
1 parent bd44f27 commit cba28ad

4 files changed

Lines changed: 71 additions & 24 deletions

File tree

src/app/providers.tsx

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use client'
22

3-
import { Button } from '@/components/mdx'
4-
import { ChevronRight } from 'lucide-react'
3+
import SyntaxUIProBanner from '@/components/SyntaxUIProBanner'
4+
import { useProBannerStore } from '@/store'
5+
import { X } from 'lucide-react'
56
import { ThemeProvider } from 'next-themes'
6-
import { useRouter } from 'next/navigation'
77

88
import posthog from 'posthog-js'
99
import { PostHogProvider } from 'posthog-js/react'
@@ -17,26 +17,9 @@ function CSPostHogProvider({ children }: { children: React.ReactNode }) {
1717
return <PostHogProvider client={posthog}>{children}</PostHogProvider>
1818
}
1919

20-
const SyntaxUIProBanner = () => {
21-
const router = useRouter()
22-
return (
23-
<>
24-
<div
25-
onClick={() => router.push('/pro')}
26-
className={`fixed bottom-0 left-0 right-0 z-50 cursor-pointer transition-all duration-300 ease-in-out`}
27-
>
28-
<div className="flex w-full items-center justify-center gap-x-6 bg-red-500 px-6 py-2 sm:px-3.5">
29-
<div className="flex items-center gap-4 text-sm font-medium leading-6 text-white">
30-
<p>{`Get Premium Blocks and Templates for your next project on SyntaxUI Pro`}</p>
31-
<ChevronRight className="h-4 w-4" />
32-
</div>
33-
</div>
34-
</div>
35-
</>
36-
)
37-
}
38-
3920
export function Providers({ children }: { children: React.ReactNode }) {
21+
const { showProBanner } = useProBannerStore()
22+
4023
return (
4124
<ThemeProvider
4225
attribute="class"
@@ -45,7 +28,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
4528
>
4629
<CSPostHogProvider>
4730
{children}
48-
<SyntaxUIProBanner />
31+
{showProBanner && <SyntaxUIProBanner />}
4932
</CSPostHogProvider>
5033
</ThemeProvider>
5134
)

src/components/Footer.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function SocialLink({
8484
return (
8585
<Link href={href} target="_blank" rel="noreferrer" className="group">
8686
<span className="sr-only">{children}</span>
87-
<Icon className="h-5 w-5 fill-zinc-700 dark:fill-gray-100 transition group-hover:fill-zinc-900 dark:group-hover:fill-zinc-500" />
87+
<Icon className="h-5 w-5 fill-zinc-700 transition group-hover:fill-zinc-900 dark:fill-gray-100 dark:group-hover:fill-zinc-500" />
8888
</Link>
8989
)
9090
}
@@ -117,10 +117,32 @@ function SmallPrint() {
117117
)
118118
}
119119

120+
const FooterBanner = () => {
121+
return (
122+
<div className="flex flex-col items-center justify-center rounded-xl border bg-gray-100 py-8 text-black">
123+
<div className="mb-4 max-w-xl text-center text-xl font-semibold tracking-tight">
124+
Say goodbye to the grind of coding everything from scratch. So you can
125+
focus on what matters most
126+
</div>
127+
<div>
128+
<a
129+
href="https://pro.syntaxui.com/"
130+
target="_blank"
131+
rel="noopener noreferrer"
132+
className="rounded-lg bg-red-500 px-4 py-3 text-sm font-medium text-white hover:bg-red-500/90"
133+
>
134+
Get SyntaxUI Pro
135+
</a>
136+
</div>
137+
</div>
138+
)
139+
}
140+
120141
export function Footer() {
121142
return (
122143
<footer className="mx-auto w-full max-w-2xl space-y-10 pb-16 lg:max-w-5xl">
123144
<PageNavigation />
145+
<FooterBanner />
124146
<SmallPrint />
125147
</footer>
126148
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { useProBannerStore } from '@/store'
2+
import { X } from 'lucide-react'
3+
4+
const SyntaxUIProBanner = () => {
5+
const { setShowProBanner } = useProBannerStore()
6+
return (
7+
<div className="border-border group fixed bottom-2 right-2 z-50 h-auto w-[calc(100vw-16px)] max-w-[350px] overflow-hidden rounded-lg border border-red-700 bg-red-500 p-4 text-white transition-all animate-in slide-in-from-bottom-full md:bottom-4 md:right-4">
8+
<a
9+
href="https://pro.syntaxui.com/"
10+
target="_blank"
11+
rel="noopener noreferrer"
12+
>
13+
<div className="flex flex-col items-start gap-0.5">
14+
<h1 className="text-md hidden font-semibold md:block">
15+
Code Less, Create More!
16+
</h1>
17+
<div className="font-regular flex items-start justify-start text-sm leading-6 text-white/80">
18+
{`Get Premium Blocks and Templates for your next project on SyntaxUI Pro ↗`}
19+
</div>
20+
</div>
21+
</a>
22+
<button
23+
className="p-1s absolute right-2 top-2 transition-all duration-300 ease-in-out group-hover:block md:hidden"
24+
onClick={() => setShowProBanner(false)}
25+
>
26+
<X className="h-5 w-5" />
27+
</button>
28+
</div>
29+
)
30+
}
31+
32+
export default SyntaxUIProBanner

src/store.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ export const useStarStore = create<StarStore>((set) => ({
99
stars: 100,
1010
setStars: (count) => set({ stars: count }),
1111
}))
12+
13+
interface ProBannerStore {
14+
showProBanner: boolean
15+
setShowProBanner: (show: boolean) => void
16+
}
17+
18+
export const useProBannerStore = create<ProBannerStore>((set) => ({
19+
showProBanner: true,
20+
setShowProBanner: (show) => set({ showProBanner: show }),
21+
}))

0 commit comments

Comments
 (0)