From a13ab082cbbba5a7e824218b0c156751f4c9d24b Mon Sep 17 00:00:00 2001 From: Mike Starr <90465420+mikestarrdev@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:51:58 -0500 Subject: [PATCH] refactor css styles (#23) --- src/App.tsx | 83 ++++++++++++++++--------------- src/components/Button.tsx | 11 +++- src/components/Dialog.tsx | 32 ++++++------ src/components/Errors.tsx | 4 +- src/components/Header.tsx | 6 +-- src/components/Select.tsx | 4 +- src/components/Toggle.tsx | 4 +- src/components/forms/JsonForm.tsx | 19 ++----- src/components/forms/UrlForm.tsx | 12 +---- src/utilities/validateJson.ts | 4 +- 10 files changed, 81 insertions(+), 98 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 680ab7c..7e2747f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -253,53 +253,56 @@ function App() { >
- { - setInputType(InputType.JSON); - setIsNoErrors(false); - setIsEnableCheck(false); - setErrors([]); - }} - clickTypeUrl={() => { - setInputType(InputType.URL); - setIsNoErrors(false); - // we need to reset the following 2 values because they affect the behavior of `decompressedJson` in Dilog.tsx - setUrlString(undefined); - setIsEnableCheck(false); - setErrors([]); - }} - /> - - {inputType === InputType.JSON ? ( - - ) : ( - + { + setInputType(InputType.JSON); + setIsNoErrors(false); + setIsEnableCheck(false); + setErrors([]); + }} + clickTypeUrl={() => { + setInputType(InputType.URL); + setIsNoErrors(false); + // reset the following 2 values because they affect the behavior of `decompressedJson` in Dialog.tsx + setUrlString(undefined); + setIsEnableCheck(false); + setErrors([]); + }} /> - )} + + {inputType === InputType.JSON ? ( + + ) : ( + + )} +
diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 256347c..996cc94 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -4,16 +4,25 @@ export const Button = ({ text, clickAction, className, + variant, }: { text: string; clickAction?: () => void; className?: string; + variant: 'toggle' | 'dialog'; }) => { + const variants = { + toggle: + 'flex flex-row space-x-2 w-full py-1.5 text-black text-sm font-semibold justify-center border-blueGray', + dialog: + 'w-full mt-4 mx-auto py-3 px-4 text-white bg-blueGray border-darkgray border-1 rounded-sm font-medium text-lg uppercase', + }; + return ( + +
diff --git a/src/components/Errors.tsx b/src/components/Errors.tsx index 37187f8..8228e14 100644 --- a/src/components/Errors.tsx +++ b/src/components/Errors.tsx @@ -23,7 +23,7 @@ export const Errors = ({
0 && 'border-redAlert border-dashed', @@ -31,7 +31,7 @@ export const Errors = ({ )} > {!isNoErrors ? ( - + ) : (

🎊 No errors found! 🎊 diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 4ca07b8..e378560 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -25,11 +25,7 @@ export const Header = ({ AirSwap logo

Server Debugger

-
+
Protocol fee:{' '} {!isLoadingProtocolFee ? Number(protocolFee) || '7' : 'loading...'}
diff --git a/src/components/Select.tsx b/src/components/Select.tsx index 8df78ac..f77f17a 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -47,9 +47,9 @@ export const Select = ({ > - +
Select server response type: -
+