From 3b3664faecd910c1873779a9a9589d60e1ddb295 Mon Sep 17 00:00:00 2001 From: Corantin Date: Thu, 17 Oct 2024 23:45:09 -0400 Subject: [PATCH] :art: Refactor button and dispute components - Defaulted className and tooltipClassName to empty string in Button component - Added duplicate condition check for cooldown in DisputeButton - Changed some method from 'some' to 'find' for better performance - Adjusted tooltip message source and added tooltipSide property - Updated ProposalTimeline with dynamic ruling timeout display - Fixed styling issues across multiple components --- apps/web/components/Button.tsx | 7 +++---- apps/web/components/DisputeButton.tsx | 22 ++++++++++++++-------- apps/web/components/ProposalTimeline.tsx | 14 ++++++++++---- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/apps/web/components/Button.tsx b/apps/web/components/Button.tsx index bb27cbc54..caf64f86c 100644 --- a/apps/web/components/Button.tsx +++ b/apps/web/components/Button.tsx @@ -70,11 +70,11 @@ const btnStyles: BtnStyles = { export function Button({ onClick, - className: styles, + className: styles = "", disabled = false, tooltip, showToolTip = true, - tooltipClassName: tooltipStyles, + tooltipClassName: tooltipStyles = "", tooltipSide = "tooltip-top", children, btnStyle = "filled", @@ -86,8 +86,7 @@ export function Button({ const buttonElement = (