mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Test release
Added screenshot package
This commit is contained in:
@ -3,7 +3,6 @@ import { StyleConstants } from '@utils/styles/constants'
|
||||
import layoutAnimation from '@utils/styles/layoutAnimation'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React, { useEffect, useMemo, useRef } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
Pressable,
|
||||
StyleProp,
|
||||
@ -49,8 +48,7 @@ const Button: React.FC<Props> = ({
|
||||
overlay = false,
|
||||
onPress
|
||||
}) => {
|
||||
const { i18n } = useTranslation()
|
||||
const { theme } = useTheme()
|
||||
const { mode, theme } = useTheme()
|
||||
|
||||
const mounted = useRef(false)
|
||||
useEffect(() => {
|
||||
@ -67,7 +65,7 @@ const Button: React.FC<Props> = ({
|
||||
<Chase size={StyleConstants.Font.Size[size]} color={theme.secondary} />
|
||||
</View>
|
||||
),
|
||||
[theme]
|
||||
[mode]
|
||||
)
|
||||
|
||||
const colorContent = useMemo(() => {
|
||||
@ -88,7 +86,7 @@ const Button: React.FC<Props> = ({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [theme, disabled])
|
||||
}, [mode, disabled])
|
||||
const colorBorder = useMemo(() => {
|
||||
if (active) {
|
||||
return theme.blue
|
||||
@ -103,14 +101,14 @@ const Button: React.FC<Props> = ({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [theme, loading, disabled])
|
||||
}, [mode, loading, disabled])
|
||||
const colorBackground = useMemo(() => {
|
||||
if (overlay) {
|
||||
return theme.backgroundOverlay
|
||||
} else {
|
||||
return theme.background
|
||||
}
|
||||
}, [theme])
|
||||
}, [mode])
|
||||
|
||||
const children = useMemo(() => {
|
||||
switch (type) {
|
||||
@ -147,7 +145,7 @@ const Button: React.FC<Props> = ({
|
||||
</>
|
||||
)
|
||||
}
|
||||
}, [i18n.language, theme, content, loading, disabled, active])
|
||||
}, [mode, content, loading, disabled, active])
|
||||
|
||||
enum spacingMapping {
|
||||
XS = 'S',
|
||||
|
@ -28,10 +28,7 @@ const ComponentHashtag: React.FC<Props> = ({
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
style={[styles.itemDefault, { borderBottomColor: theme.border }]}
|
||||
onPress={customOnPress || onPress}
|
||||
>
|
||||
<Pressable style={styles.itemDefault} onPress={customOnPress || onPress}>
|
||||
<Text style={[styles.itemHashtag, { color: theme.primary }]}>
|
||||
#{hashtag.name}
|
||||
</Text>
|
||||
@ -41,8 +38,7 @@ const ComponentHashtag: React.FC<Props> = ({
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
itemDefault: {
|
||||
padding: StyleConstants.Spacing.S * 1.5,
|
||||
borderBottomWidth: StyleSheet.hairlineWidth
|
||||
padding: StyleConstants.Spacing.S * 1.5
|
||||
},
|
||||
itemHashtag: {
|
||||
...StyleConstants.FontStyle.M
|
||||
|
@ -33,7 +33,7 @@ const ComponentInstance: React.FC<Props> = ({
|
||||
disableHeaderImage,
|
||||
goBack = false
|
||||
}) => {
|
||||
const { t } = useTranslation('componentInstance')
|
||||
const { t, i18n } = useTranslation('componentInstance')
|
||||
const { theme } = useTheme()
|
||||
const navigation = useNavigation()
|
||||
|
||||
@ -136,7 +136,7 @@ const ComponentInstance: React.FC<Props> = ({
|
||||
case 'remote':
|
||||
return t('server.button.remote')
|
||||
}
|
||||
}, [])
|
||||
}, [i18n.language])
|
||||
|
||||
const requestAuth = useMemo(() => {
|
||||
if (
|
||||
|
@ -164,7 +164,13 @@ const Timeline: React.FC<Props> = ({
|
||||
<RefreshControl
|
||||
{...(Platform.OS === 'android' && { enabled: true })}
|
||||
refreshing={
|
||||
isSwipeDown.current && isFetching && !isFetchingNextPage && !isLoading
|
||||
Platform.OS === 'android'
|
||||
? (isSwipeDown.current && isFetching && !isFetchingNextPage) ||
|
||||
isLoading
|
||||
: isSwipeDown.current &&
|
||||
isFetching &&
|
||||
!isFetchingNextPage &&
|
||||
!isLoading
|
||||
}
|
||||
onRefresh={() => {
|
||||
isSwipeDown.current = true
|
||||
|
Reference in New Issue
Block a user