From f1b162a020d57d96404ca603a4c0ebfcc868af09 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Tue, 24 Jan 2023 00:36:51 +0100 Subject: [PATCH] Added gif preference https://github.com/mastodon/mastodon/pull/22706 --- src/@types/mastodon.d.ts | 1 + src/components/Menu/Container.tsx | 8 +- src/components/Relationship/Outgoing.tsx | 5 +- .../Timeline/Shared/Attachment/Video.tsx | 15 +- src/i18n/en/screens/tabs.json | 48 ++++-- src/screens/Tabs/Me/Preferences.tsx | 158 ++++++++++++++++++ src/screens/Tabs/Me/Profile/Root.tsx | 84 ---------- src/screens/Tabs/Me/Root/Settings.tsx | 23 --- src/screens/Tabs/Me/index.tsx | 15 +- .../Shared/Account/Information/Actions.tsx | 12 +- src/utils/navigation/navigators.ts | 1 + src/utils/queryHooks/preferences.ts | 2 +- 12 files changed, 233 insertions(+), 139 deletions(-) create mode 100644 src/screens/Tabs/Me/Preferences.tsx diff --git a/src/@types/mastodon.d.ts b/src/@types/mastodon.d.ts index e1dcfa40f..2a90a73a0 100644 --- a/src/@types/mastodon.d.ts +++ b/src/@types/mastodon.d.ts @@ -452,6 +452,7 @@ declare namespace Mastodon { 'posting:default:language'?: string 'reading:expand:media'?: 'default' | 'show_all' | 'hide_all' 'reading:expand:spoilers'?: boolean + 'reading:autoplay:gifs'?: boolean } type PushSubscription = { diff --git a/src/components/Menu/Container.tsx b/src/components/Menu/Container.tsx index b591386a2..c47d5c8d5 100644 --- a/src/components/Menu/Container.tsx +++ b/src/components/Menu/Container.tsx @@ -1,17 +1,19 @@ import { StyleConstants } from '@utils/styles/constants' import React from 'react' -import { View } from 'react-native' +import { View, ViewStyle } from 'react-native' export interface Props { + style?: ViewStyle children: React.ReactNode } -const MenuContainer: React.FC = ({ children }) => { +const MenuContainer: React.FC = ({ style, children }) => { return ( {children} diff --git a/src/components/Relationship/Outgoing.tsx b/src/components/Relationship/Outgoing.tsx index 6d59a01fc..35c889cca 100644 --- a/src/components/Relationship/Outgoing.tsx +++ b/src/components/Relationship/Outgoing.tsx @@ -13,7 +13,6 @@ import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' import { useTranslation } from 'react-i18next' -import { View } from 'react-native' export interface Props { id: Mastodon.Account['id'] @@ -127,7 +126,7 @@ const RelationshipOutgoing: React.FC = ({ id }: Props) => { const isPageNotifications = name === 'Tab-Notifications-Root' return ( - + <> {!isPageNotifications && canFollowNotify && query.data?.following ? (