diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json index 72b848c7d..7e3c12b87 100644 --- a/apps/web/public/locales/en/app.json +++ b/apps/web/public/locales/en/app.json @@ -236,7 +236,6 @@ "12months": "12 months", "savePercentage": "Save {percentage}%", "1month": "1 month", - "subscribe": "Subscribe", "cancelAnytime": "Cancel anytime from your billing page.", "unsubscribeToastTitle": "You have disabled notifications", "unsubscribeToastDescription": "You will no longer receive notifications for this poll", @@ -303,5 +302,6 @@ "addPaymentMethod": "Add Payment Method", "needToMakeChanges": "Need to make changes?", "billingPortalDescription": "Visit the billing portal to manage your subscription, update payment methods, or view billing history.", - "priceFree": "Free" + "priceFree": "Free", + "signUp": "Sign Up" } diff --git a/apps/web/src/app/[locale]/(admin)/menu/menu-button.tsx b/apps/web/src/app/[locale]/(admin)/menu/menu-button.tsx index e7da5d246..1e5fb5b5d 100644 --- a/apps/web/src/app/[locale]/(admin)/menu/menu-button.tsx +++ b/apps/web/src/app/[locale]/(admin)/menu/menu-button.tsx @@ -2,10 +2,12 @@ import { Button } from "@rallly/ui/button"; import { Icon } from "@rallly/ui/icon"; -import { MenuIcon, XIcon } from "lucide-react"; +import { ArrowLeftIcon, MenuIcon } from "lucide-react"; import Link from "next/link"; import { useRouter } from "next/navigation"; +import { Trans } from "@/components/trans"; + export function BackButton() { const router = useRouter(); return ( @@ -15,7 +17,10 @@ export function BackButton() { router.back(); }} > - + + + + ); } diff --git a/apps/web/src/app/[locale]/new/page.tsx b/apps/web/src/app/[locale]/new/page.tsx index fcb76ef3f..3c8b5307b 100644 --- a/apps/web/src/app/[locale]/new/page.tsx +++ b/apps/web/src/app/[locale]/new/page.tsx @@ -1,3 +1,5 @@ +import { Button } from "@rallly/ui/button"; +import Link from "next/link"; import { Trans } from "react-i18next/TransWithoutContext"; import { GroupPollIcon } from "@/app/[locale]/(admin)/app-card"; @@ -6,23 +8,51 @@ import type { Params } from "@/app/[locale]/types"; import { CreatePoll } from "@/components/create-poll"; import { UserDropdown } from "@/components/user-dropdown"; import { getTranslation } from "@/i18n/server"; +import { getLoggedIn } from "@/next-auth"; export default async function Page({ params }: { params: Params }) { const { t } = await getTranslation(params.locale); + const isLoggedIn = await getLoggedIn(); + return (
-
-
- - -
-

- -

+
+
+
+ +
+
+
+ +
+

+ +

+
+
+
+
+ {isLoggedIn ? ( + + ) : ( +
+ + +
+ )}
-
-
-
diff --git a/apps/web/src/next-auth.ts b/apps/web/src/next-auth.ts index 2fb607dae..0487483d8 100644 --- a/apps/web/src/next-auth.ts +++ b/apps/web/src/next-auth.ts @@ -221,4 +221,9 @@ export const getUserId = async () => { return session?.user?.email ? session.user.id : null; }; +export const getLoggedIn = async () => { + const session = await auth(); + return !!session?.user?.email; +}; + export { auth, handlers, requireUser, signIn, signOut }; diff --git a/packages/ui/src/button.tsx b/packages/ui/src/button.tsx index 95f9bc838..996a8d7ff 100644 --- a/packages/ui/src/button.tsx +++ b/packages/ui/src/button.tsx @@ -16,7 +16,7 @@ const buttonVariants = cva( variants: { variant: { primary: - "focus:ring-offset-1 border-primary bg-primary hover:bg-primary-500 disabled:bg-gray-400 disabled:border-transparent text-primary-foreground shadow-sm", + "focus:ring-offset-1 border-primary bg-primary hover:bg-primary-500 disabled:bg-gray-400 disabled:border-transparent text-white shadow-sm", destructive: "focus:ring-offset-1 bg-destructive shadow-sm text-destructive-foreground active:bg-destructive border-destructive hover:bg-destructive/90", default: