FIX: Sheet size

This commit is contained in:
Marcos Rodriguez Velez 2024-06-30 18:27:37 -04:00
parent cb9c0044fe
commit d51eca423d
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
2 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,12 @@
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
import { TrueSheet, TrueSheetProps } from '@lodev09/react-native-true-sheet';
import { SheetSize, TrueSheet, TrueSheetProps } from '@lodev09/react-native-true-sheet';
interface BottomModalProps extends TrueSheetProps {
children?: React.ReactNode;
onClose?: () => void;
name?: string;
isGrabberVisible?: boolean;
sizes?: SheetSize[] | undefined;
}
export interface BottomModalHandle {
@ -14,7 +15,7 @@ export interface BottomModalHandle {
}
const BottomModal = forwardRef<BottomModalHandle, BottomModalProps>(
({ name, onClose, onPresent, onSizeChange, isGrabberVisible = true, children, ...props }, ref) => {
({ name, onClose, onPresent, onSizeChange, isGrabberVisible = true, sizes = ['auto'], children, ...props }, ref) => {
const trueSheetRef = useRef<TrueSheet>(null);
useImperativeHandle(ref, () => ({
@ -39,12 +40,13 @@ const BottomModal = forwardRef<BottomModalHandle, BottomModalProps>(
name={name ?? 'BottomModal'}
ref={trueSheetRef}
cornerRadius={24}
sizes={['auto']}
sizes={sizes}
blurTint="regular"
onDismiss={onClose}
onPresent={onPresent}
onSizeChange={onSizeChange}
grabber={isGrabberVisible}
{...props}
>
{children}

View File

@ -103,7 +103,7 @@ const WalletsAddMultisig = () => {
const renderModal = () => {
return (
<BottomModal ref={bottomModalRef} contentContainerStyle={styles.modalContentShort} backgroundColor={stylesHook.modalContentShort}>
<BottomModal sizes={['auto', 'large']} ref={bottomModalRef} contentContainerStyle={styles.modalContentShort} backgroundColor={stylesHook.modalContentShort}>
<Text style={[styles.textHeader, stylesHook.textHeader]}>{loc.multisig.quorum_header}</Text>
<Text style={[styles.textSubtitle, stylesHook.textSubtitle]}>{loc.multisig.required_keys_out_of_total}</Text>
<View style={styles.rowCenter}>