mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix #667
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -35,7 +35,7 @@ const EmojisButton: React.FC = () => {
|
||||
borderWidth: 2,
|
||||
borderColor: colors.primaryDefault,
|
||||
padding: StyleConstants.Spacing.Global.PagePadding / 2,
|
||||
borderRadius: 100
|
||||
borderRadius: 99
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
@@ -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
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -49,7 +49,7 @@ const TimelineAvatar: React.FC<Props> = ({ account }) => {
|
||||
}
|
||||
}
|
||||
style={{
|
||||
borderRadius: StyleConstants.Avatar.M,
|
||||
borderRadius: 99,
|
||||
overflow: 'hidden',
|
||||
marginRight: StyleConstants.Spacing.S
|
||||
}}
|
||||
|
||||
@@ -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
|
||||
}}
|
||||
|
||||
26
src/components/discardConfirmation.ts
Normal file
26
src/components/discardConfirmation.ts
Normal 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()
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user