1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
xmflsct
2023-02-12 18:38:06 +01:00
parent 4a340fca8e
commit 79a92b5df7
31 changed files with 180 additions and 143 deletions

View File

@@ -42,7 +42,7 @@ const ComponentAccount: React.FC<PropsWithChildren & Props> = ({ account, props,
style={{
width: StyleConstants.Avatar.S,
height: StyleConstants.Avatar.S,
borderRadius: 8,
borderRadius: StyleConstants.BorderRadius,
marginRight: StyleConstants.Spacing.S
}}
dim

View File

@@ -45,7 +45,7 @@ const AccountButton: React.FC<Props> = ({ account, additionalActions }) => {
width: StyleConstants.Font.Size.L,
height: StyleConstants.Font.Size.L
}}
style={{ borderRadius: StyleConstants.Font.Size.L / 2, overflow: 'hidden' }}
style={{ borderRadius: 99, overflow: 'hidden' }}
/>
<CustomText
fontStyle='M'

View File

@@ -116,7 +116,7 @@ const Button: React.FC<Props> = ({
}}
style={[
{
borderRadius: 100,
borderRadius: 99,
justifyContent: 'center',
alignItems: 'center',
borderWidth: overlay ? 0 : selected ? 1.5 : 1,

View File

@@ -35,7 +35,7 @@ const EmojisButton: React.FC = () => {
borderWidth: 2,
borderColor: colors.primaryDefault,
padding: StyleConstants.Spacing.Global.PagePadding / 2,
borderRadius: 100
borderRadius: 99
}}
>
<Icon

View File

@@ -51,7 +51,7 @@ const HeaderLeft: React.FC<Props> = ({
minWidth: 44,
marginLeft: native ? -StyleConstants.Spacing.S : StyleConstants.Spacing.S,
...(type === undefined && {
borderRadius: 100
borderRadius: 99
}),
...(type === 'text' && {
paddingHorizontal: StyleConstants.Spacing.S

View File

@@ -98,9 +98,7 @@ const HeaderRight: React.FC<Props> = ({
minHeight: 44,
minWidth: 44,
marginRight: native ? -StyleConstants.Spacing.S : StyleConstants.Spacing.S,
...(type === undefined && {
borderRadius: 100
}),
...(type === undefined && { borderRadius: 99 }),
...(type === 'text' && {
paddingHorizontal: StyleConstants.Spacing.S
})

View File

@@ -89,7 +89,7 @@ const MenuRow: React.FC<Props> = ({
width: 8,
height: 8,
backgroundColor: colors.red,
borderRadius: 8,
borderRadius: StyleConstants.BorderRadius,
marginRight: StyleConstants.Spacing.S
}}
/>

View File

@@ -31,9 +31,11 @@ export const SwipeToActions = <T extends unknown>({
haptics(action.haptic || 'Light')
action.onPress({ item })
}}
style={{ backgroundColor: 'rgba(0, 255, 0, 0.2)' }}
>
<View
style={{
flex: 1,
paddingHorizontal: StyleConstants.Spacing.L,
flexBasis: perActionWidth,
backgroundColor: action.color,

View File

@@ -67,7 +67,7 @@ const TimelineConversation: React.FC<Props> = ({ conversation, queryKey, highlig
<View style={{ flex: 1, width: '100%', flexDirection: 'row' }}>
<View
style={{
borderRadius: 4,
borderRadius: StyleConstants.BorderRadius,
overflow: 'hidden',
marginRight: StyleConstants.Spacing.S,
width: StyleConstants.Avatar.M,

View File

@@ -118,7 +118,7 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
width: '100%',
height: StyleConstants.Spacing.M + StyleConstants.Spacing.S * 2,
paddingHorizontal: StyleConstants.Spacing.Global.PagePadding,
borderRadius: 100,
borderRadius: 99,
opacity: sensitiveShown ? 0.35 : undefined
}}
>

View File

@@ -49,7 +49,7 @@ const TimelineAvatar: React.FC<Props> = ({ account }) => {
}
}
style={{
borderRadius: StyleConstants.Avatar.M,
borderRadius: 99,
overflow: 'hidden',
marginRight: StyleConstants.Spacing.S
}}

View File

@@ -137,7 +137,7 @@ const TimelineCard: React.FC = () => {
flexDirection: 'row',
marginTop: StyleConstants.Spacing.M,
borderWidth: 1,
borderRadius: StyleConstants.Spacing.S,
borderRadius: StyleConstants.BorderRadius,
overflow: 'hidden',
borderColor: colors.border
}}

View File

@@ -0,0 +1,26 @@
import i18n from '@i18n/index'
import { Alert } from 'react-native'
export const discardConfirmation = ({
condition,
action
}: {
condition: boolean
action: () => void
}) => {
if (condition) {
Alert.alert(i18n.t('common:discard.title'), i18n.t('common:discard.message'), [
{
text: i18n.t('common:buttons.discard'),
style: 'destructive',
onPress: () => action()
},
{
text: i18n.t('common:buttons.cancel'),
style: 'default'
}
])
} else {
action()
}
}

View File

@@ -5,7 +5,7 @@ import i18next from 'i18next'
import { Asset, launchImageLibrary } from 'react-native-image-picker'
const queryKeyInstance: QueryKeyInstance = ['Instance']
export const MAX_MEDIA_ATTACHMENTS: number =
export const MAX_MEDIA_ATTACHMENTS = (): number =>
queryClient.getQueryData<Mastodon.Instance<any>>(queryKeyInstance)?.configuration?.statuses
.max_media_attachments || 4
@@ -27,7 +27,7 @@ const mediaSelector = async ({
indicateMaximum = false,
showActionSheetWithOptions
}: Props): Promise<Asset[]> => {
const _maximum = maximum || MAX_MEDIA_ATTACHMENTS
const _maximum = maximum || MAX_MEDIA_ATTACHMENTS()
const options = () => {
switch (mediaType) {