mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-09 05:26:24 +09:00
Merge branch 'main' of github.com:webstudio-is/webstudio-designer into toasts
This commit is contained in:
commit
23ccfbe2fb
3 files changed
+13
-7
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { Form, useTransition } from "@remix-run/react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
import {
|
||||
Flex,
|
||||
Card,
|
||||
@@ -14,7 +13,7 @@ import {
|
||||
|
||||
type SelectProjectProjectCardProps = {
|
||||
projects: Array<{ id: string; title: string }>;
|
||||
config: { designerPath: "string" };
|
||||
config: { designerPath: string };
|
||||
errors: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import dashboardStyles from "./dashboard.css";
|
||||
import { User } from "@webstudio-is/prisma-client";
|
||||
import { DashboardHeader } from "./components/header";
|
||||
import { SelectProjectCard } from "./components/card";
|
||||
|
||||
export const links = () => {
|
||||
return [
|
||||
{
|
||||
@@ -23,7 +22,7 @@ export const links = () => {
|
||||
type DashboardProps = {
|
||||
projects?: Array<{ id: string; title: string }>;
|
||||
user: User;
|
||||
config: { designerPath: "string" };
|
||||
config: { designerPath: string };
|
||||
};
|
||||
|
||||
export const Dashboard = ({ projects = [], config, user }: DashboardProps) => {
|
||||
|
||||
@@ -7,16 +7,23 @@ import {
|
||||
} from "@remix-run/node";
|
||||
import { Dashboard, links } from "~/dashboard";
|
||||
import * as db from "~/shared/db";
|
||||
import config from "~/config";
|
||||
import config, { type Config } from "~/config";
|
||||
import { ensureUserCookie } from "~/shared/session";
|
||||
import { authenticator } from "~/services/auth.server";
|
||||
import { zfd } from "zod-form-data";
|
||||
export { links };
|
||||
import { User, type Project } from "@webstudio-is/prisma-client";
|
||||
|
||||
export { links };
|
||||
const schema = zfd.formData({
|
||||
project: zfd.text(),
|
||||
});
|
||||
|
||||
type Data = {
|
||||
config: Config;
|
||||
projects: Array<Project>;
|
||||
user: User;
|
||||
};
|
||||
|
||||
export const action: ActionFunction = async ({ request }) => {
|
||||
const { project: title } = schema.parse(await request.formData());
|
||||
|
||||
@@ -47,7 +54,8 @@ export const loader: LoaderFunction = async ({ request }) => {
|
||||
};
|
||||
|
||||
const DashboardRoute = () => {
|
||||
const { config, projects, user } = useLoaderData();
|
||||
const { config, projects, user } = useLoaderData<Data>();
|
||||
|
||||
return <Dashboard config={config} user={user} projects={projects} />;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user