Skip to content

Commit

Permalink
fix(mobile): Render SlideButton conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
voloshinskii committed Apr 17, 2024
1 parent 2543a86 commit feb6088
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export const SignRawModal = memo<SignRawModalProps>((props) => {
</Modal.ScrollView>
<Modal.Footer>
<NFTOperationFooter
withSlider
onPressConfirm={handleConfirm}
redirectToActivity={redirectToActivity}
ref={footerRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ interface ActionFooterProps {
onCloseModal?: () => void;
disabled?: boolean;
redirectToActivity?: boolean;
withSlider?: boolean;
}

export const ActionFooter = React.forwardRef<ActionFooterRef, ActionFooterProps>(
Expand Down Expand Up @@ -200,13 +201,33 @@ export const ActionFooter = React.forwardRef<ActionFooterRef, ActionFooterProps>
isVisible={state === States.INITIAL}
entranceAnimation={false}
>
<View style={styles.slideContainer.static}>
<SlideButton
disabled={props.disabled}
onSuccessSlide={() => props.onPressConfirm()}
text={t('nft_operation_slide_to_confirm')}
/>
</View>
{props.withSlider ? (
<View style={styles.slideContainer.static}>
<SlideButton
disabled={props.disabled}
onSuccessSlide={() => props.onPressConfirm()}
text={t('nft_operation_slide_to_confirm')}
/>
</View>
) : (
<View style={S.styles.footerButtons}>
{withCloseButton ? (
<>
<S.ActionButton mode="secondary" onPress={() => closeModal(false)}>
{t('cancel')}
</S.ActionButton>
<Spacer x={16} />
</>
) : null}
<S.ActionButton
disabled={props.disabled}
onPress={() => props.onPressConfirm()}
mode={props.secondary ? 'secondary' : 'primary'}
>
{props.confirmTitle ?? t('nft_confirm_operation')}
</S.ActionButton>
</View>
)}
</TransitionOpacity>
<TransitionOpacity
style={S.styles.transitionContainer}
Expand Down

0 comments on commit feb6088

Please sign in to comment.