mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: update button style
This commit is contained in:
parent
b3ce90e761
commit
3a86e1338c
@ -2,7 +2,7 @@ import { Button, Modal, ModalDialog } from "@mui/joy";
|
|||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type AlertStyle = "primary" | "warning";
|
type AlertStyle = "primary" | "warning" | "danger";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { Button } from "@mui/joy";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { deleteWorkspaceUser } from "../helpers/api";
|
import { deleteWorkspaceUser } from "../helpers/api";
|
||||||
@ -59,7 +60,7 @@ const WorkspaceSetting: React.FC<Props> = (props: Props) => {
|
|||||||
showCommonDialog({
|
showCommonDialog({
|
||||||
title: "Delete Workspace",
|
title: "Delete Workspace",
|
||||||
content: `Are you sure to delete workspace \`${workspace.name}\`?`,
|
content: `Are you sure to delete workspace \`${workspace.name}\`?`,
|
||||||
style: "warning",
|
style: "danger",
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
await workspaceService.deleteWorkspaceById(workspace.id);
|
await workspaceService.deleteWorkspaceById(workspace.id);
|
||||||
navigate("/");
|
navigate("/");
|
||||||
@ -71,7 +72,7 @@ const WorkspaceSetting: React.FC<Props> = (props: Props) => {
|
|||||||
showCommonDialog({
|
showCommonDialog({
|
||||||
title: "Exit Workspace",
|
title: "Exit Workspace",
|
||||||
content: `Are you sure to exit workspace \`${workspace.name}\`?`,
|
content: `Are you sure to exit workspace \`${workspace.name}\`?`,
|
||||||
style: "warning",
|
style: "danger",
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
await deleteWorkspaceUser({
|
await deleteWorkspaceUser({
|
||||||
workspaceId: workspace.id,
|
workspaceId: workspace.id,
|
||||||
@ -91,24 +92,18 @@ const WorkspaceSetting: React.FC<Props> = (props: Props) => {
|
|||||||
<div className="flex flex-row justify-start items-center space-x-2">
|
<div className="flex flex-row justify-start items-center space-x-2">
|
||||||
{workspaceUser.role === "ADMIN" ? (
|
{workspaceUser.role === "ADMIN" ? (
|
||||||
<>
|
<>
|
||||||
<button className="border rounded-md px-3 leading-8 hover:shadow" onClick={handleEditWorkspaceButtonClick}>
|
<Button variant="soft" onClick={handleEditWorkspaceButtonClick}>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button variant="soft" color="danger" onClick={handleDeleteWorkspaceButtonClick}>
|
||||||
className="border rounded-md px-3 leading-8 border-red-600 text-red-600 bg-red-50 hover:shadow"
|
|
||||||
onClick={handleDeleteWorkspaceButtonClick}
|
|
||||||
>
|
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<button
|
<Button variant="soft" color="danger" onClick={handleExitWorkspaceButtonClick}>
|
||||||
className="border rounded-md px-3 leading-8 border-red-600 text-red-600 bg-red-50 hover:shadow"
|
|
||||||
onClick={handleExitWorkspaceButtonClick}
|
|
||||||
>
|
|
||||||
Exit
|
Exit
|
||||||
</button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { Button, Input } from "@mui/joy";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import * as api from "../helpers/api";
|
import * as api from "../helpers/api";
|
||||||
@ -119,7 +120,8 @@ const Auth: React.FC = () => {
|
|||||||
<div className="flex flex-row justify-center items-center w-full h-screen bg-white">
|
<div className="flex flex-row justify-center items-center w-full h-screen bg-white">
|
||||||
<div className="w-80 max-w-full h-full py-4 flex flex-col justify-start items-center">
|
<div className="w-80 max-w-full h-full py-4 flex flex-col justify-start items-center">
|
||||||
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
<div className="w-full py-4 grow flex flex-col justify-center items-center">
|
||||||
<div className="flex flex-col justify-start items-start w-full mb-4">
|
<div className="flex flex-row justify-start items-center w-full mb-4">
|
||||||
|
<img src="/corgi-logo.png" className="w-14 h-auto mr-1" alt="" />
|
||||||
<div className="text-3xl font-medium font-mono flex flex-row justify-start items-center">
|
<div className="text-3xl font-medium font-mono flex flex-row justify-start items-center">
|
||||||
Corgi
|
Corgi
|
||||||
{actionBtnLoadingState.isLoading && <Icon.Loader className="ml-2 w-5 h-auto animate-spin" />}
|
{actionBtnLoadingState.isLoading && <Icon.Loader className="ml-2 w-5 h-auto animate-spin" />}
|
||||||
@ -128,38 +130,20 @@ const Auth: React.FC = () => {
|
|||||||
<div className={`flex flex-col justify-start items-start w-full ${actionBtnLoadingState.isLoading ? "opacity-80" : ""}`}>
|
<div className={`flex flex-col justify-start items-start w-full ${actionBtnLoadingState.isLoading ? "opacity-80" : ""}`}>
|
||||||
<div className="w-full flex flex-col mb-2">
|
<div className="w-full flex flex-col mb-2">
|
||||||
<span className="leading-8 mb-1 text-gray-600">Email</span>
|
<span className="leading-8 mb-1 text-gray-600">Email</span>
|
||||||
<input
|
<Input className="w-full py-3" type="email" value={email} onChange={handleEmailInputChanged} />
|
||||||
className="border rounded-md px-3 p-2 leading-7 focus:border-blue-600"
|
|
||||||
type="email"
|
|
||||||
value={email}
|
|
||||||
onChange={handleEmailInputChanged}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full flex flex-col mb-2">
|
<div className="w-full flex flex-col mb-2">
|
||||||
<span className="leading-8 text-gray-600">Password</span>
|
<span className="leading-8 text-gray-600">Password</span>
|
||||||
<input
|
<Input className="w-full py-3" type="password" value={password} onChange={handlePasswordInputChanged} />
|
||||||
className="border rounded-md px-3 p-2 leading-7 focus:border-blue-600"
|
|
||||||
type="password"
|
|
||||||
value={password}
|
|
||||||
onChange={handlePasswordInputChanged}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full flex flex-row justify-end items-center mt-4">
|
<div className="w-full flex flex-row justify-end items-center mt-4 space-x-2">
|
||||||
<button
|
<Button variant="plain" disabled={actionBtnLoadingState.isLoading} onClick={() => handleSignupBtnsClick()}>
|
||||||
className={`mr-4 text-gray-600 hover:text-black ${actionBtnLoadingState.isLoading ? "opacity-80 cursor-wait" : ""}`}
|
|
||||||
onClick={() => handleSignupBtnsClick()}
|
|
||||||
>
|
|
||||||
Sign up
|
Sign up
|
||||||
</button>
|
</Button>
|
||||||
<button
|
<Button color="primary" disabled={actionBtnLoadingState.isLoading} onClick={() => handleSigninBtnsClick()}>
|
||||||
className={`border rounded-md border-green-600 bg-green-600 text-white px-3 py-2 leading-6 hover:bg-green-700 ${
|
|
||||||
actionBtnLoadingState.isLoading ? "opacity-80 cursor-wait" : ""
|
|
||||||
}`}
|
|
||||||
onClick={() => handleSigninBtnsClick()}
|
|
||||||
>
|
|
||||||
Sign in
|
Sign in
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { Button, Input } from "@mui/joy";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useAppSelector } from "../store";
|
import { useAppSelector } from "../store";
|
||||||
@ -70,22 +71,19 @@ const UserDetail: React.FC = () => {
|
|||||||
</p>
|
</p>
|
||||||
<p className="leading-8 flex flex-row justify-start items-center">
|
<p className="leading-8 flex flex-row justify-start items-center">
|
||||||
<span className="mr-3 text-gray-500 font-mono">Password: </span>
|
<span className="mr-3 text-gray-500 font-mono">Password: </span>
|
||||||
<button className="border rounded-md px-2 leading-8 hover:shadow" onClick={handleChangePasswordBtnClick}>
|
<Button variant="soft" onClick={handleChangePasswordBtnClick}>
|
||||||
Change
|
Change
|
||||||
</button>
|
</Button>
|
||||||
</p>
|
</p>
|
||||||
<p className="leading-8 flex flex-row justify-start items-center">
|
<p className="leading-8 flex flex-row justify-start items-center">
|
||||||
<span className="mr-3 text-gray-500 font-mono">OpenID:</span>
|
<span className="mr-3 text-gray-500 font-mono">OpenID:</span>
|
||||||
<input className="border shrink w-48 rounded-md px-3 pr-5 shadow-inner truncate" type="text" value={user?.openId} readOnly />
|
<Input type="text" className="w-48" value={user?.openId} readOnly />
|
||||||
<button className="-ml-6 bg-white text-gray-600 hover:text-black" onClick={handleCopyOpenIdBtnClick}>
|
<button className="-ml-6 z-1 bg-white text-gray-600 hover:text-black" onClick={handleCopyOpenIdBtnClick}>
|
||||||
<Icon.Clipboard className="w-4 h-auto" />
|
<Icon.Clipboard className="w-4 h-auto" />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<Button className="!ml-6" variant="soft" color="warning" onClick={handleResetOpenIdBtnClick}>
|
||||||
className="border ml-4 rounded-md px-2 leading-8 border-red-600 text-red-600 bg-red-50 hover:shadow"
|
|
||||||
onClick={handleResetOpenIdBtnClick}
|
|
||||||
>
|
|
||||||
Reset
|
Reset
|
||||||
</button>
|
</Button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user