|
@@ -32,6 +32,7 @@ import Button from "../button";
|
|
|
import Text from "../text";
|
|
import Text from "../text";
|
|
|
|
|
|
|
|
const UserShortcut = ({
|
|
const UserShortcut = ({
|
|
|
|
|
+ isCloseBottomSheetOnLogoutPress = true,
|
|
|
isShowLoginButtonWhenNoSession = true,
|
|
isShowLoginButtonWhenNoSession = true,
|
|
|
isShowRegisterButton = false,
|
|
isShowRegisterButton = false,
|
|
|
isWorkWithCoreComplex = true,
|
|
isWorkWithCoreComplex = true,
|
|
@@ -337,10 +338,19 @@ const UserShortcut = ({
|
|
|
{
|
|
{
|
|
|
actionButtons?.map((buttonProps, index) => {
|
|
actionButtons?.map((buttonProps, index) => {
|
|
|
return <Button
|
|
return <Button
|
|
|
|
|
+ {...buttonProps}
|
|
|
|
|
+ onPress={() => {
|
|
|
|
|
+ if(buttonProps.isCloseBottomSheetOnPress !== false) {
|
|
|
|
|
+ setIsBottomSheetOpen(false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(buttonProps.onPress) {
|
|
|
|
|
+ buttonProps.onPress();
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
spreadBehaviour="stretch"
|
|
spreadBehaviour="stretch"
|
|
|
type="neutral"
|
|
type="neutral"
|
|
|
key={index}
|
|
key={index}
|
|
|
- {...buttonProps}
|
|
|
|
|
/>;
|
|
/>;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -349,7 +359,9 @@ const UserShortcut = ({
|
|
|
<Button
|
|
<Button
|
|
|
title={localize("logout" as keyof NCoreUIKit.Translation)}
|
|
title={localize("logout" as keyof NCoreUIKit.Translation)}
|
|
|
onPress={async () => {
|
|
onPress={async () => {
|
|
|
- setIsBottomSheetOpen(false);
|
|
|
|
|
|
|
+ if(isCloseBottomSheetOnLogoutPress) {
|
|
|
|
|
+ setIsBottomSheetOpen(false);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
let response;
|
|
let response;
|
|
|
let error;
|
|
let error;
|