fix: add missing newlines at the end of JSON files; clean up formatting in page components
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { CreatePageForm } from '@kit/site-builder/components';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { AccountNotFound } from '~/components/account-not-found';
|
||||
import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
|
||||
@@ -166,10 +166,7 @@ export default async function SiteBuilderDashboard({ params }: Props) {
|
||||
</thead>
|
||||
<tbody>
|
||||
{(pages as SitePage[]).map((page) => (
|
||||
<tr
|
||||
key={page.id}
|
||||
className="hover:bg-muted/30 border-b"
|
||||
>
|
||||
<tr key={page.id} className="hover:bg-muted/30 border-b">
|
||||
<td className="p-3 font-medium">{page.title}</td>
|
||||
<td className="text-muted-foreground p-3 font-mono text-xs">
|
||||
/{page.slug}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { CreatePostForm } from '@kit/site-builder/components';
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { AccountNotFound } from '~/components/account-not-found';
|
||||
import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
|
||||
@@ -77,10 +77,7 @@ export default async function PostsManagerPage({ params }: Props) {
|
||||
</thead>
|
||||
<tbody>
|
||||
{(posts as SitePost[]).map((post) => (
|
||||
<tr
|
||||
key={post.id}
|
||||
className="hover:bg-muted/30 border-b"
|
||||
>
|
||||
<tr key={post.id} className="hover:bg-muted/30 border-b">
|
||||
<td className="p-3 font-medium">{post.title}</td>
|
||||
<td className="p-3">
|
||||
<Badge
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useTransition } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { toast } from '@kit/ui/sonner';
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -19,6 +18,7 @@ import {
|
||||
AlertDialogTrigger,
|
||||
} from '@kit/ui/alert-dialog';
|
||||
import { Button } from '@kit/ui/button';
|
||||
import { toast } from '@kit/ui/sonner';
|
||||
|
||||
interface PublishToggleButtonProps {
|
||||
pageId: string;
|
||||
@@ -38,11 +38,14 @@ export function PublishToggleButton({
|
||||
const handleToggle = () => {
|
||||
startTransition(async () => {
|
||||
try {
|
||||
const response = await fetch(`/api/site-builder/pages/${pageId}/publish`, {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ accountId, isPublished: !isPublished }),
|
||||
});
|
||||
const response = await fetch(
|
||||
`/api/site-builder/pages/${pageId}/publish`,
|
||||
{
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ accountId, isPublished: !isPublished }),
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
toast.error(t('pages.toggleError'));
|
||||
|
||||
Reference in New Issue
Block a user