diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 5e6575f2..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "javascript.inlayHints.functionLikeReturnTypes.enabled": false
-}
\ No newline at end of file
diff --git a/demo/screenshots/Component-Instance.png b/demo/screenshots/Component-Instance.png
new file mode 100644
index 00000000..8b31c0a9
Binary files /dev/null and b/demo/screenshots/Component-Instance.png differ
diff --git a/demo/screenshots/Component-MediaSelector.png b/demo/screenshots/Component-MediaSelector.png
new file mode 100644
index 00000000..c47692d8
Binary files /dev/null and b/demo/screenshots/Component-MediaSelector.png differ
diff --git a/demo/screenshots/Logout-Confirmation.png b/demo/screenshots/Logout-Confirmation.png
new file mode 100644
index 00000000..330d6b04
Binary files /dev/null and b/demo/screenshots/Logout-Confirmation.png differ
diff --git a/demo/screenshots/Screen-AccountSelection.png b/demo/screenshots/Screen-AccountSelection.png
new file mode 100644
index 00000000..14509119
Binary files /dev/null and b/demo/screenshots/Screen-AccountSelection.png differ
diff --git a/demo/screenshots/Tab-Local.png b/demo/screenshots/Tab-Local.png
new file mode 100644
index 00000000..2ec6d60a
Binary files /dev/null and b/demo/screenshots/Tab-Local.png differ
diff --git a/demo/screenshots/Tab-Me-List-Edit.png b/demo/screenshots/Tab-Me-List-Edit.png
new file mode 100644
index 00000000..02b20608
Binary files /dev/null and b/demo/screenshots/Tab-Me-List-Edit.png differ
diff --git a/demo/screenshots/Tab-Me-ListAccounts_Empty.png b/demo/screenshots/Tab-Me-ListAccounts_Empty.png
new file mode 100644
index 00000000..024c9e44
Binary files /dev/null and b/demo/screenshots/Tab-Me-ListAccounts_Empty.png differ
diff --git a/demo/screenshots/Tab-Me-ListAccounts_Error.png b/demo/screenshots/Tab-Me-ListAccounts_Error.png
new file mode 100644
index 00000000..b668b6a0
Binary files /dev/null and b/demo/screenshots/Tab-Me-ListAccounts_Error.png differ
diff --git a/demo/screenshots/Tab-Me-List_Delete.png b/demo/screenshots/Tab-Me-List_Delete.png
new file mode 100644
index 00000000..324421fd
Binary files /dev/null and b/demo/screenshots/Tab-Me-List_Delete.png differ
diff --git a/demo/screenshots/Tab-Me-List_Menu.png b/demo/screenshots/Tab-Me-List_Menu.png
new file mode 100644
index 00000000..7c4706b0
Binary files /dev/null and b/demo/screenshots/Tab-Me-List_Menu.png differ
diff --git a/demo/screenshots/Tab-Me-Profile-Fields.png b/demo/screenshots/Tab-Me-Profile-Fields.png
new file mode 100644
index 00000000..d4bf5060
Binary files /dev/null and b/demo/screenshots/Tab-Me-Profile-Fields.png differ
diff --git a/demo/screenshots/Tab-Me-Profile.png b/demo/screenshots/Tab-Me-Profile.png
new file mode 100644
index 00000000..9690c9d8
Binary files /dev/null and b/demo/screenshots/Tab-Me-Profile.png differ
diff --git a/demo/screenshots/Tab-Me-Profile_Feedback.png b/demo/screenshots/Tab-Me-Profile_Feedback.png
new file mode 100644
index 00000000..1d965ac4
Binary files /dev/null and b/demo/screenshots/Tab-Me-Profile_Feedback.png differ
diff --git a/demo/screenshots/Tab-Me-Push_Bottom.png b/demo/screenshots/Tab-Me-Push_Bottom.png
new file mode 100644
index 00000000..de8166d3
Binary files /dev/null and b/demo/screenshots/Tab-Me-Push_Bottom.png differ
diff --git a/demo/screenshots/Tab-Me-Push_MissingServerKey.png b/demo/screenshots/Tab-Me-Push_MissingServerKey.png
new file mode 100644
index 00000000..60cea2ff
Binary files /dev/null and b/demo/screenshots/Tab-Me-Push_MissingServerKey.png differ
diff --git a/demo/screenshots/Tab-Me-Push_NotAvailable.png b/demo/screenshots/Tab-Me-Push_NotAvailable.png
new file mode 100644
index 00000000..72a8e2f9
Binary files /dev/null and b/demo/screenshots/Tab-Me-Push_NotAvailable.png differ
diff --git a/demo/screenshots/Tab-Me-Push_ReEnable.png b/demo/screenshots/Tab-Me-Push_ReEnable.png
new file mode 100644
index 00000000..b3b69953
Binary files /dev/null and b/demo/screenshots/Tab-Me-Push_ReEnable.png differ
diff --git a/demo/screenshots/Tab-Me-Push_Top.png b/demo/screenshots/Tab-Me-Push_Top.png
new file mode 100644
index 00000000..a62fb995
Binary files /dev/null and b/demo/screenshots/Tab-Me-Push_Top.png differ
diff --git a/demo/screenshots/Tab-Me-Settings-Appearance.png b/demo/screenshots/Tab-Me-Settings-Appearance.png
new file mode 100644
index 00000000..c6723283
Binary files /dev/null and b/demo/screenshots/Tab-Me-Settings-Appearance.png differ
diff --git a/demo/screenshots/Tab-Me-Settings-DarkTheme.png b/demo/screenshots/Tab-Me-Settings-DarkTheme.png
new file mode 100644
index 00000000..e0f968f9
Binary files /dev/null and b/demo/screenshots/Tab-Me-Settings-DarkTheme.png differ
diff --git a/demo/screenshots/Tab-Me-Settings-FontSize.png b/demo/screenshots/Tab-Me-Settings-FontSize.png
new file mode 100644
index 00000000..af70d0c9
Binary files /dev/null and b/demo/screenshots/Tab-Me-Settings-FontSize.png differ
diff --git a/demo/screenshots/Tab-Me-Settings-OpeningLink.png b/demo/screenshots/Tab-Me-Settings-OpeningLink.png
new file mode 100644
index 00000000..d820a1be
Binary files /dev/null and b/demo/screenshots/Tab-Me-Settings-OpeningLink.png differ
diff --git a/demo/screenshots/Tab-Me-Settings.png b/demo/screenshots/Tab-Me-Settings.png
new file mode 100644
index 00000000..efdd60fc
Binary files /dev/null and b/demo/screenshots/Tab-Me-Settings.png differ
diff --git a/demo/screenshots/Tab-Me-Switch.png b/demo/screenshots/Tab-Me-Switch.png
new file mode 100644
index 00000000..0b1129e9
Binary files /dev/null and b/demo/screenshots/Tab-Me-Switch.png differ
diff --git a/demo/screenshots/Tab-Me.png b/demo/screenshots/Tab-Me.png
new file mode 100644
index 00000000..a601e90c
Binary files /dev/null and b/demo/screenshots/Tab-Me.png differ
diff --git a/demo/screenshots/Tab-Notifications-Filter.png b/demo/screenshots/Tab-Notifications-Filter.png
new file mode 100644
index 00000000..e2f5daaf
Binary files /dev/null and b/demo/screenshots/Tab-Notifications-Filter.png differ
diff --git a/demo/screenshots/Tab-Notifications.png b/demo/screenshots/Tab-Notifications.png
new file mode 100644
index 00000000..53707170
Binary files /dev/null and b/demo/screenshots/Tab-Notifications.png differ
diff --git a/demo/screenshots/Tab-Public.png b/demo/screenshots/Tab-Public.png
new file mode 100644
index 00000000..e6e3a0f0
Binary files /dev/null and b/demo/screenshots/Tab-Public.png differ
diff --git a/demo/screenshots/Tab-Shared-Account.png b/demo/screenshots/Tab-Shared-Account.png
new file mode 100644
index 00000000..a39301bf
Binary files /dev/null and b/demo/screenshots/Tab-Shared-Account.png differ
diff --git a/demo/screenshots/Tab-Shared-AccountInLists.png b/demo/screenshots/Tab-Shared-AccountInLists.png
new file mode 100644
index 00000000..623915f6
Binary files /dev/null and b/demo/screenshots/Tab-Shared-AccountInLists.png differ
diff --git a/demo/screenshots/Tab-Shared-Attachments.png b/demo/screenshots/Tab-Shared-Attachments.png
new file mode 100644
index 00000000..cbc46c80
Binary files /dev/null and b/demo/screenshots/Tab-Shared-Attachments.png differ
diff --git a/demo/screenshots/Tab-Shared-Hashtag.png b/demo/screenshots/Tab-Shared-Hashtag.png
new file mode 100644
index 00000000..642cac97
Binary files /dev/null and b/demo/screenshots/Tab-Shared-Hashtag.png differ
diff --git a/demo/screenshots/Tab-Shared-History.png b/demo/screenshots/Tab-Shared-History.png
new file mode 100644
index 00000000..ef9a5ab2
Binary files /dev/null and b/demo/screenshots/Tab-Shared-History.png differ
diff --git a/demo/screenshots/Tab-Shared-Search.png b/demo/screenshots/Tab-Shared-Search.png
new file mode 100644
index 00000000..9fd18b89
Binary files /dev/null and b/demo/screenshots/Tab-Shared-Search.png differ
diff --git a/demo/screenshots/Tab-Shared-Toot.png b/demo/screenshots/Tab-Shared-Toot.png
new file mode 100644
index 00000000..148478ea
Binary files /dev/null and b/demo/screenshots/Tab-Shared-Toot.png differ
diff --git a/demo/statuses.ts b/demo/statuses.ts
index 63d5e47a..1da8785c 100644
--- a/demo/statuses.ts
+++ b/demo/statuses.ts
@@ -1,6 +1,7 @@
-const demoStatuses = [
+const demoStatus: Mastodon.Status[] = [
{
id: '1',
+ uri: 'https://example.com',
created_at: new Date().toISOString(),
sensitive: false,
visibility: 'public',
@@ -13,7 +14,6 @@ const demoStatuses = [
bookmarked: false,
content:
'
Would you like to try out this simple, beautiful and open-source mobile app for Mastodon? 😊
',
- reblog: null,
application: {
name: 'tooot',
website: 'https://tooot.app'
@@ -23,19 +23,31 @@ const demoStatuses = [
username: 'tooot📱',
acct: 'tooot@xmflsct.com',
display_name: 'tooot📱',
- avatar_static:
- 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4'
+ avatar: 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4',
+ avatar_static: 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4',
+ url: '',
+ header: '',
+ header_static: '',
+ locked: false,
+ discoverable: false,
+ created_at: new Date().toISOString(),
+ last_status_at: new Date().toISOString(),
+ statuses_count: 1,
+ followers_count: 1,
+ following_count: 1,
+ fields: [],
+ bot: false
},
media_attachments: [],
poll: {
id: '1',
- expires_at: new Date().setDate(new Date().getDate() + 5),
+ expires_at: new Date().setDate(new Date().getDate() + 5).toString(),
expired: false,
multiple: false,
votes_count: 10,
- voters_count: null,
+ voters_count: 2,
voted: false,
- own_votes: null,
+ own_votes: undefined,
options: [
{
title: 'I would love to!',
@@ -48,11 +60,15 @@ const demoStatuses = [
],
emojis: []
},
- mentions: []
+ mentions: [],
+ tags: [],
+ emojis: [],
+ pinned: false
},
{
id: '2',
- created_at: new Date().setMinutes(new Date().getMinutes() - 2),
+ uri: 'https://example.com',
+ created_at: new Date().setMinutes(new Date().getMinutes() - 2).toString(),
sensitive: false,
spoiler_text: '',
visibility: 'public',
@@ -65,18 +81,26 @@ const demoStatuses = [
bookmarked: false,
content:
'Mastodon is a free and open-source self-hosted social networking service. It allows anyone to host their own server node in the network, and its various separately operated user bases are federated across many different servers. These nodes are referred to as "instances" by Mastodon users.
',
- reblog: null,
- application: {
- name: 'Web',
- website: null
- },
+ application: { name: 'Web' },
account: {
id: '1000',
username: 'Mastodon',
acct: 'mastodon',
display_name: 'Mastodon',
- avatar_static:
- 'https://mastodon.social/apple-touch-icon.png'
+ avatar: 'https://mastodon.social/apple-touch-icon.png',
+ avatar_static: 'https://mastodon.social/apple-touch-icon.png',
+ url: '',
+ header: '',
+ header_static: '',
+ locked: false,
+ discoverable: false,
+ created_at: new Date().toISOString(),
+ last_status_at: new Date().toISOString(),
+ statuses_count: 1,
+ followers_count: 1,
+ following_count: 1,
+ fields: [],
+ bot: false
},
media_attachments: [],
card: {
@@ -85,18 +109,31 @@ const demoStatuses = [
description:
'Mastodon is an open source decentralized social network - by the people for the people. Join the federation and take back control of your social media!',
type: 'link',
- image:
- 'https://mastodon.social/apple-touch-icon.png'
+ image: 'https://mastodon.social/apple-touch-icon.png',
+ author_name: '',
+ author_url: '',
+ provider_name: '',
+ provider_url: '',
+ html: '
',
+ width: 100,
+ height: 100,
+ embed_url: 'https://example.com',
+ blurhash: ''
},
- mentions: []
+ mentions: [],
+ tags: [],
+ emojis: [],
+ pinned: false
},
{
id: '3',
- created_at: '2021-01-24T09:50:00.901Z',
+ uri: '',
+ created_at: new Date().setHours(new Date().getHours() - 1).toString(),
+ sensitive: false,
spoiler_text: '',
visibility: 'public',
replies_count: 2,
- reblogs_count: null,
+ reblogs_count: 1,
favourites_count: 3,
favourited: false,
reblogged: false,
@@ -104,24 +141,38 @@ const demoStatuses = [
bookmarked: true,
content:
'These servers are connected as a federated social network, allowing users from different servers to interact with each other seamlessly. Once a Mastodon server knows another Mastodon server, it "federates" with the other Mastodon server. Mastodon is a part of the wider Fediverse, allowing its users to also interact with users on different open platforms that support the same protocol, such as PeerTube and Friendica.
',
- reblog: null,
- application: {
- name: 'Web',
- website: null
- },
+ application: { name: 'Web' },
account: {
id: '1001',
username: 'Fediverse',
acct: 'fediverse',
display_name: 'Fediverse',
+ avatar:
+ 'https://e7.pngegg.com/pngimages/667/514/png-clipart-mastodon-fediverse-social-media-free-software-logo-social-media-blue-text.png',
avatar_static:
- 'https://e7.pngegg.com/pngimages/667/514/png-clipart-mastodon-fediverse-social-media-free-software-logo-social-media-blue-text.png'
+ 'https://e7.pngegg.com/pngimages/667/514/png-clipart-mastodon-fediverse-social-media-free-software-logo-social-media-blue-text.png',
+ url: '',
+ header: '',
+ header_static: '',
+ locked: false,
+ discoverable: false,
+ created_at: new Date().toISOString(),
+ last_status_at: new Date().toISOString(),
+ statuses_count: 1,
+ followers_count: 1,
+ following_count: 1,
+ fields: [],
+ bot: false
},
media_attachments: [],
- mentions: []
+ mentions: [],
+ tags: [],
+ emojis: [],
+ pinned: false
},
{
id: '4',
+ uri: 'https://example.com',
created_at: '2021-01-24T08:50:00.901Z',
sensitive: false,
visibility: 'public',
@@ -134,7 +185,6 @@ const demoStatuses = [
bookmarked: false,
content:
'tooot is an open source, simple mobile client for Mastodon. Focusing on your connections while being able to explore the Fediverse.
',
- reblog: null,
application: {
name: 'tooot',
website: 'https://tooot.app'
@@ -144,14 +194,30 @@ const demoStatuses = [
username: 'tooot📱',
acct: 'tooot@xmflsct.com',
display_name: 'tooot📱',
- avatar_static:
- 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4'
+ avatar: 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4',
+ avatar_static: 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4',
+ url: '',
+ header: '',
+ header_static: '',
+ locked: false,
+ discoverable: false,
+ created_at: new Date().toISOString(),
+ last_status_at: new Date().toISOString(),
+ statuses_count: 1,
+ followers_count: 1,
+ following_count: 1,
+ fields: [],
+ bot: false
},
media_attachments: [],
- mentions: []
+ mentions: [],
+ tags: [],
+ emojis: [],
+ pinned: false
},
{
id: '5',
+ uri: 'https://example.com',
created_at: '2021-01-24T07:50:00.901Z',
sensitive: false,
visibility: 'public',
@@ -164,7 +230,6 @@ const demoStatuses = [
bookmarked: false,
content:
'- tooot supports multiple accounts - tooot supports browsing external instance - tooot aims to support multiple languages
',
- reblog: null,
application: {
name: 'tooot',
website: 'https://tooot.app'
@@ -174,12 +239,27 @@ const demoStatuses = [
username: 'tooot📱',
acct: 'tooot@xmflsct.com',
display_name: 'tooot📱',
- avatar_static:
- 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4'
+ avatar: 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4',
+ avatar_static: 'https://avatars.githubusercontent.com/u/77554750?s=200&v=4',
+ url: '',
+ header: '',
+ header_static: '',
+ locked: false,
+ discoverable: false,
+ created_at: new Date().toISOString(),
+ last_status_at: new Date().toISOString(),
+ statuses_count: 1,
+ followers_count: 1,
+ following_count: 1,
+ fields: [],
+ bot: false
},
media_attachments: [],
- mentions: []
+ mentions: [],
+ tags: [],
+ emojis: [],
+ pinned: false
}
]
-export default demoStatuses
+export default demoStatus
diff --git a/src/@types/mastodon.d.ts b/src/@types/mastodon.d.ts
index 8b58589b..7fec5552 100644
--- a/src/@types/mastodon.d.ts
+++ b/src/@types/mastodon.d.ts
@@ -333,24 +333,34 @@ declare namespace Mastodon {
url: string
}
- type Notification = {
- // Base
- id: string
- type:
- | 'follow'
- | 'follow_request'
- | 'mention'
- | 'reblog'
- | 'favourite'
- | 'poll'
- | 'status'
- | 'update'
- created_at: string
- account: Account
-
- // Others
- status?: Status
- }
+ type Notification =
+ | {
+ // Base
+ id: string
+ type: 'favourite' | 'mention' | 'poll' | 'reblog' | 'status' | 'update'
+ created_at: string
+ account: Account
+ status: Status
+ report: undefined
+ }
+ | {
+ // Base
+ id: string
+ type: 'follow' | 'follow_request' | 'admin.sign_up'
+ created_at: string
+ account: Account
+ status: undefined
+ report: undefined
+ }
+ | {
+ // Base
+ id: string
+ type: 'admin.report'
+ created_at: string
+ account: Account
+ status: undefined
+ report: Report
+ }
type Poll = {
// Base
@@ -406,6 +416,19 @@ declare namespace Mastodon {
note: string
}
+ type Report = {
+ id: string
+ action_taken: boolean
+ action_taken_at?: string
+ category: 'spam' | 'violation' | 'other'
+ comment: string
+ forwarded: boolean
+ created_at: string
+ status_ids?: string[]
+ rule_ids?: string[]
+ target_account: Account
+ }
+
type Results = {
accounts?: Account[]
statuses?: Status[]
diff --git a/src/components/Menu/Row.tsx b/src/components/Menu/Row.tsx
index 5100745d..b3b8ca6e 100644
--- a/src/components/Menu/Row.tsx
+++ b/src/components/Menu/Row.tsx
@@ -86,9 +86,10 @@ const MenuRow: React.FC = ({
>
{iconFront && (
diff --git a/src/components/Timeline/Notifications.tsx b/src/components/Timeline/Notifications.tsx
index 4d7b69a6..7eff27d1 100644
--- a/src/components/Timeline/Notifications.tsx
+++ b/src/components/Timeline/Notifications.tsx
@@ -28,18 +28,18 @@ import TimelineHeaderAndroid from './Shared/HeaderAndroid'
export interface Props {
notification: Mastodon.Notification
queryKey: QueryKeyTimeline
- highlighted?: boolean
}
-const TimelineNotifications: React.FC = ({
- notification,
- queryKey,
- highlighted = false
-}) => {
+const TimelineNotifications: React.FC = ({ notification, queryKey }) => {
const instanceAccount = useSelector(getInstanceAccount, () => true)
const status = notification.status?.reblog ? notification.status.reblog : notification.status
- const account = notification.status ? notification.status.account : notification.account
+ const account =
+ notification.type === 'admin.report'
+ ? notification.report.target_account
+ : notification.status
+ ? notification.status.account
+ : notification.account
const ownAccount = notification.account?.id === instanceAccount?.id
const [spoilerExpanded, setSpoilerExpanded] = useState(
instanceAccount.preferences['reading:expand:spoilers'] || false
@@ -91,7 +91,8 @@ const TimelineNotifications: React.FC = ({
notification.type === 'follow' ||
notification.type === 'follow_request' ||
notification.type === 'mention' ||
- notification.type === 'status'
+ notification.type === 'status' ||
+ notification.type === 'admin.sign_up'
? 1
: 0.5
}}
@@ -102,12 +103,7 @@ const TimelineNotifications: React.FC = ({
{notification.status ? (
-
+
= ({
status,
ownAccount,
spoilerHidden,
- copiableContent,
- highlighted
+ copiableContent
}}
>
diff --git a/src/components/Timeline/Shared/Actioned.tsx b/src/components/Timeline/Shared/Actioned.tsx
index 8d3dcb26..8e73de69 100644
--- a/src/components/Timeline/Shared/Actioned.tsx
+++ b/src/components/Timeline/Shared/Actioned.tsx
@@ -28,7 +28,12 @@ const TimelineActioned: React.FC = ({ action, isNotification, ...rest })
const iconColor = colors.primaryDefault
const content = (content: string) => (
-
+
)
const onPress = () => navigation.push('Tab-Shared-Account', { account })
@@ -145,6 +150,30 @@ const TimelineActioned: React.FC = ({ action, isNotification, ...rest })
{content(t('shared.actioned.update'))}
>
)
+ case 'admin.sign_up':
+ return (
+ <>
+
+ {content(t('shared.actioned.admin.sign_up', { name: `@${account.acct}` }))}
+ >
+ )
+ case 'admin.report':
+ return (
+ <>
+
+ {content(t('shared.actioned.admin.report', { name: `@${account.acct}` }))}
+ >
+ )
default:
return <>>
}
diff --git a/src/components/Timeline/Shared/Attachment.tsx b/src/components/Timeline/Shared/Attachment.tsx
index 4ff5ab84..174894cc 100644
--- a/src/components/Timeline/Shared/Attachment.tsx
+++ b/src/components/Timeline/Shared/Attachment.tsx
@@ -45,6 +45,21 @@ const TimelineAttachment = () => {
}
const [sensitiveShown, setSensitiveShown] = useState(defaultSensitive())
+ // const testHorizontal: Mastodon.Attachment[] = Array(2).fill({
+ // id: Math.random().toString(),
+ // type: 'image',
+ // url: 'https://images.unsplash.com/photo-1670870764013-f0e36aa376b0?w=1000',
+ // preview_url: 'https://images.unsplash.com/photo-1543968996-ee822b8176ba?w=300',
+ // meta: { original: { width: 1000, height: 625 } }
+ // })
+ // const testVertical: Mastodon.Attachment[] = Array(7).fill({
+ // id: Math.random().toString(),
+ // type: 'image',
+ // url: 'https://images.unsplash.com/photo-1670842587871-326b95acbc8c?w=1000',
+ // preview_url: 'https://images.unsplash.com/photo-1670833288990-64b2f4ef7290?w=300',
+ // meta: { original: { width: 987, height: 1480 } }
+ // })
+
// @ts-ignore
const imageUrls: RootStackParamList['Screen-ImagesViewer']['imageUrls'] = status.media_attachments
.map(attachment => {
diff --git a/src/components/Timeline/Shared/Attachment/Audio.tsx b/src/components/Timeline/Shared/Attachment/Audio.tsx
index 83ec4f82..9e4cc767 100644
--- a/src/components/Timeline/Shared/Attachment/Audio.tsx
+++ b/src/components/Timeline/Shared/Attachment/Audio.tsx
@@ -8,7 +8,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
import { AppState, AppStateStatus, StyleSheet, View } from 'react-native'
import { Blurhash } from 'react-native-blurhash'
import AttachmentAltText from './AltText'
-import attachmentAspectRatio from './aspectRatio'
+import { aspectRatio } from './dimensions'
export interface Props {
total: number
@@ -64,7 +64,7 @@ const AttachmentAudio: React.FC = ({ total, index, sensitiveShown, audio
styles.base,
{
backgroundColor: colors.disabled,
- aspectRatio: attachmentAspectRatio({ total, index })
+ aspectRatio: aspectRatio({ total, index, ...audio.meta?.original })
}
]}
>
diff --git a/src/components/Timeline/Shared/Attachment/Image.tsx b/src/components/Timeline/Shared/Attachment/Image.tsx
index 814d41b2..1069a36a 100644
--- a/src/components/Timeline/Shared/Attachment/Image.tsx
+++ b/src/components/Timeline/Shared/Attachment/Image.tsx
@@ -1,9 +1,10 @@
import GracefullyImage from '@components/GracefullyImage'
import { StyleConstants } from '@utils/styles/constants'
+import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { View } from 'react-native'
import AttachmentAltText from './AltText'
-import attachmentAspectRatio from './aspectRatio'
+import { aspectRatio } from './dimensions'
export interface Props {
total: number
@@ -20,6 +21,8 @@ const AttachmentImage = ({
image,
navigateToImagesViewer
}: Props) => {
+ const { colors } = useTheme()
+
return (
- navigateToImagesViewer(image.id)}
- style={{
- aspectRatio:
- total > 1 || !image.meta?.original?.width || !image.meta?.original?.height
- ? attachmentAspectRatio({ total, index })
- : image.meta.original.height / image.meta.original.width > 1
- ? 1
- : image.meta.original.width / image.meta.original.height
- }}
- />
+
+ navigateToImagesViewer(image.id)}
+ style={{ aspectRatio: aspectRatio({ total, index, ...image.meta?.original }) }}
+ />
+
)
diff --git a/src/components/Timeline/Shared/Attachment/Unsupported.tsx b/src/components/Timeline/Shared/Attachment/Unsupported.tsx
index f1c7f347..7fa9d89d 100644
--- a/src/components/Timeline/Shared/Attachment/Unsupported.tsx
+++ b/src/components/Timeline/Shared/Attachment/Unsupported.tsx
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'
import { View } from 'react-native'
import { Blurhash } from 'react-native-blurhash'
import AttachmentAltText from './AltText'
-import attachmentAspectRatio from './aspectRatio'
+import { aspectRatio } from './dimensions'
export interface Props {
total: number
@@ -29,7 +29,7 @@ const AttachmentUnsupported: React.FC = ({ total, index, sensitiveShown,
padding: StyleConstants.Spacing.XS / 2,
justifyContent: 'center',
alignItems: 'center',
- aspectRatio: attachmentAspectRatio({ total, index })
+ aspectRatio: aspectRatio({ total, index, ...attachment.meta?.original })
}}
>
{attachment.blurhash ? (
diff --git a/src/components/Timeline/Shared/Attachment/Video.tsx b/src/components/Timeline/Shared/Attachment/Video.tsx
index b9ce9d98..78e53ac4 100644
--- a/src/components/Timeline/Shared/Attachment/Video.tsx
+++ b/src/components/Timeline/Shared/Attachment/Video.tsx
@@ -4,10 +4,10 @@ import { ResizeMode, Video, VideoFullscreenUpdate } from 'expo-av'
import React, { useRef, useState } from 'react'
import { Pressable, View } from 'react-native'
import { Blurhash } from 'react-native-blurhash'
-import attachmentAspectRatio from './aspectRatio'
import AttachmentAltText from './AltText'
import { Platform } from 'expo-modules-core'
import { useAccessibility } from '@utils/accessibility/AccessibilityManager'
+import { aspectRatio } from './dimensions'
export interface Props {
total: number
@@ -49,7 +49,7 @@ const AttachmentVideo: React.FC = ({
flex: 1,
flexBasis: '50%',
padding: StyleConstants.Spacing.XS / 2,
- aspectRatio: attachmentAspectRatio({ total, index })
+ aspectRatio: aspectRatio({ total, index, ...video.meta?.original })
}}
>
{
- switch (total) {
- case 1:
- case 4:
- return 16 / 9
- case 2:
- return 8 / 9
- case 3:
- if (index === 2) {
- return 32 / 9
- } else {
- return 16 / 9
- }
- default:
- return 16 / 9
- }
-}
-
-export default attachmentAspectRatio
diff --git a/src/components/Timeline/Shared/Attachment/dimensions.ts b/src/components/Timeline/Shared/Attachment/dimensions.ts
new file mode 100644
index 00000000..aa1d3564
--- /dev/null
+++ b/src/components/Timeline/Shared/Attachment/dimensions.ts
@@ -0,0 +1,38 @@
+export const aspectRatio = ({
+ total,
+ index,
+ width,
+ height
+}: {
+ total: number
+ index?: number
+ width?: number
+ height?: number
+}): number => {
+ const cropTooTall = (height || 1) / (width || 1) > 3 / 2 ? 2 / 3 : (width || 1) / (height || 1)
+
+ const isEven = total % 2 == 0
+ if (total > 5) {
+ switch (isEven) {
+ case true:
+ return total / 2 / 2
+ case false:
+ if ((index || -2) + 1 == total) {
+ return Math.ceil(total / 2)
+ } else {
+ return Math.ceil(total / 2) / 2
+ }
+ }
+ } else {
+ switch (isEven) {
+ case true:
+ return cropTooTall
+ case false:
+ if ((index || -2) + 1 == total) {
+ return cropTooTall * 2
+ } else {
+ return cropTooTall
+ }
+ }
+ }
+}
diff --git a/src/components/Timeline/Shared/HeaderNotification.tsx b/src/components/Timeline/Shared/HeaderNotification.tsx
index a7f6c312..7b93b702 100644
--- a/src/components/Timeline/Shared/HeaderNotification.tsx
+++ b/src/components/Timeline/Shared/HeaderNotification.tsx
@@ -1,13 +1,19 @@
+import Button from '@components/Button'
import menuAccount from '@components/contextMenu/account'
import menuInstance from '@components/contextMenu/instance'
import menuShare from '@components/contextMenu/share'
import menuStatus from '@components/contextMenu/status'
import Icon from '@components/Icon'
import { RelationshipIncoming, RelationshipOutgoing } from '@components/Relationship'
+import browserPackage from '@helpers/browserPackage'
+import { getInstanceUrl } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
+import * as WebBrowser from 'expo-web-browser'
import React, { useContext, useState } from 'react'
+import { useTranslation } from 'react-i18next'
import { Platform, Pressable, View } from 'react-native'
+import { useSelector } from 'react-redux'
import * as DropdownMenu from 'zeego/dropdown-menu'
import StatusContext from './Context'
import HeaderSharedAccount from './HeaderShared/Account'
@@ -21,6 +27,7 @@ export type Props = {
}
const TimelineHeaderNotification: React.FC = ({ notification }) => {
+ const { t } = useTranslation('componentTimeline')
const { queryKey, status } = useContext(StatusContext)
const { colors } = useTheme()
@@ -40,12 +47,32 @@ const TimelineHeaderNotification: React.FC = ({ notification }) => {
const mStatus = menuStatus({ status, queryKey })
const mInstance = menuInstance({ status, queryKey })
+ const url = useSelector(getInstanceUrl)
+
const actions = () => {
switch (notification.type) {
case 'follow':
return
case 'follow_request':
return
+ case 'admin.report':
+ return (
+
+ WebBrowser.openAuthSessionAsync(
+ `https://${url}/admin/reports/${notification.report.id}`,
+ 'tooot://tooot',
+ {
+ browserPackage: await browserPackage(),
+ dismissButtonStyle: 'done',
+ readerMode: false
+ }
+ )
+ }
+ />
+ )
default:
if (status) {
return (
@@ -118,12 +145,25 @@ const TimelineHeaderNotification: React.FC = ({ notification }) => {
@@ -151,7 +191,9 @@ const TimelineHeaderNotification: React.FC = ({ notification }) => {
i).reverse()?.[0]
+ if (account) {
+ const style = account.startsWith('@') ? 'pretty' : 'default'
- const instanceUrl = getInstanceUrl(store.getState())
- return style === 'default'
- ? { id: account, style, sameInstance: hostname === instanceUrl }
- : { username: account, style, sameInstance: hostname === instanceUrl }
+ const instanceUrl = getInstanceUrl(store.getState())
+ return style === 'default'
+ ? { id: account, style, sameInstance: hostname === instanceUrl }
+ : { username: account, style, sameInstance: hostname === instanceUrl }
+ } else {
+ return null
+ }
}
return null
diff --git a/src/i18n/en/components/instance.json b/src/i18n/en/components/instance.json
index f59b012e..18a320d1 100644
--- a/src/i18n/en/components/instance.json
+++ b/src/i18n/en/components/instance.json
@@ -1,7 +1,7 @@
{
"server": {
"textInput": {
- "placeholder": "Instance' domain"
+ "placeholder": "Instance's domain"
},
"button": "Login",
"information": {
diff --git a/src/i18n/en/components/timeline.json b/src/i18n/en/components/timeline.json
index 47e20a14..639c4a40 100644
--- a/src/i18n/en/components/timeline.json
+++ b/src/i18n/en/components/timeline.json
@@ -30,7 +30,9 @@
"default": "{{name}} boosted",
"notification": "{{name}} boosted your toot"
},
- "update": "Reblog has been edited"
+ "update": "Reblog has been edited",
+ "admin.sign_up": "{{name}} joined the instance",
+ "admin.report": "{{name}} reported:"
},
"actions": {
"reply": {
@@ -52,7 +54,8 @@
"bookmarked": {
"accessibilityLabel": "Add this toot to bookmarks",
"function": "Bookmark toot"
- }
+ },
+ "openReport": "Open report"
},
"actionsUsers": {
"reblogged_by": {
diff --git a/src/i18n/en/screens/compose.json b/src/i18n/en/screens/compose.json
index c4ea0f80..c292e3cc 100644
--- a/src/i18n/en/screens/compose.json
+++ b/src/i18n/en/screens/compose.json
@@ -1,13 +1,11 @@
{
"heading": {
"left": {
- "button": "Cancel",
"alert": {
"title": "Cancel editing?",
"buttons": {
"save": "Save draft",
- "delete": "Delete draft",
- "cancel": "Cancel"
+ "delete": "Delete draft"
}
}
},
diff --git a/src/i18n/en/screens/tabs.json b/src/i18n/en/screens/tabs.json
index fe32807e..6512b438 100644
--- a/src/i18n/en/screens/tabs.json
+++ b/src/i18n/en/screens/tabs.json
@@ -4,7 +4,6 @@
"name": "Following"
},
"public": {
- "name": "",
"segments": {
"federated": "Federated",
"local": "Local",
@@ -13,9 +12,6 @@
},
"notifications": {
"name": "Notifications"
- },
- "me": {
- "name": "About me"
}
},
"common": {
@@ -348,7 +344,7 @@
"notInLists": "Other lists"
},
"attachments": {
- "name": "<0 /><1>\"s media1>"
+ "name": "<0 /><1>'s media1>"
},
"hashtag": {
"follow": "Follow",
diff --git a/src/screens/Compose.tsx b/src/screens/Compose.tsx
index 82ed08c6..81334a8e 100644
--- a/src/screens/Compose.tsx
+++ b/src/screens/Compose.tsx
@@ -206,7 +206,7 @@ const ScreenCompose: React.FC> = ({
() => (
{
if (!composeState.dirty) {
navigation.goBack()
@@ -229,7 +229,7 @@ const ScreenCompose: React.FC> = ({
}
},
{
- text: t('heading.left.alert.buttons.cancel'),
+ text: t('common:buttons.cancel'),
style: 'cancel'
}
])
@@ -342,9 +342,7 @@ const ScreenCompose: React.FC> = ({
)
const headerContent = useMemo(() => {
- return `${totalTextCount} / ${maxTootChars}${
- __DEV__ ? ` Dirty: ${composeState.dirty.toString()}` : ''
- }`
+ return `${totalTextCount} / ${maxTootChars}`
}, [totalTextCount, maxTootChars, composeState.dirty])
const inputProps: EmojisState['inputProps'] = [
diff --git a/src/screens/Compose/EditAttachment/Image.tsx b/src/screens/Compose/EditAttachment/Image.tsx
index 05f0236f..f8b1e118 100644
--- a/src/screens/Compose/EditAttachment/Image.tsx
+++ b/src/screens/Compose/EditAttachment/Image.tsx
@@ -112,6 +112,17 @@ const ComposeEditAttachmentImage: React.FC = ({ index }) => {
return (
<>
+
+ {t('content.editAttachment.content.imageFocus')}
+
= ({ index }) => {
/>
- {screenReaderEnabled ? null : (
-
- {t('content.editAttachment.content.imageFocus')}
-
- )}
>
)
}
diff --git a/src/screens/Compose/EditAttachment/Root.tsx b/src/screens/Compose/EditAttachment/Root.tsx
index fcce19ed..db48d07d 100644
--- a/src/screens/Compose/EditAttachment/Root.tsx
+++ b/src/screens/Compose/EditAttachment/Root.tsx
@@ -2,7 +2,7 @@ import CustomText from '@components/Text'
import AttachmentVideo from '@components/Timeline/Shared/Attachment/Video'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
-import React, { useContext, useRef } from 'react'
+import React, { useContext } from 'react'
import { useTranslation } from 'react-i18next'
import { ScrollView, StyleSheet, TextInput, View } from 'react-native'
import ComposeContext from '../utils/createContext'
@@ -34,10 +34,10 @@ const ComposeEditAttachmentRoot: React.FC = ({ index }) => {
video={
video.local
? ({
- url: video.local.uri,
- preview_url: video.local.thumbnail,
- blurhash: video.remote?.blurhash
- } as Mastodon.AttachmentVideo)
+ url: video.local.uri,
+ preview_url: video.local.thumbnail,
+ blurhash: video.remote?.blurhash
+ } as Mastodon.AttachmentVideo)
: (video.remote as Mastodon.AttachmentVideo)
}
/>
@@ -47,45 +47,36 @@ const ComposeEditAttachmentRoot: React.FC = ({ index }) => {
return null
}
- const scrollViewRef = useRef(null)
-
return (
-
- {mediaDisplay()}
-
-
+
+
+
{t('content.editAttachment.content.altText.heading')}
scrollViewRef.current?.scrollToEnd()}
maxLength={1500}
multiline
- onChangeText={(e) =>
+ onChangeText={e =>
composeDispatch({
type: 'attachment/edit',
payload: {
...theAttachment,
description: e
}
- })}
+ })
+ }
placeholder={t('content.editAttachment.content.altText.placeholder')}
placeholderTextColor={colors.secondary}
- scrollEnabled
value={theAttachment.description}
keyboardAppearance={mode}
/>
@@ -101,6 +92,7 @@ const ComposeEditAttachmentRoot: React.FC = ({ index }) => {
{theAttachment.description?.length || 0} / 1500
+ {mediaDisplay()}
)
}
diff --git a/src/screens/ImagesViewer.tsx b/src/screens/ImagesViewer.tsx
index eb99187f..d5355b34 100644
--- a/src/screens/ImagesViewer.tsx
+++ b/src/screens/ImagesViewer.tsx
@@ -180,7 +180,7 @@ const ScreenImagesViewer = ({
options: [
t('content.options.save'),
t('content.options.share'),
- t('content.options.cancel')
+ t('common:buttons.cancel')
],
cancelButtonIndex: 2,
userInterfaceStyle: mode
diff --git a/src/screens/Tabs/Me/List/menus.tsx b/src/screens/Tabs/Me/List/menus.tsx
index 223a56e1..7217cad2 100644
--- a/src/screens/Tabs/Me/List/menus.tsx
+++ b/src/screens/Tabs/Me/List/menus.tsx
@@ -32,7 +32,7 @@ export const menuListDelete = ({
key: 'list-delete',
onSelect: () =>
Alert.alert(
- i18next.t('screenTabs:me.listDelete.confirm.title', { list: params.title.slice(0, 6) }),
+ i18next.t('screenTabs:me.listDelete.confirm.title', { list: params.title.slice(0, 20) }),
i18next.t('screenTabs:me.listDelete.confirm.message'),
[
{
diff --git a/src/screens/Tabs/Shared/Account/Information.tsx b/src/screens/Tabs/Shared/Account/Information.tsx
index 82b47204..24651ac7 100644
--- a/src/screens/Tabs/Shared/Account/Information.tsx
+++ b/src/screens/Tabs/Shared/Account/Information.tsx
@@ -28,10 +28,7 @@ const AccountInformation = React.memo(
(
-
+
)}
>
@@ -41,7 +38,7 @@ const AccountInformation = React.memo(
-
+
diff --git a/src/screens/Tabs/Shared/Account/Information/Account.tsx b/src/screens/Tabs/Shared/Account/Information/Account.tsx
index e2062c58..e209e319 100644
--- a/src/screens/Tabs/Shared/Account/Information/Account.tsx
+++ b/src/screens/Tabs/Shared/Account/Information/Account.tsx
@@ -1,10 +1,7 @@
import Icon from '@components/Icon'
import CustomText from '@components/Text'
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
-import {
- getInstanceAccount,
- getInstanceUri
-} from '@utils/slices/instancesSlice'
+import { getInstanceAccount, getInstanceUri } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
@@ -15,19 +12,12 @@ import { PlaceholderLine } from 'rn-placeholder'
export interface Props {
account: Mastodon.Account | undefined
- localInstance: boolean
}
-const AccountInformationAccount: React.FC = ({
- account,
- localInstance
-}) => {
+const AccountInformationAccount: React.FC = ({ account }) => {
const { t } = useTranslation('screenTabs')
const { colors } = useTheme()
- const instanceAccount = useSelector(
- getInstanceAccount,
- (prev, next) => prev?.acct === next?.acct
- )
+ const instanceAccount = useSelector(getInstanceAccount, (prev, next) => prev?.acct === next?.acct)
const instanceUri = useSelector(getInstanceUri)
const { data: relationship } = useRelationshipQuery({
@@ -35,6 +25,10 @@ const AccountInformationAccount: React.FC = ({
options: { enabled: account !== undefined }
})
+ const localInstance = instanceAccount.acct.includes('@')
+ ? instanceAccount.acct.includes(`@${instanceUri}`)
+ : true
+
if (account || (localInstance && instanceAccount)) {
return (
= ({
) : null}
@@ -94,7 +88,4 @@ const AccountInformationAccount: React.FC = ({
}
}
-export default React.memo(
- AccountInformationAccount,
- (_, next) => next.account === undefined
-)
+export default AccountInformationAccount
diff --git a/src/screens/Tabs/Shared/Account/Information/Avatar.tsx b/src/screens/Tabs/Shared/Account/Information/Avatar.tsx
index 76003b07..956b9bda 100644
--- a/src/screens/Tabs/Shared/Account/Information/Avatar.tsx
+++ b/src/screens/Tabs/Shared/Account/Information/Avatar.tsx
@@ -3,9 +3,11 @@ import GracefullyImage from '@components/GracefullyImage'
import { useNavigation } from '@react-navigation/native'
import { StackNavigationProp } from '@react-navigation/stack'
import { TabLocalStackParamList } from '@utils/navigation/navigators'
+import { getInstanceActive } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import React from 'react'
-import { Pressable, StyleSheet, View } from 'react-native'
+import { Pressable, View } from 'react-native'
+import { useSelector } from 'react-redux'
export interface Props {
account: Mastodon.Account | undefined
@@ -13,24 +15,25 @@ export interface Props {
edit?: boolean
}
-const AccountInformationAvatar: React.FC = ({
- account,
- myInfo,
- edit
-}) => {
- const navigation =
- useNavigation>()
+const AccountInformationAvatar: React.FC = ({ account, myInfo, edit }) => {
+ const navigation = useNavigation>()
+ useSelector(getInstanceActive)
return (
{
myInfo && account && navigation.push('Tab-Shared-Account', { account })
}}
- style={styles.base}
+ style={{
+ borderRadius: 8,
+ overflow: 'hidden',
+ width: StyleConstants.Avatar.L,
+ height: StyleConstants.Avatar.L
+ }}
>
{edit ? (
@@ -51,14 +54,4 @@ const AccountInformationAvatar: React.FC = ({
)
}
-const styles = StyleSheet.create({
- base: {
- borderRadius: 8,
- overflow: 'hidden',
- width: StyleConstants.Avatar.L,
- height: StyleConstants.Avatar.L
- },
- image: { flex: 1 }
-})
-
export default AccountInformationAvatar
diff --git a/src/screens/Tabs/Shared/Account/Information/Created.tsx b/src/screens/Tabs/Shared/Account/Information/Created.tsx
index 5bf688d7..4d4852d8 100644
--- a/src/screens/Tabs/Shared/Account/Information/Created.tsx
+++ b/src/screens/Tabs/Shared/Account/Information/Created.tsx
@@ -12,59 +12,53 @@ export interface Props {
hidden?: boolean
}
-const AccountInformationCreated = React.memo(
- ({ account, hidden = false }: Props) => {
- if (hidden) {
- return null
- }
+const AccountInformationCreated: React.FC = ({ account, hidden = false }) => {
+ if (hidden) {
+ return null
+ }
- const { i18n } = useTranslation()
- const { colors } = useTheme()
- const { t } = useTranslation('screenTabs')
+ const { i18n } = useTranslation()
+ const { colors } = useTheme()
+ const { t } = useTranslation('screenTabs')
- if (account) {
- return (
-
-
-
- {t('shared.account.created_at', {
- date: new Date(account.created_at || '').toLocaleDateString(
- i18n.language,
- {
- year: 'numeric',
- month: 'long',
- day: 'numeric'
- }
- )
- })}
-
-
- )
- } else {
- return (
-
+
- )
- }
- },
- (_, next) => next.account === undefined
-)
+
+ {t('shared.account.created_at', {
+ date: new Date(account.created_at || '').toLocaleDateString(i18n.language, {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+ })
+ })}
+
+
+ )
+ } else {
+ return (
+
+ )
+ }
+}
export default AccountInformationCreated
diff --git a/src/screens/Tabs/Shared/Account/Information/Fields.tsx b/src/screens/Tabs/Shared/Account/Information/Fields.tsx
index db0b12e8..ea55aa9a 100644
--- a/src/screens/Tabs/Shared/Account/Information/Fields.tsx
+++ b/src/screens/Tabs/Shared/Account/Information/Fields.tsx
@@ -10,53 +10,50 @@ export interface Props {
myInfo?: boolean
}
-const AccountInformationFields = React.memo(
- ({ account, myInfo }: Props) => {
- if (account?.suspended || myInfo || !account?.fields || account.fields.length === 0) {
- return null
- }
+const AccountInformationFields: React.FC = ({ account, myInfo }) => {
+ if (account?.suspended || myInfo || !account?.fields || account.fields.length === 0) {
+ return null
+ }
- const { colors } = useTheme()
+ const { colors } = useTheme()
- return (
-
- {account.fields.map((field, index) => (
-
-
-
+ {account.fields.map((field, index) => (
+
+
+
+ {field.verified_at ? (
+
- {field.verified_at ? (
-
- ) : null}
-
-
-
-
+ ) : null}
- ))}
-
- )
- },
- (_, next) => next.account === undefined
-)
+
+
+
+
+ ))}
+
+ )
+}
const styles = StyleSheet.create({
fields: {
diff --git a/src/screens/Tabs/Shared/Account/Information/Name.tsx b/src/screens/Tabs/Shared/Account/Information/Name.tsx
index 9dd8005c..0b6b51ba 100644
--- a/src/screens/Tabs/Shared/Account/Information/Name.tsx
+++ b/src/screens/Tabs/Shared/Account/Information/Name.tsx
@@ -66,4 +66,4 @@ const AccountInformationName: React.FC = ({ account }) => {
)
}
-export default React.memo(AccountInformationName, (_, next) => next.account === undefined)
+export default AccountInformationName
diff --git a/src/screens/Tabs/Shared/Account/Information/Note.tsx b/src/screens/Tabs/Shared/Account/Information/Note.tsx
index b1f4eda8..35f507c5 100644
--- a/src/screens/Tabs/Shared/Account/Information/Note.tsx
+++ b/src/screens/Tabs/Shared/Account/Information/Note.tsx
@@ -1,45 +1,35 @@
import { ParseHTML } from '@components/Parse'
import { StyleConstants } from '@utils/styles/constants'
-import React, { useState } from 'react'
-import { StyleSheet, View } from 'react-native'
+import React from 'react'
+import { View } from 'react-native'
export interface Props {
account: Mastodon.Account | undefined
myInfo?: boolean
}
-const AccountInformationNote = React.memo(
- ({ account, myInfo }: Props) => {
- const [note, setNote] = useState(account?.source?.note)
- if (
- account?.suspended ||
- myInfo ||
- !account?.note ||
- account.note.length === 0 ||
- account.note === '
'
- ) {
- return null
- }
-
- return (
-
-
-
- )
- },
- (_, next) => next.account === undefined
-)
-
-const styles = StyleSheet.create({
- note: {
- marginBottom: StyleConstants.Spacing.L
+const AccountInformationNote: React.FC = ({ account, myInfo }) => {
+ if (
+ account?.suspended ||
+ myInfo ||
+ !account?.note ||
+ account.note.length === 0 ||
+ account.note === '
'
+ ) {
+ return null
}
-})
+
+ return (
+
+
+
+ )
+}
export default AccountInformationNote
diff --git a/src/screens/Tabs/Shared/AccountInLists.tsx b/src/screens/Tabs/Shared/AccountInLists.tsx
index 4e7d8041..f92a6c28 100644
--- a/src/screens/Tabs/Shared/AccountInLists.tsx
+++ b/src/screens/Tabs/Shared/AccountInLists.tsx
@@ -39,7 +39,7 @@ const TabSharedAccountInLists: React.FC<
})
}, [])
- const listsQuery = useListsQuery({})
+ const listsQuery = useListsQuery()
const accountInListsQuery = useAccountInListsQuery({ id: account.id })
const sections = [
@@ -48,8 +48,10 @@ const TabSharedAccountInLists: React.FC<
id: 'out',
title: t('shared.accountInLists.notInLists'),
data:
- listsQuery.data?.filter(
- ({ id }) => accountInListsQuery.data?.filter(d => d.id !== id).length
+ listsQuery.data?.filter(({ id }) =>
+ accountInListsQuery.data?.length
+ ? accountInListsQuery.data.filter(d => d.id !== id).length
+ : true
) || []
}
]
diff --git a/src/screens/Tabs/Shared/Search/index.tsx b/src/screens/Tabs/Shared/Search/index.tsx
index b080bea2..9c70098b 100644
--- a/src/screens/Tabs/Shared/Search/index.tsx
+++ b/src/screens/Tabs/Shared/Search/index.tsx
@@ -54,7 +54,11 @@ const TabSharedSearch: React.FC>
fontSize: StyleConstants.Font.Size.M,
flex: 1,
color: colors.primaryDefault,
- paddingLeft: StyleConstants.Spacing.XS
+ marginLeft: StyleConstants.Spacing.XS,
+ paddingLeft: StyleConstants.Spacing.XS,
+ paddingVertical: StyleConstants.Spacing.XS,
+ borderBottomColor: colors.border,
+ borderBottomWidth: 1
}}
autoFocus
onChangeText={debounce(