1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Use spinkit instead of activityindicator

This commit is contained in:
Zhiyuan Zheng
2020-12-27 00:32:51 +01:00
parent bd5601f8f9
commit e1eade2b43
10 changed files with 245 additions and 166 deletions

View File

@ -1,8 +1,9 @@
import { Feather } from '@expo/vector-icons'
import React, { useMemo } from 'react'
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native'
import { StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { QueryStatus } from 'react-query'
import Button from '@components/Button'
import { Feather } from '@expo/vector-icons'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
@ -17,7 +18,9 @@ const TimelineEmpty: React.FC<Props> = ({ status, refetch }) => {
const children = useMemo(() => {
switch (status) {
case 'loading':
return <ActivityIndicator />
return (
<Chase size={StyleConstants.Font.Size.L} color={theme.secondary} />
)
case 'error':
return (
<>

View File

@ -1,6 +1,7 @@
import { Feather } from '@expo/vector-icons'
import React from 'react'
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native'
import { StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Feather } from '@expo/vector-icons'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
@ -14,7 +15,7 @@ const TimelineEnd: React.FC<Props> = ({ hasNextPage }) => {
return (
<View style={styles.base}>
{hasNextPage ? (
<ActivityIndicator />
<Chase size={StyleConstants.Font.Size.L} color={theme.secondary} />
) : (
<Text style={[styles.text, { color: theme.secondary }]}>
{' '}

View File

@ -1,21 +1,16 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import {
ActivityIndicator,
Pressable,
StyleSheet,
Text,
View
} from 'react-native'
import { Pressable, StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { useQuery } from 'react-query'
import client from '@api/client'
import { Feather } from '@expo/vector-icons'
import Emojis from '@components/Timelines/Timeline/Shared/Emojis'
import relativeTime from '@utils/relativeTime'
import { useTheme } from '@utils/styles/ThemeManager'
import { StyleConstants } from '@utils/styles/constants'
import { useQuery } from 'react-query'
import { relationshipFetch } from '@utils/fetches/relationshipFetch'
import client from '@api/client'
import { toast } from '@components/toast'
import openLink from '@root/utils/openLink'
import relativeTime from '@utils/relativeTime'
import { StyleConstants } from '@utils/styles/constants'
import { relationshipFetch } from '@utils/fetches/relationshipFetch'
import { useTheme } from '@utils/styles/ThemeManager'
export interface Props {
notification: Mastodon.Notification
@ -87,7 +82,9 @@ const TimelineHeaderNotification: React.FC<Props> = ({ notification }) => {
switch (status) {
case 'idle':
case 'loading':
return <ActivityIndicator />
return (
<Chase size={StyleConstants.Font.Size.L} color={theme.secondary} />
)
case 'success':
return (
<Pressable onPress={relationshipOnPress}>

View File

@ -162,12 +162,16 @@ const TimelinePoll: React.FC<Props> = ({
<View style={styles.optionSelected}>
<Feather
style={styles.voted}
name={poll.multiple ? 'check-square' : 'check-circle'}
name={
`${poll.own_votes!.includes(index) ? 'check-' : ''}${
poll.multiple ? 'square' : 'circle'
}` as any
}
size={StyleConstants.Font.Size.M}
color={
poll.own_votes!.includes(index)
? theme.primary
: theme.background
: theme.disabled
}
/>
<View style={styles.contentSelected}>
@ -266,7 +270,7 @@ const styles = StyleSheet.create({
flexDirection: 'row'
},
contentSelected: {
flexShrink: 1,
flex: 1,
flexDirection: 'row',
alignItems: 'center',
paddingRight: StyleConstants.Spacing.S