From ae522f1585507a369de0ebbdfbd8762243ad2c6c Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 26 Feb 2022 21:26:53 -0500 Subject: [PATCH] More color adjustments --- .../admin/users/UsersContainerV2.tsx | 32 +++++++++++++++---- .../elements/button/button.module.css | 2 +- .../components/elements/dialog/Dialog.tsx | 10 ++---- .../elements/dialog/dialog.module.css | 15 ++++++++- .../elements/dropdown/DropdownItem.tsx | 18 ++++++++--- .../elements/dropdown/dropdown.module.css | 8 +++-- tailwind.config.js | 5 +-- 7 files changed, 66 insertions(+), 24 deletions(-) diff --git a/resources/scripts/components/admin/users/UsersContainerV2.tsx b/resources/scripts/components/admin/users/UsersContainerV2.tsx index cb1635379..d0b1118af 100644 --- a/resources/scripts/components/admin/users/UsersContainerV2.tsx +++ b/resources/scripts/components/admin/users/UsersContainerV2.tsx @@ -4,11 +4,12 @@ import { User } from '@/api/admin/user'; import { AdminTransformers } from '@/api/admin/transformers'; import { Dropdown } from '@/components/elements/dropdown'; import { + BanIcon, DotsVerticalIcon, - LockClosedIcon, - PaperAirplaneIcon, + LockOpenIcon, PencilIcon, PlusIcon, + SupportIcon, TrashIcon, } from '@heroicons/react/solid'; import { Button } from '@/components/elements/button/index'; @@ -42,7 +43,11 @@ const UsersContainerV2 = () => { This account will be permanently deleted. - setVisible(false)}>Cancel + setVisible(false)} + >Cancel + Delete @@ -52,6 +57,7 @@ const UsersContainerV2 = () => { Email + @@ -59,7 +65,7 @@ const UsersContainerV2 = () => {
- +
@@ -81,16 +87,28 @@ const UsersContainerV2 = () => { + + {user.isUsingTwoFactor && + + 2-FA Enabled + + } + }>Edit - }>Reset Password - }>Suspend + }>Reset Password + } disabled={!user.isUsingTwoFactor}> + Disable 2-FA + + }>Suspend - } onClick={() => setVisible(true)} danger>Delete Account + } onClick={() => setVisible(true)} danger>Delete + Account + diff --git a/resources/scripts/components/elements/button/button.module.css b/resources/scripts/components/elements/button/button.module.css index 3931526fc..728e14155 100644 --- a/resources/scripts/components/elements/button/button.module.css +++ b/resources/scripts/components/elements/button/button.module.css @@ -22,7 +22,7 @@ } .text { - @apply bg-transparent focus:ring-neutral-300 focus:ring-opacity-50 hover:bg-neutral-600 active:bg-neutral-500; + @apply bg-transparent focus:ring-neutral-300 focus:ring-opacity-50 hover:bg-neutral-500 active:bg-neutral-500; } .danger { diff --git a/resources/scripts/components/elements/dialog/Dialog.tsx b/resources/scripts/components/elements/dialog/Dialog.tsx index 4f2e4d988..ae07719f3 100644 --- a/resources/scripts/components/elements/dialog/Dialog.tsx +++ b/resources/scripts/components/elements/dialog/Dialog.tsx @@ -78,12 +78,12 @@ const Dialog = ({ visible, title, onDismissed, children }: Props) => { leaveFrom={'opacity-100 scale-100'} leaveTo={'opacity-0 scale-95'} > -
+
{icon &&
{icon}
}
{title && - + {title} } @@ -92,11 +92,7 @@ const Dialog = ({ visible, title, onDismissed, children }: Props) => {
- {buttons && -
- {buttons} -
- } + {buttons &&
{buttons}
} {/* Keep this below the other buttons so that it isn't the default focus if they're present. */}
onDismissed()} className={'hover:rotate-90'}> diff --git a/resources/scripts/components/elements/dialog/dialog.module.css b/resources/scripts/components/elements/dialog/dialog.module.css index 9bc9ff670..94959ee77 100644 --- a/resources/scripts/components/elements/dialog/dialog.module.css +++ b/resources/scripts/components/elements/dialog/dialog.module.css @@ -3,5 +3,18 @@ } .overlay { - @apply fixed inset-0 bg-neutral-900 opacity-75; + @apply fixed inset-0 bg-gray-900 opacity-50; +} + +.container { + @apply relative bg-gray-600 rounded max-w-xl w-full mx-auto shadow-lg; + @apply ring-4 ring-gray-800 ring-opacity-80; + + & .title { + @apply font-header text-xl font-medium mb-2 text-white pr-4; + } + + & > .button_bar { + @apply px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b; + } } diff --git a/resources/scripts/components/elements/dropdown/DropdownItem.tsx b/resources/scripts/components/elements/dropdown/DropdownItem.tsx index 41f6720af..e431336e4 100644 --- a/resources/scripts/components/elements/dropdown/DropdownItem.tsx +++ b/resources/scripts/components/elements/dropdown/DropdownItem.tsx @@ -12,18 +12,28 @@ interface Props { onClick?: (e: React.MouseEvent) => void; } -const DropdownItem = forwardRef(({ disabled, danger, className, onClick, children, icon: IconComponent }, ref) => { +const DropdownItem = forwardRef(({ + disabled, + danger, + className, + onClick, + children, + icon: IconComponent, +}, ref) => { return ( - {(args) => ( + {({ disabled, active }) => ( {IconComponent} - {typeof children === 'function' ? children(args) : children} + {typeof children === 'function' ? children({ disabled, active }) : children} )} diff --git a/resources/scripts/components/elements/dropdown/dropdown.module.css b/resources/scripts/components/elements/dropdown/dropdown.module.css index 73ed043e4..0b98e3428 100644 --- a/resources/scripts/components/elements/dropdown/dropdown.module.css +++ b/resources/scripts/components/elements/dropdown/dropdown.module.css @@ -34,7 +34,7 @@ @apply w-4 h-4 mr-4 text-neutral-300; } - &:hover, &:focus, &:focus-within { + &:hover, &:focus { @apply bg-blue-500 text-blue-50; & svg { @@ -43,7 +43,7 @@ } &.danger { - &:hover, &:focus, &:focus-within { + &:hover, &:focus { @apply bg-red-500 text-red-50; & svg { @@ -51,4 +51,8 @@ } } } + + &.disabled { + @apply cursor-not-allowed hover:bg-neutral-800 opacity-30 focus:bg-transparent focus:hover:bg-neutral-800; + } } diff --git a/tailwind.config.js b/tailwind.config.js index e53495649..d826fcc33 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -11,9 +11,10 @@ module.exports = { }, colors: { black: '#131a20', - // Deprecated, prefer the use of "blue" directly here. + // Deprecated, prefer "blue"... primary: colors.blue, - neutral: colors.neutral, + // Deprecate, prefer "gray"... + neutral: colors.gray, cyan: colors.cyan, }, fontSize: {