[FIX]: Add showInput prop to show actionSheetContent without input (#4335)
This commit is contained in:
parent
f5167a2c94
commit
2e8b7d7755
|
@ -75,7 +75,8 @@ const ActionSheetContentWithInputAndSubmit = ({
|
||||||
iconName,
|
iconName,
|
||||||
iconColor,
|
iconColor,
|
||||||
customText,
|
customText,
|
||||||
confirmBackgroundColor
|
confirmBackgroundColor,
|
||||||
|
showInput = true
|
||||||
}: {
|
}: {
|
||||||
onSubmit: (inputValue: string) => void;
|
onSubmit: (inputValue: string) => void;
|
||||||
onCancel?: () => void;
|
onCancel?: () => void;
|
||||||
|
@ -89,6 +90,7 @@ const ActionSheetContentWithInputAndSubmit = ({
|
||||||
iconColor?: string;
|
iconColor?: string;
|
||||||
customText?: React.ReactElement;
|
customText?: React.ReactElement;
|
||||||
confirmBackgroundColor?: string;
|
confirmBackgroundColor?: string;
|
||||||
|
showInput?: boolean;
|
||||||
}): React.ReactElement => {
|
}): React.ReactElement => {
|
||||||
const { colors } = useTheme();
|
const { colors } = useTheme();
|
||||||
const [inputValue, setInputValue] = useState('');
|
const [inputValue, setInputValue] = useState('');
|
||||||
|
@ -106,6 +108,7 @@ const ActionSheetContentWithInputAndSubmit = ({
|
||||||
<Text style={[styles.subtitleText, { color: colors.titleText }]}>{description}</Text>
|
<Text style={[styles.subtitleText, { color: colors.titleText }]}>{description}</Text>
|
||||||
{customText}
|
{customText}
|
||||||
</>
|
</>
|
||||||
|
{showInput ? (
|
||||||
<FormTextInput
|
<FormTextInput
|
||||||
value={inputValue}
|
value={inputValue}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
|
@ -122,13 +125,14 @@ const ActionSheetContentWithInputAndSubmit = ({
|
||||||
inputStyle={{ borderWidth: 2 }}
|
inputStyle={{ borderWidth: 2 }}
|
||||||
bottomSheet={isIOS}
|
bottomSheet={isIOS}
|
||||||
/>
|
/>
|
||||||
|
) : null}
|
||||||
<FooterButtons
|
<FooterButtons
|
||||||
confirmBackgroundColor={confirmBackgroundColor || colors.actionTintColor}
|
confirmBackgroundColor={confirmBackgroundColor || colors.actionTintColor}
|
||||||
cancelAction={onCancel || hideActionSheet}
|
cancelAction={onCancel || hideActionSheet}
|
||||||
confirmAction={() => onSubmit(inputValue)}
|
confirmAction={() => onSubmit(inputValue)}
|
||||||
cancelTitle={i18n.t('Cancel')}
|
cancelTitle={i18n.t('Cancel')}
|
||||||
confirmTitle={confirmTitle || i18n.t('Save')}
|
confirmTitle={confirmTitle || i18n.t('Save')}
|
||||||
disabled={!inputValue}
|
disabled={!showInput ? false : !inputValue}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
@ -97,6 +97,7 @@ function ConfirmDeleteAccountActionSheetContent({ changeOwnerRooms = '', removed
|
||||||
testID='room-info-edit-view-name'
|
testID='room-info-edit-view-name'
|
||||||
confirmTitle={i18n.t('Delete_Account_confirm')}
|
confirmTitle={i18n.t('Delete_Account_confirm')}
|
||||||
confirmBackgroundColor={colors.dangerColor}
|
confirmBackgroundColor={colors.dangerColor}
|
||||||
|
showInput={false}
|
||||||
customText={
|
customText={
|
||||||
<>
|
<>
|
||||||
{!!changeOwnerRooms && <AlertText text={changeOwnerRooms} />}
|
{!!changeOwnerRooms && <AlertText text={changeOwnerRooms} />}
|
||||||
|
|
Loading…
Reference in New Issue