feat: add long press AccountSheet option
This commit is contained in:
parent
02a41926e7
commit
cf8761110f
1 changed files with 13 additions and 0 deletions
|
|
@ -16,6 +16,18 @@ const ChannelStore = findByStoreName("ChannelStore");
|
|||
const SelfPresenceStore = findByStoreName("SelfPresenceStore");
|
||||
|
||||
const showUserProfileActionSheet = findByName("showUserProfileActionSheet");
|
||||
const showYouAccountActionSheetByProp = findByProps("showYouAccountActionSheet");
|
||||
|
||||
function openAccountSheet(userId: string, channelId: string) {
|
||||
const fn = showYouAccountActionSheetByProp?.showYouAccountActionSheet;
|
||||
if (typeof fn === "function") {
|
||||
try {
|
||||
fn(true, true);
|
||||
return;
|
||||
} catch (_) {}
|
||||
}
|
||||
showUserProfileActionSheet?.({ userId, channelId });
|
||||
}
|
||||
|
||||
function AvatarAction() {
|
||||
const self = Flux?.useStateFromStores?.([UserStore], () => UserStore?.getCurrentUser?.());
|
||||
|
|
@ -28,6 +40,7 @@ function AvatarAction() {
|
|||
return (
|
||||
<Pressable
|
||||
onPress={() => showUserProfileActionSheet?.({ userId: self.id, channelId: channel?.id ?? channelId })}
|
||||
onLongPress={() => openAccountSheet(self.id, channel?.id ?? channelId)}
|
||||
style={{ justifyContent: "center", alignItems: "center", marginHorizontal: 4 }}
|
||||
>
|
||||
<Avatar
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue