mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-30 10:46:35 +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 type { Metadata } from "next";
|
||||||
|
|
||||||
import { Logo } from "@/components/logo";
|
import { Logo } from "@/components/logo";
|
||||||
import { isQuickCreateEnabled } from "@/features/quick-create";
|
import {
|
||||||
import { QuickStartButton } from "@/features/quick-create/quick-create-button";
|
isQuickCreateEnabled,
|
||||||
import { QuickStartWidget } from "@/features/quick-create/quick-create-widget";
|
QuickCreateButton,
|
||||||
|
QuickCreateWidget,
|
||||||
|
} from "@/features/quick-create";
|
||||||
|
|
||||||
export default async function Layout({
|
export default async function Layout({
|
||||||
children,
|
children,
|
||||||
|
@ -24,14 +26,14 @@ export default async function Layout({
|
||||||
</div>
|
</div>
|
||||||
{isQuickCreateEnabled ? (
|
{isQuickCreateEnabled ? (
|
||||||
<div className="flex justify-center lg:hidden">
|
<div className="flex justify-center lg:hidden">
|
||||||
<QuickStartButton />
|
<QuickCreateButton />
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{isQuickCreateEnabled ? (
|
{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="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">
|
<div className="z-10 mx-auto w-full max-w-md">
|
||||||
<QuickStartWidget />
|
<QuickCreateWidget />
|
||||||
</div>
|
</div>
|
||||||
<DotPattern
|
<DotPattern
|
||||||
cx={10}
|
cx={10}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { LogInIcon } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { notFound } from "next/navigation";
|
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";
|
import { isSelfHosted } from "@/utils/constants";
|
||||||
|
|
||||||
export default async function QuickCreatePage() {
|
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="mx-auto w-full max-w-md flex-1">
|
||||||
<div className="space-y-8">
|
<div className="space-y-8">
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<QuickStartWidget />
|
<QuickCreateWidget />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
export const isQuickCreateEnabled =
|
export const isQuickCreateEnabled = process.env.QUICK_CREATE_ENABLED === "true";
|
||||||
process.env.NEXT_PUBLIC_SELF_HOSTED !== "true";
|
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
export { isQuickCreateEnabled } from "./constants";
|
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";
|
import { getTranslation } from "@/i18n/server";
|
||||||
|
|
||||||
export async function QuickStartButton() {
|
export async function QuickCreateButton() {
|
||||||
const { t } = await getTranslation();
|
const { t } = await getTranslation();
|
||||||
return (
|
return (
|
||||||
<Button className="rounded-full" asChild>
|
<Button className="rounded-full" asChild>
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { getTranslation } from "@/i18n/server";
|
||||||
|
|
||||||
import { RelativeDate } from "./components/relative-date";
|
import { RelativeDate } from "./components/relative-date";
|
||||||
|
|
||||||
export async function QuickStartWidget() {
|
export async function QuickCreateWidget() {
|
||||||
const polls = await getGuestPolls();
|
const polls = await getGuestPolls();
|
||||||
const { t } = await getTranslation();
|
const { t } = await getTranslation();
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -119,6 +119,7 @@
|
||||||
"QSTASH_TOKEN",
|
"QSTASH_TOKEN",
|
||||||
"QSTASH_CURRENT_SIGNING_KEY",
|
"QSTASH_CURRENT_SIGNING_KEY",
|
||||||
"QSTASH_NEXT_SIGNING_KEY",
|
"QSTASH_NEXT_SIGNING_KEY",
|
||||||
"QSTASH_URL"
|
"QSTASH_URL",
|
||||||
|
"QUICK_CREATE_ENABLED"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue