mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 10:16:32 +02:00
✨ Add quick create config (#1513)
This commit is contained in:
parent
001e17b43d
commit
a5b9edf5e6
7 changed files with 16 additions and 12 deletions
|
@ -3,9 +3,11 @@ import { DotPattern } from "@rallly/ui/dot-pattern";
|
|||
import type { Metadata } from "next";
|
||||
|
||||
import { Logo } from "@/components/logo";
|
||||
import { isQuickCreateEnabled } from "@/features/quick-create";
|
||||
import { QuickStartButton } from "@/features/quick-create/quick-create-button";
|
||||
import { QuickStartWidget } from "@/features/quick-create/quick-create-widget";
|
||||
import {
|
||||
isQuickCreateEnabled,
|
||||
QuickCreateButton,
|
||||
QuickCreateWidget,
|
||||
} from "@/features/quick-create";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
|
@ -24,14 +26,14 @@ export default async function Layout({
|
|||
</div>
|
||||
{isQuickCreateEnabled ? (
|
||||
<div className="flex justify-center lg:hidden">
|
||||
<QuickStartButton />
|
||||
<QuickCreateButton />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
{isQuickCreateEnabled ? (
|
||||
<div className="relative hidden flex-1 flex-col justify-center rounded-lg border border-gray-100 bg-gray-50 lg:flex lg:p-16">
|
||||
<div className="z-10 mx-auto w-full max-w-md">
|
||||
<QuickStartWidget />
|
||||
<QuickCreateWidget />
|
||||
</div>
|
||||
<DotPattern
|
||||
cx={10}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { LogInIcon } from "lucide-react";
|
|||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
import { QuickStartWidget } from "@/features/quick-create/quick-create-widget";
|
||||
import { QuickCreateWidget } from "@/features/quick-create/quick-create-widget";
|
||||
import { isSelfHosted } from "@/utils/constants";
|
||||
|
||||
export default async function QuickCreatePage() {
|
||||
|
@ -18,7 +18,7 @@ export default async function QuickCreatePage() {
|
|||
<div className="mx-auto w-full max-w-md flex-1">
|
||||
<div className="space-y-8">
|
||||
<div className="flex-1">
|
||||
<QuickStartWidget />
|
||||
<QuickCreateWidget />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
export const isQuickCreateEnabled =
|
||||
process.env.NEXT_PUBLIC_SELF_HOSTED !== "true";
|
||||
export const isQuickCreateEnabled = process.env.QUICK_CREATE_ENABLED === "true";
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
export { isQuickCreateEnabled } from "./constants";
|
||||
export { QuickCreateButton } from "./quick-create-button";
|
||||
export { QuickCreateWidget } from "./quick-create-widget";
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Trans } from "react-i18next/TransWithoutContext";
|
|||
|
||||
import { getTranslation } from "@/i18n/server";
|
||||
|
||||
export async function QuickStartButton() {
|
||||
export async function QuickCreateButton() {
|
||||
const { t } = await getTranslation();
|
||||
return (
|
||||
<Button className="rounded-full" asChild>
|
||||
|
|
|
@ -10,7 +10,7 @@ import { getTranslation } from "@/i18n/server";
|
|||
|
||||
import { RelativeDate } from "./components/relative-date";
|
||||
|
||||
export async function QuickStartWidget() {
|
||||
export async function QuickCreateWidget() {
|
||||
const polls = await getGuestPolls();
|
||||
const { t } = await getTranslation();
|
||||
return (
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
"QSTASH_TOKEN",
|
||||
"QSTASH_CURRENT_SIGNING_KEY",
|
||||
"QSTASH_NEXT_SIGNING_KEY",
|
||||
"QSTASH_URL"
|
||||
"QSTASH_URL",
|
||||
"QUICK_CREATE_ENABLED"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue