From db4a75dfbcd7cf7c0a18203e895db0854e6b3afa Mon Sep 17 00:00:00 2001 From: masonschafercodes <57614646+masonschafercodes@users.noreply.github.com> Date: Wed, 1 Feb 2023 10:19:08 -0500 Subject: [PATCH] feat(web/alert): new options for alert dialog (#213) --- package/client/resource/interface/alert.ts | 2 ++ resource/interface/client/alert.lua | 2 ++ web/src/features/dev/debug/alert.ts | 2 ++ web/src/features/dialog/AlertDialog.tsx | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/package/client/resource/interface/alert.ts b/package/client/resource/interface/alert.ts index e75c927..f599b73 100644 --- a/package/client/resource/interface/alert.ts +++ b/package/client/resource/interface/alert.ts @@ -2,6 +2,8 @@ interface AlertDialogProps { header: string; content: string; centered?: boolean; + size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; + overflow?: boolean; cancel?: boolean; labels?: { cancel?: string; diff --git a/resource/interface/client/alert.lua b/resource/interface/client/alert.lua index 3543ba9..01f219c 100644 --- a/resource/interface/client/alert.lua +++ b/resource/interface/client/alert.lua @@ -4,6 +4,8 @@ local alert = nil ---@field header string; ---@field content string; ---@field centered? boolean?; +---@field size? 'xs' | 'sm' | 'md' | 'lg' | 'xl'; +---@field overflow? boolean?; ---@field cancel? boolean?; ---@field labels? {cancel?: string, confirm?: string} diff --git a/web/src/features/dev/debug/alert.ts b/web/src/features/dev/debug/alert.ts index 72674c2..b0e96b3 100644 --- a/web/src/features/dev/debug/alert.ts +++ b/web/src/features/dev/debug/alert.ts @@ -9,6 +9,8 @@ export const debugAlert = () => { header: 'Hello there', content: 'General kenobi \n Markdown works', centered: true, + size: 'lg', + overflow: true, cancel: true, // labels: { // confirm: 'Ok', diff --git a/web/src/features/dialog/AlertDialog.tsx b/web/src/features/dialog/AlertDialog.tsx index dbc495e..d111841 100644 --- a/web/src/features/dialog/AlertDialog.tsx +++ b/web/src/features/dialog/AlertDialog.tsx @@ -10,6 +10,8 @@ export interface AlertProps { header: string; content: string; centered?: boolean; + size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; + overflow?: boolean; cancel?: boolean; labels?: { cancel?: string; @@ -45,6 +47,8 @@ const AlertDialog: React.FC = () => { { setOpened(false);