From fd44255668ecb0c5d5ffd10bcecebbd7eef47ce4 Mon Sep 17 00:00:00 2001 From: boojack Date: Sun, 7 Aug 2022 01:35:20 +0800 Subject: [PATCH] chore: use dropdown in member section --- web/src/components/Settings/MemberSection.tsx | 26 ++++++++--------- web/src/less/settings/member-section.less | 28 +++++-------------- 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx index 31a55309..263b0fa7 100644 --- a/web/src/components/Settings/MemberSection.tsx +++ b/web/src/components/Settings/MemberSection.tsx @@ -4,6 +4,7 @@ import { userService } from "../../services"; import { useAppSelector } from "../../store"; import * as api from "../../helpers/api"; import toastHelper from "../Toast"; +import Dropdown from "../common/Dropdown"; import { showCommonDialog } from "../Dialog/CommonDialog"; import "../../less/settings/member-section.less"; @@ -136,20 +137,19 @@ const PreferencesSection: React.FC = () => {
{currentUser?.id === user.id ? ( Yourself - ) : user.rowStatus === "NORMAL" ? ( - handleArchiveUserClick(user)}> - archive - ) : ( - <> - handleRestoreUserClick(user)}> - restore - - / - handleDeleteUserClick(user)}> - delete - - + + {user.rowStatus === "NORMAL" ? ( + + ) : ( + <> + + + + )} + )}
diff --git a/web/src/less/settings/member-section.less b/web/src/less/settings/member-section.less index ad687988..7edf7ad3 100644 --- a/web/src/less/settings/member-section.less +++ b/web/src/less/settings/member-section.less @@ -32,7 +32,7 @@ } > .member-container { - @apply w-full grid grid-cols-6 border-b py-2; + @apply w-full grid grid-cols-4 border-b py-2; > .field-text { @apply text-base pl-2 mr-4 w-16 truncate; @@ -42,35 +42,21 @@ } &.email-text { - @apply w-auto col-span-3; + @apply w-auto col-span-2; } } > .buttons-container { - @apply col-span-2 flex flex-row justify-start items-center flex-wrap; - - > .btn { - @apply px-2 leading-7 border rounded shadow hover:opacity-80; - - &.archive { - @apply bg-yellow-100 text-yellow-600; - } - - &.restore { - @apply bg-green-100 text-green-600; - } - - &.delete { - @apply bg-red-100 text-red-600; - } - } + @apply col-span-1 flex flex-row justify-end items-center; > .tip-text { @apply text-gray-400; } - > .split-line { - @apply font-mono text-gray-300 mx-1; + > .actions-dropdown { + .delete { + @apply text-red-600; + } } } }