From e11d53b67d7b50990320c4b5206ef052b0ff834c Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 17 Jan 2023 10:40:09 -0600 Subject: Add loading spinners to lightbox views (close #38) --- src/view/com/lightbox/ProfileImage.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/view/com/lightbox/ProfileImage.tsx') 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 ( +