diff --git a/web/app/(app)/(auth)/(components)/request-password-reset-form.tsx b/web/app/(app)/(auth)/(components)/request-password-reset-form.tsx index 32f1a50..2bdcf42 100644 --- a/web/app/(app)/(auth)/(components)/request-password-reset-form.tsx +++ b/web/app/(app)/(auth)/(components)/request-password-reset-form.tsx @@ -58,7 +58,7 @@ export default function RequestPasswordResetForm() { } return ( -
+
diff --git a/web/app/(app)/(auth)/(components)/reset-password-form.tsx b/web/app/(app)/(auth)/(components)/reset-password-form.tsx index cb45aeb..80b0a53 100644 --- a/web/app/(app)/(auth)/(components)/reset-password-form.tsx +++ b/web/app/(app)/(auth)/(components)/reset-password-form.tsx @@ -81,7 +81,7 @@ export default function ResetPasswordForm({ } return ( -
+
diff --git a/web/app/(app)/(auth)/login/page.tsx b/web/app/(app)/(auth)/login/page.tsx index 1fe8050..71da39b 100644 --- a/web/app/(app)/(auth)/login/page.tsx +++ b/web/app/(app)/(auth)/login/page.tsx @@ -17,7 +17,7 @@ import { Routes } from '@/config/routes' export default function LoginPage() { return ( -
+
@@ -34,7 +34,7 @@ export default function LoginPage() {
- + Or
diff --git a/web/app/(app)/(auth)/register/page.tsx b/web/app/(app)/(auth)/register/page.tsx index 1f4ac59..394ef1d 100644 --- a/web/app/(app)/(auth)/register/page.tsx +++ b/web/app/(app)/(auth)/register/page.tsx @@ -16,7 +16,7 @@ import { Routes } from '@/config/routes' export default function RegisterPage() { return ( -
+
@@ -28,6 +28,16 @@ export default function RegisterPage() { +
+
+ +
+
+ + Or + +
+
diff --git a/web/app/(app)/dashboard/(components)/generate-api-key.tsx b/web/app/(app)/dashboard/(components)/generate-api-key.tsx index 2285926..c9b4ea7 100644 --- a/web/app/(app)/dashboard/(components)/generate-api-key.tsx +++ b/web/app/(app)/dashboard/(components)/generate-api-key.tsx @@ -87,7 +87,7 @@ export default function GenerateApiKey() { > {isGeneratingApiKey ? (
- +
) : ( 'Generate API Key' @@ -111,7 +111,7 @@ export default function GenerateApiKey() {
-
+
{generatedApiKey?.data && ( )} diff --git a/web/app/(app)/layout-wrapper.tsx b/web/app/(app)/layout-wrapper.tsx index 54e1c88..4bba136 100644 --- a/web/app/(app)/layout-wrapper.tsx +++ b/web/app/(app)/layout-wrapper.tsx @@ -8,6 +8,7 @@ import { ApiEndpoints } from '@/config/api' import { useEffect } from 'react' import { usePathname, useRouter } from 'next/navigation' import { Routes } from '@/config/routes' +import { ThemeProvider } from 'next-themes' export default function LayoutWrapper({ session, children }) { const router = useRouter() @@ -35,15 +36,17 @@ export default function LayoutWrapper({ session, children }) { return ( <> - - - - {children} - - - + + + + + {children} + + + + ) } diff --git a/web/app/(app)/layout.tsx b/web/app/(app)/layout.tsx index d524680..e6221cb 100644 --- a/web/app/(app)/layout.tsx +++ b/web/app/(app)/layout.tsx @@ -12,7 +12,7 @@ export default async function RootLayout({ children }: PropsWithChildren) { <> - {children} +
{children}
) diff --git a/web/app/(landing-page)/(components)/code-snippet-section.tsx b/web/app/(landing-page)/(components)/code-snippet-section.tsx index 63540e4..37a239b 100644 --- a/web/app/(landing-page)/(components)/code-snippet-section.tsx +++ b/web/app/(landing-page)/(components)/code-snippet-section.tsx @@ -1,5 +1,13 @@ -import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../components/ui/tabs' +'use client' + +import { + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from '../../../components/ui/tabs' import SyntaxHighlighter from 'react-syntax-highlighter' +import { dark } from 'react-syntax-highlighter/dist/esm/styles/prism' const codeSnippets = [ { @@ -56,10 +64,10 @@ print(response.json())`, export default function CodeSnippetSection() { return ( -
+

Code Snippet

-
+
{codeSnippets.map((snippet) => { @@ -76,6 +84,7 @@ export default function CodeSnippetSection() { {snippet.snippet} diff --git a/web/app/(landing-page)/(components)/customization-section.tsx b/web/app/(landing-page)/(components)/customization-section.tsx index 307e105..072c2ba 100644 --- a/web/app/(landing-page)/(components)/customization-section.tsx +++ b/web/app/(landing-page)/(components)/customization-section.tsx @@ -4,7 +4,7 @@ import Link from 'next/link' export default function CustomizationSection() { return ( -
+

diff --git a/web/app/(landing-page)/(components)/download-app-section.tsx b/web/app/(landing-page)/(components)/download-app-section.tsx index 157862e..7cac4dc 100644 --- a/web/app/(landing-page)/(components)/download-app-section.tsx +++ b/web/app/(landing-page)/(components)/download-app-section.tsx @@ -7,7 +7,7 @@ export default function DownloadAppSection() { return (
-
+
App preview - diff --git a/web/app/(landing-page)/(components)/features-section.tsx b/web/app/(landing-page)/(components)/features-section.tsx index b0353e5..4b93b93 100644 --- a/web/app/(landing-page)/(components)/features-section.tsx +++ b/web/app/(landing-page)/(components)/features-section.tsx @@ -17,7 +17,7 @@ export default function FeaturesSection() {

Send SMS

-

+

Send SMS to any number from your dashboard or via REST API

diff --git a/web/app/(landing-page)/(components)/hero-section.tsx b/web/app/(landing-page)/(components)/hero-section.tsx index 1d59f3b..6fb7294 100644 --- a/web/app/(landing-page)/(components)/hero-section.tsx +++ b/web/app/(landing-page)/(components)/hero-section.tsx @@ -6,7 +6,7 @@ import Link from 'next/link' export default function HeroSection() { return ( -
+
@@ -26,7 +26,7 @@ export default function HeroSection() {
- diff --git a/web/app/(landing-page)/(components)/how-it-works-section.tsx b/web/app/(landing-page)/(components)/how-it-works-section.tsx index c41f104..09fa5a7 100644 --- a/web/app/(landing-page)/(components)/how-it-works-section.tsx +++ b/web/app/(landing-page)/(components)/how-it-works-section.tsx @@ -10,7 +10,7 @@ export default function HowItWorksSection() { return (

How It Works

diff --git a/web/app/(landing-page)/(components)/landing-page-header.tsx b/web/app/(landing-page)/(components)/landing-page-header.tsx index dd0eb4f..e8ac8c4 100644 --- a/web/app/(landing-page)/(components)/landing-page-header.tsx +++ b/web/app/(landing-page)/(components)/landing-page-header.tsx @@ -3,48 +3,54 @@ import { MessageSquarePlus, Moon } from 'lucide-react' import { Button } from '@/components/ui/button' import { ExternalLinks } from '@/config/external-links' import { Routes } from '@/config/routes' +import { ThemeProvider } from 'next-themes' +import ThemeToggle from '@/components/shared/theme-toggle' export default function LandingPageHeader() { return ( -
-
- - - - TextBee - - - +
+
+ ) } diff --git a/web/app/(landing-page)/(components)/support-project-section.tsx b/web/app/(landing-page)/(components)/support-project-section.tsx index 7aba89b..7b7c430 100644 --- a/web/app/(landing-page)/(components)/support-project-section.tsx +++ b/web/app/(landing-page)/(components)/support-project-section.tsx @@ -52,7 +52,7 @@ export default function SupportProjectSection() { return ( <> -
+

Support The Project

@@ -64,7 +64,7 @@ export default function SupportProjectSection() {

- @@ -84,7 +84,7 @@ export default function SupportProjectSection() { {cryptoWallets.map((wallet, index) => (

{wallet.name}

diff --git a/web/app/layout.tsx b/web/app/layout.tsx index 4e54d2d..ac0a709 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -9,6 +9,9 @@ import { Session } from 'next-auth' import { getServerSession } from 'next-auth' import { headers } from 'next/dist/client/components/headers' import { authOptions } from '@/lib/auth' +import { PrismaClient } from '@prisma/client' +import prismaClient from '@/lib/prismaClient' +import { userAgent } from 'next/server' export const metadata: Metadata = { title: 'textbee.dev - Free and Open-Source SMS Gateway', @@ -59,8 +62,46 @@ export const metadata: Metadata = { metadataBase: new URL('https://textbee.dev'), } +const trackPageView = async ({ + headerList, + session, +}: { + headerList: Headers + session: Session | null +}) => { + const { ua } = userAgent({ + headers: headerList, + }) + + const url = headerList.get('x-current-url') + const ip = headerList.get('x-forwarded-for') + + const referer = headerList.get('referer') + + const res = await prismaClient.pageView.create({ + data: { + url, + // @ts-ignore + user: session?.user?.id, + userAgent: ua, + ip, + referer, + }, + }) + return res +} + export default async function RootLayout({ children }: PropsWithChildren) { const session: Session | null = await getServerSession(authOptions as any) + + const headerList = headers() + + trackPageView({ headerList, session }) + .catch(console.error) + .then((res) => { + // console.log(res) + }) + return ( diff --git a/web/components/shared/app-header.tsx b/web/components/shared/app-header.tsx index 38ac0bc..781aa73 100644 --- a/web/components/shared/app-header.tsx +++ b/web/components/shared/app-header.tsx @@ -16,6 +16,7 @@ import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet' import { Menu, LogOut, LayoutDashboard, MessageSquarePlus } from 'lucide-react' import { signOut, useSession } from 'next-auth/react' import { Routes } from '@/config/routes' +import ThemeToggle from './theme-toggle' export default function AppHeader() { const session = useSession() @@ -44,7 +45,9 @@ export default function AppHeader() { {session.data?.user?.name?.charAt(0)} -
{session.data?.user?.name}
+
+ {session.data?.user?.name?.split(' ')[0]} +
@@ -122,7 +125,7 @@ export default function AppHeader() { @@ -148,7 +151,8 @@ export default function AppHeader() {
-