Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

add chevron

Sara Vieira5b5c4ff62baa
diff --git a/app/dashboard/dashboard.tsx b/app/dashboard/dashboard.tsx
index c53f15da5d..1f970e8fc7 100644
--- a/app/dashboard/dashboard.tsx
+++ b/app/dashboard/dashboard.tsx
@@ -13,13 +13,13 @@ import {
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuItem,
- IconButton,
styled,
} from "~/shared/design-system";
import interStyles from "~/shared/font-faces/inter.css";
import dashboardStyles from "./dashboard.css";
import { User } from "@prisma/client";
import { UserIcon } from "~/shared/icons/user";
+import { ChevronDownIcon } from "@radix-ui/react-icons";
export const links = () => {
return [
@@ -71,13 +71,16 @@ export const Dashboard = ({ projects = [], config, user }: DashboardProps) => {
<Flex gap="1" align="center">
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <IconButton aria-label="Menu Button">
- {user?.image ? (
- <Avatar src={user?.image} alt="Open menu" />
- ) : (
- <UserIcon color="white" />
- )}
- </IconButton>
+ <Button variant="raw" aria-label="Menu Button">
+ <Flex gap="1" align="center">
+ {user?.image ? (
+ <Avatar src={user?.image} alt="Open menu" />
+ ) : (
+ <UserIcon color="white" />
+ )}
+ <ChevronDownIcon width={15} height={15} color="white" />
+ </Flex>
+ </Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem onSelect={() => navigate("/logout")}>
diff --git a/app/shared/db/project.server.ts b/app/shared/db/project.server.ts
index 3219a9cc5b..1045f190e7 100644
--- a/app/shared/db/project.server.ts
+++ b/app/shared/db/project.server.ts
@@ -78,10 +78,10 @@ export const create = async ({
User: {
connectOrCreate: {
create: {
- id: userId as string,
+ id: userId,
},
where: {
- id: userId as string,
+ id: userId,
},
},
},
@@ -111,10 +111,10 @@ export const clone = async (clonableDomain: string): Promise<Project> => {
User: {
connectOrCreate: {
create: {
- id: clonableProject.userId as string,
+ id: clonableProject.userId,
},
where: {
- id: clonableProject.userId as string,
+ id: clonableProject.userId,
},
},
},
diff --git a/app/shared/db/user.server.ts b/app/shared/db/user.server.ts
index 439175642c..7cebeab564 100644
--- a/app/shared/db/user.server.ts
+++ b/app/shared/db/user.server.ts
@@ -20,9 +20,7 @@ const genericCreateAccount = async (
where: {
id: userId,
},
- data: {
- ...userData,
- },
+ data: userData,
});
return connectedUser;
diff --git a/app/shared/design-system/components/button.tsx b/app/shared/design-system/components/button.tsx
index 013339b38d..28c4e23f92 100644
--- a/app/shared/design-system/components/button.tsx
+++ b/app/shared/design-system/components/button.tsx
@@ -3,6 +3,7 @@ import { styled } from "../stitches.config";
export const Button = styled("button", {
// Reset
all: "unset",
+ cursor: "pointer",
alignItems: "center",
boxSizing: "border-box",
userSelect: "none",
@@ -160,6 +161,13 @@ export const Button = styled("button", {
"inset 0 0 0 1px hsla(0,100%,100%,.35), 0 0 0 1px hsla(0,100%,100%,.35)",
},
},
+ raw: {
+ background: "transparent",
+ color: "inherit",
+ padding: 0,
+ borderRadius: 0,
+ height: "auto",
+ },
transparentBlack: {
backgroundColor: "hsla(0,0%,0%,.2)",
color: "black",
diff --git a/app/shared/design-system/components/menu.tsx b/app/shared/design-system/components/menu.tsx
index 5629a26777..a2768e88c0 100644
--- a/app/shared/design-system/components/menu.tsx
+++ b/app/shared/design-system/components/menu.tsx
@@ -19,6 +19,7 @@ export const baseItemCss = css({
whiteSpace: "nowrap",
height: "$5",
px: "$5",
+ cursor: "pointer",
});
export const itemCss = css(baseItemCss, {
diff --git a/prisma/migrations/20220619163536_userid_mandatory/migration.sql b/prisma/migrations/20220619163536_userid_mandatory/migration.sql
new file mode 100644
index 0000000000..d73edc5442
--- /dev/null
+++ b/prisma/migrations/20220619163536_userid_mandatory/migration.sql
@@ -0,0 +1,14 @@
+/*
+ Warnings:
+
+ - Made the column `userId` on table `Project` required. This step will fail if there are existing NULL values in that column.
+
+*/
+-- DropForeignKey
+ALTER TABLE "Project" DROP CONSTRAINT "Project_userId_fkey";
+
+-- AlterTable
+ALTER TABLE "Project" ALTER COLUMN "userId" SET NOT NULL;
+
+-- AddForeignKey
+ALTER TABLE "Project" ADD CONSTRAINT "Project_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 32ee35bb03..926f331193 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -22,7 +22,7 @@ model User {
model Project {
id String @id @default(uuid())
- userId String?
+ userId String
title String
domain String @unique
prodTreeId String? // exists when published