Skip to content

Commit

Permalink
update - text to middle of screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Gehrkej committed Aug 23, 2024
1 parent 6ddee81 commit e989181
Showing 1 changed file with 65 additions and 57 deletions.
122 changes: 65 additions & 57 deletions app/segments/(team)/invitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,66 +91,74 @@ export function Invitelist() {
setRemoveCounter(0);
}}
/>
<ScrollView
refreshControl={<RefreshInvalidate invalidateKeys={invalidateKeys} />}
>
<List.Section
style={{
margin: 5,
borderRadius: 5,
}}

{Object.keys(invitelist).length === 0 ? (
<EmptyScreen
invalidateKeys={invalidateKeys}
text={"No invites found"}
/>
) : (
<ScrollView
refreshControl={<RefreshInvalidate invalidateKeys={invalidateKeys} />}
>
{Object.keys(invitelist).length === 0 ? (
<EmptyScreen
invalidateKeys={invalidateKeys}
text={"No invites found"}
/>
) : (
Object.keys(invitelist).map((inviteId) => {
return (
<List.Item
title={invitelist[inviteId].email}
key={inviteId}
right={() => (
<View
style={{
flexDirection: "row",
alignItems: "center",
paddingLeft: 10,
}}
>
<Button
onPress={async () => {
setRemoveLoading({
...removeLoading,
[inviteId]: true,
});
await removeInvitelist(currentTeamId, inviteId);
await invalidateMultipleKeys(
queryClient,
invalidateKeys,
);
setRemoveCounter((prev) => prev + 1);
setSnackbarVisible(true);
setRemoveLoading({
...removeLoading,
[inviteId]: false,
});
<List.Section
style={{
margin: 5,
borderRadius: 5,
}}
>
{Object.keys(invitelist).length === 0 ? (
<EmptyScreen
invalidateKeys={invalidateKeys}
text={"No invites found"}
/>
) : (
Object.keys(invitelist).map((inviteId) => {
return (
<List.Item
title={invitelist[inviteId].email}
key={inviteId}
right={() => (
<View
style={{
flexDirection: "row",
alignItems: "center",
paddingLeft: 10,
}}
height={38} //so the button doesn't change size because of the spinner
textColor={themeColors.accent}
loading={removeLoading[inviteId]}
>
Remove
</Button>
</View>
)}
/>
);
})
)}
</List.Section>
</ScrollView>
<Button
onPress={async () => {
setRemoveLoading({
...removeLoading,
[inviteId]: true,
});
await removeInvitelist(currentTeamId, inviteId);
await invalidateMultipleKeys(
queryClient,
invalidateKeys,
);
setRemoveCounter((prev) => prev + 1);
setSnackbarVisible(true);
setRemoveLoading({
...removeLoading,
[inviteId]: false,
});
}}
height={38} //so the button doesn't change size because of the spinner
textColor={themeColors.accent}
loading={removeLoading[inviteId]}
>
Remove
</Button>
</View>
)}
/>
);
})
)}
</List.Section>
</ScrollView>
)}
<Text>{statusText}</Text>
<View
style={{
Expand Down

0 comments on commit e989181

Please sign in to comment.