Fix invite codes flash on desktop, use loading placeholder (#1591)
* Fix invite codes flashing untrue value before loaded * Add loading placeholder for right nav invites
This commit is contained in:
parent
2ba0c6a711
commit
9278822088
5 changed files with 142 additions and 89 deletions
|
@ -26,6 +26,33 @@ export function Component({}: {}) {
|
|||
store.shell.closeModal()
|
||||
}, [store])
|
||||
|
||||
if (store.me.invites === null) {
|
||||
return (
|
||||
<View style={[styles.container, pal.view]} testID="inviteCodesModal">
|
||||
<Text type="title-xl" style={[styles.title, pal.text]}>
|
||||
Error
|
||||
</Text>
|
||||
<Text type="lg" style={[styles.description, pal.text]}>
|
||||
An error occurred while loading invite codes.
|
||||
</Text>
|
||||
<View style={styles.flex1} />
|
||||
<View
|
||||
style={[
|
||||
styles.btnContainer,
|
||||
isTabletOrDesktop && styles.btnContainerDesktop,
|
||||
]}>
|
||||
<Button
|
||||
type="primary"
|
||||
label="Done"
|
||||
style={styles.btn}
|
||||
labelStyle={styles.btnLabel}
|
||||
onPress={onClose}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
if (store.me.invites.length === 0) {
|
||||
return (
|
||||
<View style={[styles.container, pal.view]} testID="inviteCodesModal">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue