Skip to content

Commit

Permalink
Dont add spinner to Loading component
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Aug 23, 2022
1 parent ff7b7a3 commit 2fae915
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
8 changes: 2 additions & 6 deletions packages/mobile/src/components/Loading/Loading.component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { FC } from 'react'
import { Image, View, ActivityIndicator } from 'react-native'
import { Image, View } from 'react-native'
import deviceInfoModule from 'react-native-device-info'
import * as Progress from 'react-native-progress'
import { appImages } from '../../../assets'
Expand All @@ -12,8 +12,7 @@ import { LoadingProps } from './Loading.types'
export const Loading: FC<LoadingProps> = ({
progress,
description,
checks,
spinner
checks
}) => {
return (
<View
Expand All @@ -37,9 +36,6 @@ export const Loading: FC<LoadingProps> = ({
style={{ margin: 10, maxWidth: 200 }}>
{description}
</Typography>
<View style={{ margin: 40 }}>
{spinner && <ActivityIndicator size="large" color={defaultTheme.palette.main.brand} />}
</View>
<View>
{progress > 0 && progress < 0.95 && (
<Progress.Bar
Expand Down
7 changes: 0 additions & 7 deletions packages/mobile/src/components/Loading/Loading.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,3 @@ storiesOf('Loading', module)
description={'Downloading tools to protect your privacy'}
/>
))
.add('with spinner', () => (
<Loading
progress={0}
spinner
description={'Connecting to peers'}
/>
))
1 change: 0 additions & 1 deletion packages/mobile/src/components/Loading/Loading.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ export interface LoadingProps {
progress: number
description: string
checks?: InitCheck[]
spinner?: boolean
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { FC, useEffect, useCallback } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { View } from 'react-native'
import { ActivityIndicator, View } from 'react-native'
import { communities, publicChannels } from '@quiet/state-manager'
import { initActions } from '../../store/init/init.slice'
import { ChannelList as ChannelListComponent } from '../../components/ChannelList/ChannelList.component'
import { defaultTheme } from '../../styles/themes/default.theme'
import { ChannelTileProps } from '../../components/ChannelTile/ChannelTile.types'
import { formatMessageDisplayDate } from '../../utils/functions/formatMessageDisplayDate/formatMessageDisplayDate'
import { replaceScreen } from '../../utils/functions/replaceScreen/replaceScreen'
import { ScreenNames } from '../../const/ScreenNames.enum'
import { Appbar } from '../../components/Appbar/Appbar.component'
import { capitalize } from '../../utils/functions/capitalize/capitalize'
import { Loading } from '../../components/Loading/Loading.component'

export const ChannelListScreen: FC = () => {
const dispatch = useDispatch()
Expand Down Expand Up @@ -53,7 +53,7 @@ export const ChannelListScreen: FC = () => {
return (
<View style={{ flex: 1 }}>
<Appbar title={capitalize(community.name)} position={'flex-start'} />
{!isChannelReplicated ? <Loading progress={0} spinner description={'Connecting to peers'}/> : <ChannelListComponent tiles={tiles} /> }
{!isChannelReplicated ? <ActivityIndicator size="large" color={defaultTheme.palette.main.brand} /> : <ChannelListComponent tiles={tiles} /> }
</View>
)
}

0 comments on commit 2fae915

Please sign in to comment.