From b51cf2d848e96be8c9d8b563589e5d76fb0b4279 Mon Sep 17 00:00:00 2001 From: danidfra Date: Thu, 15 Aug 2024 13:24:48 -0300 Subject: [PATCH] Refatoring BigCard --- src/components/big-card.tsx | 7 +++---- src/features/onboarding/steps/avatar-selection-step.tsx | 3 +-- src/features/onboarding/steps/bio-step.tsx | 3 +-- .../onboarding/steps/cover-photo-selection-step.tsx | 3 +-- src/features/onboarding/steps/display-name-step.tsx | 3 +-- src/features/onboarding/steps/suggested-accounts-step.tsx | 3 +-- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/components/big-card.tsx b/src/components/big-card.tsx index 126444b32..8e822f719 100644 --- a/src/components/big-card.tsx +++ b/src/components/big-card.tsx @@ -9,17 +9,16 @@ interface IBigCard { title: React.ReactNode; subtitle?: React.ReactNode; children: React.ReactNode; - onClose?: boolean; - buttonEvent?(): void; + onClose?(): void; } -const BigCard: React.FC = ({ title, subtitle, children, buttonEvent, onClose = false }) => { +const BigCard: React.FC = ({ title, subtitle, children, onClose }) => { return (
- {onClose && ()} + {onClose && ()} {title} {subtitle && {subtitle}} diff --git a/src/features/onboarding/steps/avatar-selection-step.tsx b/src/features/onboarding/steps/avatar-selection-step.tsx index a3e3c9c1b..785288014 100644 --- a/src/features/onboarding/steps/avatar-selection-step.tsx +++ b/src/features/onboarding/steps/avatar-selection-step.tsx @@ -72,9 +72,8 @@ const AvatarSelectionStep = ({ onNext }: { onNext: () => void }) => { return ( } - buttonEvent={handleComplete} subtitle={} - onClose + onClose={handleComplete} >
diff --git a/src/features/onboarding/steps/bio-step.tsx b/src/features/onboarding/steps/bio-step.tsx index cf236e402..30f9eb41b 100644 --- a/src/features/onboarding/steps/bio-step.tsx +++ b/src/features/onboarding/steps/bio-step.tsx @@ -52,8 +52,7 @@ const BioStep = ({ onNext }: { onNext: () => void }) => { } subtitle={} - buttonEvent={handleComplete} - onClose + onClose={handleComplete} >
diff --git a/src/features/onboarding/steps/cover-photo-selection-step.tsx b/src/features/onboarding/steps/cover-photo-selection-step.tsx index 67a6824ff..a2c559cec 100644 --- a/src/features/onboarding/steps/cover-photo-selection-step.tsx +++ b/src/features/onboarding/steps/cover-photo-selection-step.tsx @@ -76,8 +76,7 @@ const CoverPhotoSelectionStep = ({ onNext }: { onNext: () => void }) => { } subtitle={} - buttonEvent={handleComplete} - onClose + onClose={handleComplete} >
diff --git a/src/features/onboarding/steps/display-name-step.tsx b/src/features/onboarding/steps/display-name-step.tsx index cb4cda543..fd8ea8171 100644 --- a/src/features/onboarding/steps/display-name-step.tsx +++ b/src/features/onboarding/steps/display-name-step.tsx @@ -63,8 +63,7 @@ const DisplayNameStep = ({ onNext }: { onNext: () => void }) => { } subtitle={} - buttonEvent={handleComplete} - onClose + onClose={handleComplete} > void }) => { } subtitle={} - buttonEvent={handleComplete} - onClose + onClose={handleComplete} > {renderBody()}