From 3a86e1338c1cb69ef981cacf27b06cb6d7cbf54b Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 13 Nov 2022 09:36:09 +0800 Subject: [PATCH] chore: update button style --- web/src/components/Alert.tsx | 2 +- web/src/components/WorkspaceSetting.tsx | 23 +++++++--------- web/src/pages/Auth.tsx | 36 +++++++------------------ web/src/pages/UserDetail.tsx | 16 +++++------ 4 files changed, 27 insertions(+), 50 deletions(-) diff --git a/web/src/components/Alert.tsx b/web/src/components/Alert.tsx index e9b6835..e2743c0 100644 --- a/web/src/components/Alert.tsx +++ b/web/src/components/Alert.tsx @@ -2,7 +2,7 @@ import { Button, Modal, ModalDialog } from "@mui/joy"; import { createRoot } from "react-dom/client"; import Icon from "./Icon"; -type AlertStyle = "primary" | "warning"; +type AlertStyle = "primary" | "warning" | "danger"; interface Props { title: string; diff --git a/web/src/components/WorkspaceSetting.tsx b/web/src/components/WorkspaceSetting.tsx index d20dca6..0237f05 100644 --- a/web/src/components/WorkspaceSetting.tsx +++ b/web/src/components/WorkspaceSetting.tsx @@ -1,3 +1,4 @@ +import { Button } from "@mui/joy"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import { deleteWorkspaceUser } from "../helpers/api"; @@ -59,7 +60,7 @@ const WorkspaceSetting: React.FC = (props: Props) => { showCommonDialog({ title: "Delete Workspace", content: `Are you sure to delete workspace \`${workspace.name}\`?`, - style: "warning", + style: "danger", onConfirm: async () => { await workspaceService.deleteWorkspaceById(workspace.id); navigate("/"); @@ -71,7 +72,7 @@ const WorkspaceSetting: React.FC = (props: Props) => { showCommonDialog({ title: "Exit Workspace", content: `Are you sure to exit workspace \`${workspace.name}\`?`, - style: "warning", + style: "danger", onConfirm: async () => { await deleteWorkspaceUser({ workspaceId: workspace.id, @@ -91,24 +92,18 @@ const WorkspaceSetting: React.FC = (props: Props) => {
{workspaceUser.role === "ADMIN" ? ( <> - - + + ) : ( <> - + )}
diff --git a/web/src/pages/Auth.tsx b/web/src/pages/Auth.tsx index 18c98d1..5c2e1bc 100644 --- a/web/src/pages/Auth.tsx +++ b/web/src/pages/Auth.tsx @@ -1,3 +1,4 @@ +import { Button, Input } from "@mui/joy"; import React, { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import * as api from "../helpers/api"; @@ -119,7 +120,8 @@ const Auth: React.FC = () => {
-
+
+
Corgi {actionBtnLoadingState.isLoading && } @@ -128,38 +130,20 @@ const Auth: React.FC = () => {
Email - +
Password - +
-
- - + +
diff --git a/web/src/pages/UserDetail.tsx b/web/src/pages/UserDetail.tsx index 9086626..5475852 100644 --- a/web/src/pages/UserDetail.tsx +++ b/web/src/pages/UserDetail.tsx @@ -1,3 +1,4 @@ +import { Button, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import { useAppSelector } from "../store"; @@ -70,22 +71,19 @@ const UserDetail: React.FC = () => {

Password: - +

OpenID: - - - +