diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-17 10:40:09 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-01-17 10:40:09 -0600 |
commit | e11d53b67d7b50990320c4b5206ef052b0ff834c (patch) | |
tree | fc5e710d09e3c37ab380b445de3ec47f1533cc0a /src/view/com/lightbox/ProfileImage.tsx | |
parent | 4e312d1d24f2e83db02cf0baa3ff8e3421b2e602 (diff) | |
download | voidsky-e11d53b67d7b50990320c4b5206ef052b0ff834c.tar.zst |
Add loading spinners to lightbox views (close #38)
Diffstat (limited to 'src/view/com/lightbox/ProfileImage.tsx')
-rw-r--r-- | src/view/com/lightbox/ProfileImage.tsx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/view/com/lightbox/ProfileImage.tsx b/src/view/com/lightbox/ProfileImage.tsx index f9c4ae73e..41417ea40 100644 --- a/src/view/com/lightbox/ProfileImage.tsx +++ b/src/view/com/lightbox/ProfileImage.tsx @@ -1,13 +1,26 @@ import React from 'react' -import {StyleSheet, useWindowDimensions, View} from 'react-native' +import { + ActivityIndicator, + StyleSheet, + useWindowDimensions, + View, +} from 'react-native' import {UserAvatar} from '../util/UserAvatar' import {ProfileViewModel} from '../../../state/models/profile-view' export function Component({profileView}: {profileView: ProfileViewModel}) { const winDim = useWindowDimensions() const top = winDim.height / 2 - (winDim.width - 40) / 2 - 100 + const spinnerStyle = React.useMemo( + () => ({ + left: winDim.width / 2 - 30, + top: winDim.height / 2 - (winDim.width - 40) / 2 - 80, + }), + [winDim.width, winDim.height], + ) return ( <View style={[styles.container, {top}]}> + <ActivityIndicator style={[styles.loading, spinnerStyle]} size="large" /> <UserAvatar handle={profileView.handle} displayName={profileView.displayName} @@ -23,4 +36,7 @@ const styles = StyleSheet.create({ position: 'absolute', left: 20, }, + loading: { + position: 'absolute', + }, }) |