mirror of
https://github.com/tooot-app/app
synced 2025-02-16 11:50:45 +01:00
commit
ef6eec5351
@ -4,12 +4,19 @@
|
|||||||
|
|
||||||
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/tooot-app/app/build) ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/tooot-app/app/build/candidate?label=build%20candidate) ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/tooot-app/app/build/release?label=build%20release)
|
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/tooot-app/app/build) ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/tooot-app/app/build/candidate?label=build%20candidate) ![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/tooot-app/app/build/release?label=build%20release)
|
||||||
|
|
||||||
|
## Contribute to translation
|
||||||
|
|
||||||
|
Please **do not** create a pull request to update translation. tooot's translation is managed through [https://crowdin.tooot.app/](https://crowdin.tooot.app/) and Crowdin struggles to properly sync two ways. If there is a minor update and you do not want to register an account on Crowdin, please open an issue.
|
||||||
|
|
||||||
|
|
||||||
## Special thanks
|
## Special thanks
|
||||||
|
|
||||||
[@forenta](https://github.com/forenta) for German translation
|
[@forenta](https://github.com/forenta) for German translation
|
||||||
|
|
||||||
[@andrigamerita](https://github.com/andrigamerita) for Italian translation
|
[@andrigamerita](https://github.com/andrigamerita) for Italian translation
|
||||||
|
|
||||||
|
[@Hikaru](https://github.com/Hikali-47041) and [@la_la](https://mstdn.jp/@la_la_la) for Japanese translation
|
||||||
|
|
||||||
[@hellojaccc](https://github.com/hellojaccc) for Korean translation
|
[@hellojaccc](https://github.com/hellojaccc) for Korean translation
|
||||||
|
|
||||||
[@luizpicolo](https://github.com/luizpicolo) for Brazilian Portuguese
|
[@luizpicolo](https://github.com/luizpicolo) for Brazilian Portuguese
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
languages(['zh-Hans', 'vi', 'ko', 'en-US', 'de-DE'])
|
languages(['de-DE', 'en-US', 'it', 'ko', 'pt-BR', 'vi', 'zh-Hans'])
|
||||||
|
|
||||||
name({
|
name({
|
||||||
'default' => "tooot"
|
'default' => "tooot"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"versions": {
|
"versions": {
|
||||||
"major": 4,
|
"major": 4,
|
||||||
"minor": 3,
|
"minor": 3,
|
||||||
"patch": 0
|
"patch": 1
|
||||||
},
|
},
|
||||||
"description": "tooot app for Mastodon",
|
"description": "tooot app for Mastodon",
|
||||||
"author": "xmflsct <me@xmflsct.com>",
|
"author": "xmflsct <me@xmflsct.com>",
|
||||||
@ -86,6 +86,7 @@
|
|||||||
"react-native-language-detection": "^0.1.0",
|
"react-native-language-detection": "^0.1.0",
|
||||||
"react-native-pager-view": "^5.4.25",
|
"react-native-pager-view": "^5.4.25",
|
||||||
"react-native-reanimated": "^2.9.1",
|
"react-native-reanimated": "^2.9.1",
|
||||||
|
"react-native-reanimated-zoom": "^0.3.0",
|
||||||
"react-native-safe-area-context": "^4.3.1",
|
"react-native-safe-area-context": "^4.3.1",
|
||||||
"react-native-screens": "^3.16.0",
|
"react-native-screens": "^3.16.0",
|
||||||
"react-native-share-menu": "^6.0.0",
|
"react-native-share-menu": "^6.0.0",
|
||||||
|
@ -67,9 +67,7 @@ const GracefullyImage = ({
|
|||||||
const onLoad = () => {
|
const onLoad = () => {
|
||||||
setImageLoaded(true)
|
setImageLoaded(true)
|
||||||
if (setImageDimensions && source.uri) {
|
if (setImageDimensions && source.uri) {
|
||||||
Image.getSize(source.uri, (width, height) =>
|
Image.getSize(source.uri, (width, height) => setImageDimensions({ width, height }))
|
||||||
setImageDimensions({ width, height })
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onError = () => {
|
const onError = () => {
|
||||||
@ -81,22 +79,9 @@ const GracefullyImage = ({
|
|||||||
const blurhashView = useMemo(() => {
|
const blurhashView = useMemo(() => {
|
||||||
if (hidden || !imageLoaded) {
|
if (hidden || !imageLoaded) {
|
||||||
if (blurhash) {
|
if (blurhash) {
|
||||||
return (
|
return <Blurhash decodeAsync blurhash={blurhash} style={styles.placeholder} />
|
||||||
<Blurhash
|
|
||||||
decodeAsync
|
|
||||||
blurhash={blurhash}
|
|
||||||
style={styles.placeholder}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
return (
|
return <View style={[styles.placeholder, { backgroundColor: colors.shimmerDefault }]} />
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
styles.placeholder,
|
|
||||||
{ backgroundColor: colors.shimmerDefault }
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
@ -105,26 +90,17 @@ const GracefullyImage = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Pressable
|
<Pressable
|
||||||
{...(onPress
|
{...(onPress ? { accessibilityRole: 'imagebutton' } : { accessibilityRole: 'image' })}
|
||||||
? { accessibilityRole: 'imagebutton' }
|
|
||||||
: { accessibilityRole: 'image' })}
|
|
||||||
accessibilityLabel={accessibilityLabel}
|
accessibilityLabel={accessibilityLabel}
|
||||||
accessibilityHint={accessibilityHint}
|
accessibilityHint={accessibilityHint}
|
||||||
style={[style, dimension, { backgroundColor: colors.shimmerDefault }]}
|
style={[style, dimension, { backgroundColor: colors.shimmerDefault }]}
|
||||||
{...(onPress
|
{...(onPress ? (hidden ? { disabled: true } : { onPress }) : { disabled: true })}
|
||||||
? hidden
|
|
||||||
? { disabled: true }
|
|
||||||
: { onPress }
|
|
||||||
: { disabled: true })}
|
|
||||||
>
|
>
|
||||||
{uri.preview && !imageLoaded ? (
|
{uri.preview && !imageLoaded ? (
|
||||||
<Image
|
<Image
|
||||||
fadeDuration={0}
|
fadeDuration={0}
|
||||||
source={{ uri: uri.preview }}
|
source={{ uri: uri.preview }}
|
||||||
style={[
|
style={[styles.placeholder, { backgroundColor: colors.shimmerDefault }]}
|
||||||
styles.placeholder,
|
|
||||||
{ backgroundColor: colors.shimmerDefault }
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{Platform.OS === 'ios' ? (
|
{Platform.OS === 'ios' ? (
|
||||||
|
@ -11,7 +11,7 @@ import { RootStackParamList } from '@utils/navigation/navigators'
|
|||||||
import { getInstanceAccount } from '@utils/slices/instancesSlice'
|
import { getInstanceAccount } from '@utils/slices/instancesSlice'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import layoutAnimation from '@utils/styles/layoutAnimation'
|
import layoutAnimation from '@utils/styles/layoutAnimation'
|
||||||
import React, { useRef, useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Pressable, View } from 'react-native'
|
import { Pressable, View } from 'react-native'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
@ -27,8 +27,7 @@ const TimelineAttachment = React.memo(
|
|||||||
const account = useSelector(
|
const account = useSelector(
|
||||||
getInstanceAccount,
|
getInstanceAccount,
|
||||||
(prev, next) =>
|
(prev, next) =>
|
||||||
prev.preferences['reading:expand:media'] ===
|
prev.preferences['reading:expand:media'] === next.preferences['reading:expand:media']
|
||||||
next.preferences['reading:expand:media']
|
|
||||||
)
|
)
|
||||||
const defaultSensitive = () => {
|
const defaultSensitive = () => {
|
||||||
switch (account.preferences['reading:expand:media']) {
|
switch (account.preferences['reading:expand:media']) {
|
||||||
@ -42,15 +41,47 @@ const TimelineAttachment = React.memo(
|
|||||||
}
|
}
|
||||||
const [sensitiveShown, setSensitiveShown] = useState(defaultSensitive())
|
const [sensitiveShown, setSensitiveShown] = useState(defaultSensitive())
|
||||||
|
|
||||||
const imageUrls = useRef<
|
const imageUrls: RootStackParamList['Screen-ImagesViewer']['imageUrls'] =
|
||||||
RootStackParamList['Screen-ImagesViewer']['imageUrls']
|
status.media_attachments
|
||||||
>([])
|
.map(attachment => {
|
||||||
|
switch (attachment.type) {
|
||||||
|
case 'image':
|
||||||
|
return {
|
||||||
|
id: attachment.id,
|
||||||
|
preview_url: attachment.preview_url,
|
||||||
|
url: attachment.url,
|
||||||
|
remote_url: attachment.remote_url,
|
||||||
|
blurhash: attachment.blurhash,
|
||||||
|
width: attachment.meta?.original?.width,
|
||||||
|
height: attachment.meta?.original?.height
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if (
|
||||||
|
attachment.preview_url?.endsWith('.jpg') ||
|
||||||
|
attachment.preview_url?.endsWith('.jpeg') ||
|
||||||
|
attachment.preview_url?.endsWith('.png') ||
|
||||||
|
attachment.preview_url?.endsWith('.gif') ||
|
||||||
|
attachment.remote_url?.endsWith('.jpg') ||
|
||||||
|
attachment.remote_url?.endsWith('.jpeg') ||
|
||||||
|
attachment.remote_url?.endsWith('.png') ||
|
||||||
|
attachment.remote_url?.endsWith('.gif')
|
||||||
|
) {
|
||||||
|
return {
|
||||||
|
id: attachment.id,
|
||||||
|
preview_url: attachment.preview_url,
|
||||||
|
url: attachment.url,
|
||||||
|
remote_url: attachment.remote_url,
|
||||||
|
blurhash: attachment.blurhash,
|
||||||
|
width: attachment.meta?.original?.width,
|
||||||
|
height: attachment.meta?.original?.height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.filter(i => i)
|
||||||
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>()
|
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>()
|
||||||
const navigateToImagesViewer = (id: string) => {
|
const navigateToImagesViewer = (id: string) => {
|
||||||
navigation.navigate('Screen-ImagesViewer', {
|
navigation.navigate('Screen-ImagesViewer', { imageUrls, id })
|
||||||
imageUrls: imageUrls.current,
|
|
||||||
id
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -68,15 +99,6 @@ const TimelineAttachment = React.memo(
|
|||||||
{status.media_attachments.map((attachment, index) => {
|
{status.media_attachments.map((attachment, index) => {
|
||||||
switch (attachment.type) {
|
switch (attachment.type) {
|
||||||
case 'image':
|
case 'image':
|
||||||
imageUrls.current.push({
|
|
||||||
id: attachment.id,
|
|
||||||
preview_url: attachment.preview_url,
|
|
||||||
url: attachment.url,
|
|
||||||
remote_url: attachment.remote_url,
|
|
||||||
blurhash: attachment.blurhash,
|
|
||||||
width: attachment.meta?.original?.width,
|
|
||||||
height: attachment.meta?.original?.height
|
|
||||||
})
|
|
||||||
return (
|
return (
|
||||||
<AttachmentImage
|
<AttachmentImage
|
||||||
key={index}
|
key={index}
|
||||||
@ -129,15 +151,6 @@ const TimelineAttachment = React.memo(
|
|||||||
attachment.remote_url?.endsWith('.png') ||
|
attachment.remote_url?.endsWith('.png') ||
|
||||||
attachment.remote_url?.endsWith('.gif')
|
attachment.remote_url?.endsWith('.gif')
|
||||||
) {
|
) {
|
||||||
imageUrls.current.push({
|
|
||||||
id: attachment.id,
|
|
||||||
preview_url: attachment.preview_url,
|
|
||||||
url: attachment.url,
|
|
||||||
remote_url: attachment.remote_url,
|
|
||||||
blurhash: attachment.blurhash,
|
|
||||||
width: attachment.meta?.original?.width,
|
|
||||||
height: attachment.meta?.original?.height
|
|
||||||
})
|
|
||||||
return (
|
return (
|
||||||
<AttachmentImage
|
<AttachmentImage
|
||||||
key={index}
|
key={index}
|
||||||
@ -212,19 +225,13 @@ const TimelineAttachment = React.memo(
|
|||||||
(prev, next) => {
|
(prev, next) => {
|
||||||
let isEqual = true
|
let isEqual = true
|
||||||
|
|
||||||
if (
|
if (prev.status.media_attachments.length !== next.status.media_attachments.length) {
|
||||||
prev.status.media_attachments.length !==
|
|
||||||
next.status.media_attachments.length
|
|
||||||
) {
|
|
||||||
isEqual = false
|
isEqual = false
|
||||||
return isEqual
|
return isEqual
|
||||||
}
|
}
|
||||||
|
|
||||||
prev.status.media_attachments.forEach((attachment, index) => {
|
prev.status.media_attachments.forEach((attachment, index) => {
|
||||||
if (
|
if (attachment.preview_url !== next.status.media_attachments[index].preview_url) {
|
||||||
attachment.preview_url !==
|
|
||||||
next.status.media_attachments[index].preview_url
|
|
||||||
) {
|
|
||||||
isEqual = false
|
isEqual = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"title": "Benutzeraktionen",
|
"title": "Benutzeraktionen",
|
||||||
"mute": {
|
"mute": {
|
||||||
"action_false": "Profil stummschalten",
|
"action_false": "Profil stummschalten",
|
||||||
"action_true": ""
|
"action_true": "Stummschaltung Nutzers aufheben"
|
||||||
},
|
},
|
||||||
"block": {
|
"block": {
|
||||||
"action_false": "Nutzer blockieren",
|
"action_false": "Nutzer blockieren",
|
||||||
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"copy": {
|
"copy": {
|
||||||
"action": "",
|
"action": "",
|
||||||
"succeed": ""
|
"succeed": "Kopiert"
|
||||||
},
|
},
|
||||||
"instance": {
|
"instance": {
|
||||||
"title": "",
|
"title": "",
|
||||||
@ -65,7 +65,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mute": {
|
"mute": {
|
||||||
"action_false": "",
|
"action_false": "Diesen Tröt sowie die Antworten stummschalten",
|
||||||
"action_true": ""
|
"action_true": ""
|
||||||
},
|
},
|
||||||
"pin": {
|
"pin": {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"domains": "Universes"
|
"domains": "Universes"
|
||||||
},
|
},
|
||||||
"disclaimer": {
|
"disclaimer": {
|
||||||
"base": "Logging in process uses system broswer that, your account information won't be visible to tooot app."
|
"base": "Logging in process uses system browser that, your account information won't be visible to tooot app."
|
||||||
},
|
},
|
||||||
"terms": {
|
"terms": {
|
||||||
"base": "By logging in, you agree to the <0>privacy policy</0> and <1>terms of service</1>."
|
"base": "By logging in, you agree to the <0>privacy policy</0> and <1>terms of service</1>."
|
||||||
|
@ -4,6 +4,7 @@ import { initReactI18next } from 'react-i18next'
|
|||||||
import de from '@root/i18n/de/_all'
|
import de from '@root/i18n/de/_all'
|
||||||
import en from '@root/i18n/en/_all'
|
import en from '@root/i18n/en/_all'
|
||||||
import it from '@root/i18n/it/_all'
|
import it from '@root/i18n/it/_all'
|
||||||
|
import ja from '@root/i18n/ja/_all'
|
||||||
import ko from '@root/i18n/ko/_all'
|
import ko from '@root/i18n/ko/_all'
|
||||||
import pt_BR from '@root/i18n/pt_BR/_all'
|
import pt_BR from '@root/i18n/pt_BR/_all'
|
||||||
import vi from '@root/i18n/vi/_all'
|
import vi from '@root/i18n/vi/_all'
|
||||||
@ -16,6 +17,7 @@ import '@formatjs/intl-pluralrules/polyfill'
|
|||||||
import '@formatjs/intl-pluralrules/locale-data/de'
|
import '@formatjs/intl-pluralrules/locale-data/de'
|
||||||
import '@formatjs/intl-pluralrules/locale-data/en'
|
import '@formatjs/intl-pluralrules/locale-data/en'
|
||||||
import '@formatjs/intl-pluralrules/locale-data/it'
|
import '@formatjs/intl-pluralrules/locale-data/it'
|
||||||
|
import '@formatjs/intl-pluralrules/locale-data/ja'
|
||||||
import '@formatjs/intl-pluralrules/locale-data/ko'
|
import '@formatjs/intl-pluralrules/locale-data/ko'
|
||||||
import '@formatjs/intl-pluralrules/locale-data/pt'
|
import '@formatjs/intl-pluralrules/locale-data/pt'
|
||||||
import '@formatjs/intl-pluralrules/locale-data/vi'
|
import '@formatjs/intl-pluralrules/locale-data/vi'
|
||||||
@ -25,6 +27,7 @@ import '@formatjs/intl-numberformat/polyfill'
|
|||||||
import '@formatjs/intl-numberformat/locale-data/de'
|
import '@formatjs/intl-numberformat/locale-data/de'
|
||||||
import '@formatjs/intl-numberformat/locale-data/en'
|
import '@formatjs/intl-numberformat/locale-data/en'
|
||||||
import '@formatjs/intl-numberformat/locale-data/it'
|
import '@formatjs/intl-numberformat/locale-data/it'
|
||||||
|
import '@formatjs/intl-numberformat/locale-data/ja'
|
||||||
import '@formatjs/intl-numberformat/locale-data/ko'
|
import '@formatjs/intl-numberformat/locale-data/ko'
|
||||||
import '@formatjs/intl-numberformat/locale-data/pt'
|
import '@formatjs/intl-numberformat/locale-data/pt'
|
||||||
import '@formatjs/intl-numberformat/locale-data/vi'
|
import '@formatjs/intl-numberformat/locale-data/vi'
|
||||||
@ -34,6 +37,7 @@ import '@formatjs/intl-datetimeformat/polyfill'
|
|||||||
import '@formatjs/intl-datetimeformat/locale-data/de'
|
import '@formatjs/intl-datetimeformat/locale-data/de'
|
||||||
import '@formatjs/intl-datetimeformat/locale-data/en'
|
import '@formatjs/intl-datetimeformat/locale-data/en'
|
||||||
import '@formatjs/intl-datetimeformat/locale-data/it'
|
import '@formatjs/intl-datetimeformat/locale-data/it'
|
||||||
|
import '@formatjs/intl-datetimeformat/locale-data/ja'
|
||||||
import '@formatjs/intl-datetimeformat/locale-data/ko'
|
import '@formatjs/intl-datetimeformat/locale-data/ko'
|
||||||
import '@formatjs/intl-datetimeformat/locale-data/pt'
|
import '@formatjs/intl-datetimeformat/locale-data/pt'
|
||||||
import '@formatjs/intl-datetimeformat/locale-data/vi'
|
import '@formatjs/intl-datetimeformat/locale-data/vi'
|
||||||
@ -44,6 +48,7 @@ import '@formatjs/intl-relativetimeformat/polyfill'
|
|||||||
import '@formatjs/intl-relativetimeformat/locale-data/de'
|
import '@formatjs/intl-relativetimeformat/locale-data/de'
|
||||||
import '@formatjs/intl-relativetimeformat/locale-data/en'
|
import '@formatjs/intl-relativetimeformat/locale-data/en'
|
||||||
import '@formatjs/intl-relativetimeformat/locale-data/it'
|
import '@formatjs/intl-relativetimeformat/locale-data/it'
|
||||||
|
import '@formatjs/intl-relativetimeformat/locale-data/ja'
|
||||||
import '@formatjs/intl-relativetimeformat/locale-data/ko'
|
import '@formatjs/intl-relativetimeformat/locale-data/ko'
|
||||||
import '@formatjs/intl-relativetimeformat/locale-data/pt'
|
import '@formatjs/intl-relativetimeformat/locale-data/pt'
|
||||||
import '@formatjs/intl-relativetimeformat/locale-data/vi'
|
import '@formatjs/intl-relativetimeformat/locale-data/vi'
|
||||||
@ -56,7 +61,7 @@ i18n.use(initReactI18next).init({
|
|||||||
ns: ['common'],
|
ns: ['common'],
|
||||||
defaultNS: 'common',
|
defaultNS: 'common',
|
||||||
|
|
||||||
resources: { 'zh-Hans': zh_Hans, vi, 'pt-BR': pt_BR, ko, it, en, de },
|
resources: { de, en, it, ja, ko, 'pt-BR': pt_BR, vi, 'zh-Hans': zh_Hans },
|
||||||
returnEmptyString: false,
|
returnEmptyString: false,
|
||||||
|
|
||||||
saveMissing: true,
|
saveMissing: true,
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"copy": {
|
"copy": {
|
||||||
"action": "",
|
"action": "",
|
||||||
"succeed": ""
|
"succeed": "Copiato"
|
||||||
},
|
},
|
||||||
"instance": {
|
"instance": {
|
||||||
"title": "Azione sull'istanza",
|
"title": "Azione sull'istanza",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"heading": "",
|
"heading": "Condividi con...",
|
||||||
"content": {
|
"content": {
|
||||||
"select_account": ""
|
"select_account": "Seleziona conto"
|
||||||
}
|
}
|
||||||
}
|
}
|
18
src/i18n/ja/_all.ts
Normal file
18
src/i18n/ja/_all.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
export default {
|
||||||
|
common: require('./common'),
|
||||||
|
|
||||||
|
screens: require('./screens'),
|
||||||
|
screenActions: require('./screens/actions'),
|
||||||
|
screenAnnouncements: require('./screens/announcements'),
|
||||||
|
screenCompose: require('./screens/compose'),
|
||||||
|
screenImageViewer: require('./screens/imageViewer'),
|
||||||
|
screenTabs: require('./screens/tabs'),
|
||||||
|
|
||||||
|
componentContextMenu: require('./components/contextMenu'),
|
||||||
|
componentEmojis: require('./components/emojis'),
|
||||||
|
componentInstance: require('./components/instance'),
|
||||||
|
componentMediaSelector: require('./components/mediaSelector'),
|
||||||
|
componentParse: require('./components/parse'),
|
||||||
|
componentRelationship: require('./components/relationship'),
|
||||||
|
componentTimeline: require('./components/timeline')
|
||||||
|
}
|
@ -1,22 +1,22 @@
|
|||||||
{
|
{
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"OK": "",
|
"OK": "はい",
|
||||||
"apply": "",
|
"apply": "適用",
|
||||||
"cancel": ""
|
"cancel": "キャンセル"
|
||||||
},
|
},
|
||||||
"customEmoji": {
|
"customEmoji": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "カスタム絵文字 {{emoji}}"
|
||||||
},
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"success": {
|
"success": {
|
||||||
"message": ""
|
"message": "{{function}} が成功しました"
|
||||||
},
|
},
|
||||||
"warning": {
|
"warning": {
|
||||||
"message": ""
|
"message": ""
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"message": ""
|
"message": "{{function}} 接続に失敗しました。再試行してください。"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"separator": ""
|
"separator": ", "
|
||||||
}
|
}
|
@ -1,76 +1,76 @@
|
|||||||
{
|
{
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "このトゥートへのアクション、投稿されたユーザー、トゥート自体など",
|
||||||
"account": {
|
"account": {
|
||||||
"title": "",
|
"title": "ユーザーアクション",
|
||||||
"mute": {
|
"mute": {
|
||||||
"action_false": "",
|
"action_false": "ユーザーをミュート",
|
||||||
"action_true": ""
|
"action_true": "ユーザーのミュートを解除"
|
||||||
},
|
},
|
||||||
"block": {
|
"block": {
|
||||||
"action_false": "",
|
"action_false": "ユーザーをブロック",
|
||||||
"action_true": ""
|
"action_true": "ユーザーのブロックを解除"
|
||||||
},
|
},
|
||||||
"reports": {
|
"reports": {
|
||||||
"action": ""
|
"action": "ユーザーを報告"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"copy": {
|
"copy": {
|
||||||
"action": "",
|
"action": "トゥートをコピー",
|
||||||
"succeed": ""
|
"succeed": "コピー完了"
|
||||||
},
|
},
|
||||||
"instance": {
|
"instance": {
|
||||||
"title": "",
|
"title": "インスタンスアクション",
|
||||||
"block": {
|
"block": {
|
||||||
"action": "",
|
"action": "インスタンスをブロック {{instance}}",
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "インスタンス {{instance}} をブロックしますか?",
|
||||||
"message": "",
|
"message": "ほとんどの場合、特定のユーザーをミュートまたはブロックすることができます。\n\nインスタンスをブロックすると、このインスタンスからフォロワーを含むすべてのコンテンツが削除されます!",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"confirm": ""
|
"confirm": "確定"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"share": {
|
"share": {
|
||||||
"status": {
|
"status": {
|
||||||
"action": ""
|
"action": "トゥートを共有"
|
||||||
},
|
},
|
||||||
"account": {
|
"account": {
|
||||||
"action": ""
|
"action": "ユーザーを共有"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"title": "",
|
"title": "トゥートのアクション",
|
||||||
"edit": {
|
"edit": {
|
||||||
"action": ""
|
"action": "トゥートを編集"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"action": "",
|
"action": "トゥートを削除",
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "削除しますか?",
|
||||||
"message": "",
|
"message": "この投稿へのすべてのお気に入り登録やブーストは消去され、すべての返信は孤立することになります。",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"confirm": ""
|
"confirm": "確定"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deleteEdit": {
|
"deleteEdit": {
|
||||||
"action": "",
|
"action": "トゥートを削除し、再投稿する",
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "削除して再投稿しますか?",
|
||||||
"message": "",
|
"message": "この投稿へのすべてのお気に入り登録やブーストは消去され、すべての返信は孤立することになります。",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"confirm": ""
|
"confirm": "確定"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mute": {
|
"mute": {
|
||||||
"action_false": "",
|
"action_false": "トゥートと返信をミュート",
|
||||||
"action_true": ""
|
"action_true": "トゥートと返信のミュートを解除"
|
||||||
},
|
},
|
||||||
"pin": {
|
"pin": {
|
||||||
"action_false": "",
|
"action_false": "トゥートを固定",
|
||||||
"action_true": ""
|
"action_true": "トゥートの固定を解除"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1 +1,3 @@
|
|||||||
{}
|
{
|
||||||
|
"frequentUsed": "よく使う絵文字"
|
||||||
|
}
|
@ -1,29 +1,29 @@
|
|||||||
{
|
{
|
||||||
"server": {
|
"server": {
|
||||||
"textInput": {
|
"textInput": {
|
||||||
"placeholder": ""
|
"placeholder": "インスタンスのドメイン"
|
||||||
},
|
},
|
||||||
"button": "",
|
"button": "ログイン",
|
||||||
"information": {
|
"information": {
|
||||||
"name": "",
|
"name": "名前",
|
||||||
"accounts": "",
|
"accounts": "ユーザー",
|
||||||
"statuses": "",
|
"statuses": "トゥート",
|
||||||
"domains": ""
|
"domains": "接続連合数"
|
||||||
},
|
},
|
||||||
"disclaimer": {
|
"disclaimer": {
|
||||||
"base": ""
|
"base": "ログインにはシステムのブラウザを使用するため、あなたのアカウント情報は tooot アプリには表示されません。"
|
||||||
},
|
},
|
||||||
"terms": {
|
"terms": {
|
||||||
"base": ""
|
"base": "ログインすることで、 tooot の <0>プライバシーポリシー</0> および <1>利用規約</1> に同意したことになります。"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"update": {
|
"update": {
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "このインスタンスにログインしました",
|
||||||
"message": "",
|
"message": "既存のアカウントにログインしたまま、他のアカウントにログインできます",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"cancel": "",
|
"cancel": "$t(common:buttons.cancel)",
|
||||||
"continue": ""
|
"continue": "続行"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"title": "",
|
"title": "メディアソースを選択",
|
||||||
"options": {
|
"options": {
|
||||||
"image": "",
|
"image": "写真をアップロード",
|
||||||
"image_max": "",
|
"image_max": "写真をアップロード (最大{{max}}枚)",
|
||||||
"video": "",
|
"video": "動画をアップロード",
|
||||||
"video_max": ""
|
"video_max": "動画をアップロード (最大{{max}}本)"
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "権限がありません",
|
||||||
"message": "",
|
"message": "アップロードするにはフォトライブラリの読み取り許可が必要です",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"settings": ""
|
"settings": "設定を更新する"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"HTML": {
|
"HTML": {
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "タップして内容を展開または折りたたむ",
|
||||||
"expanded": "{{hint}}{{totalLines}}",
|
"expanded": "{{hint}}{{totalLines}}",
|
||||||
"totalLines": "",
|
"totalLines": " ({{count}} 行)",
|
||||||
"defaultHint": ""
|
"defaultHint": "長いトゥート"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"follow": {
|
"follow": {
|
||||||
"function": ""
|
"function": "ユーザーをフォロー"
|
||||||
},
|
},
|
||||||
"block": {
|
"block": {
|
||||||
"function": ""
|
"function": "ユーザーをブロック"
|
||||||
},
|
},
|
||||||
"button": {
|
"button": {
|
||||||
"error": "",
|
"error": "読み込みエラー",
|
||||||
"blocked_by": "",
|
"blocked_by": "ユーザーによってブロック",
|
||||||
"blocking": "",
|
"blocking": "ブロックを解除",
|
||||||
"following": "",
|
"following": "フォローをやめる",
|
||||||
"requested": "",
|
"requested": "リクエストを削除",
|
||||||
"default": ""
|
"default": "フォロー"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,145 +1,145 @@
|
|||||||
{
|
{
|
||||||
"empty": {
|
"empty": {
|
||||||
"error": {
|
"error": {
|
||||||
"message": "",
|
"message": "読み込みエラー",
|
||||||
"button": ""
|
"button": "再試行"
|
||||||
},
|
},
|
||||||
"success": {
|
"success": {
|
||||||
"message": ""
|
"message": "表示するものがありません"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
"message": ""
|
"message": "スレッドの末端です。コーヒーはいかがですか <0 />"
|
||||||
},
|
},
|
||||||
"lookback": {
|
"lookback": {
|
||||||
"message": ""
|
"message": "最終閲覧"
|
||||||
},
|
},
|
||||||
"refresh": {
|
"refresh": {
|
||||||
"fetchPreviousPage": "",
|
"fetchPreviousPage": "前のページを取得",
|
||||||
"refetch": ""
|
"refetch": "更新"
|
||||||
},
|
},
|
||||||
"shared": {
|
"shared": {
|
||||||
"actioned": {
|
"actioned": {
|
||||||
"pinned": "",
|
"pinned": "固定された投稿",
|
||||||
"favourite": "",
|
"favourite": "{name}さんがあなたのトゥートをお気に入りに登録しました",
|
||||||
"status": "",
|
"status": "{name}さんが投稿しました",
|
||||||
"follow": "",
|
"follow": "{name}さんにフォローされました",
|
||||||
"follow_request": "",
|
"follow_request": "{{name}}さんがフォローをリクエストしました",
|
||||||
"poll": "",
|
"poll": "アンケートが終了しました",
|
||||||
"reblog": {
|
"reblog": {
|
||||||
"default": "",
|
"default": "{name}さんがブースト",
|
||||||
"notification": ""
|
"notification": "{name}さんがあなたのトゥートをブーストしました"
|
||||||
},
|
},
|
||||||
"update": ""
|
"update": "ブーストしたトゥートが編集されました"
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"reply": {
|
"reply": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "このトゥートに返信"
|
||||||
},
|
},
|
||||||
"reblogged": {
|
"reblogged": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "このトゥートをブーストしますか?",
|
||||||
"function": ""
|
"function": "トゥートをブースト"
|
||||||
},
|
},
|
||||||
"favourited": {
|
"favourited": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "このトゥートをお気に入りに追加",
|
||||||
"function": ""
|
"function": "お気に入りトゥート"
|
||||||
},
|
},
|
||||||
"bookmarked": {
|
"bookmarked": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "このトゥートをブックマークに追加",
|
||||||
"function": ""
|
"function": "ブックマークトゥート"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"actionsUsers": {
|
"actionsUsers": {
|
||||||
"reblogged_by": {
|
"reblogged_by": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "{{count}}人がこのトゥートをブーストしました",
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "タップしてユーザーを確認",
|
||||||
"text": ""
|
"text": "$t(screenTabs:shared.users.statuses.reblogged_by)"
|
||||||
},
|
},
|
||||||
"favourited_by": {
|
"favourited_by": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "{{count}}人がこのトゥートをお気に入りしました",
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "タップしてユーザーを確認",
|
||||||
"text": ""
|
"text": "$t(screenTabs:shared.users.statuses.favourited_by)"
|
||||||
},
|
},
|
||||||
"history": {
|
"history": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "このトゥートは{{count}}回編集されました",
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "タップして全編集履歴を表示",
|
||||||
"text_one": "",
|
"text_one": "{{count}}回 編集",
|
||||||
"text_other": ""
|
"text_other": "{{count}}回 編集"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"attachment": {
|
"attachment": {
|
||||||
"sensitive": {
|
"sensitive": {
|
||||||
"button": ""
|
"button": "閲覧注意のメディアを表示"
|
||||||
},
|
},
|
||||||
"unsupported": {
|
"unsupported": {
|
||||||
"text": "",
|
"text": "読み込みエラー",
|
||||||
"button": ""
|
"button": "リモートリンクを試す"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"avatar": {
|
"avatar": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "{{name}}のアバター",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "{{name}}のページに移動するにはタップしてください"
|
||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
"expandHint": ""
|
"expandHint": "内容を非表示にする"
|
||||||
},
|
},
|
||||||
"filtered": "",
|
"filtered": "フィルター済み",
|
||||||
"fullConversation": "",
|
"fullConversation": "スレッドを読む",
|
||||||
"translate": {
|
"translate": {
|
||||||
"default": "",
|
"default": "翻訳",
|
||||||
"succeed": "",
|
"succeed": "{{provider}} によって {{source}} から翻訳されました",
|
||||||
"failed": "",
|
"failed": "翻訳できませんでした",
|
||||||
"source_not_supported": "",
|
"source_not_supported": "サポートされていない言語のトゥートです",
|
||||||
"target_not_supported": ""
|
"target_not_supported": "ターゲットの言語の翻訳はサポートされてません"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"shared": {
|
"shared": {
|
||||||
"account": {
|
"account": {
|
||||||
"name": {
|
"name": {
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "ユーザーの表示名"
|
||||||
},
|
},
|
||||||
"account": {
|
"account": {
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "ユーザーのアカウント名"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"application": "",
|
"application": "{{application}}",
|
||||||
"edited": {
|
"edited": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "トゥートが編集されました"
|
||||||
},
|
},
|
||||||
"muted": {
|
"muted": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "トゥートがミュートされました"
|
||||||
},
|
},
|
||||||
"visibility": {
|
"visibility": {
|
||||||
"direct": {
|
"direct": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "トゥートはダイレクトメッセージです"
|
||||||
},
|
},
|
||||||
"private": {
|
"private": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "トゥートはフォロワーのみに公開されます"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"conversation": {
|
"conversation": {
|
||||||
"withAccounts": "",
|
"withAccounts": "@ ",
|
||||||
"delete": {
|
"delete": {
|
||||||
"function": ""
|
"function": "ダイレクトメッセージを削除"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"poll": {
|
"poll": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"button": {
|
"button": {
|
||||||
"vote": "",
|
"vote": "回答",
|
||||||
"refresh": ""
|
"refresh": "再読み込み"
|
||||||
},
|
},
|
||||||
"count": {
|
"count": {
|
||||||
"voters_one": "",
|
"voters_one": "{{count}} 人が投票",
|
||||||
"voters_other": "",
|
"voters_other": "{{count}} 人が投票",
|
||||||
"votes_one": "",
|
"votes_one": "{{count}} 票",
|
||||||
"votes_other": ""
|
"votes_other": "{{count}} 票"
|
||||||
},
|
},
|
||||||
"expiration": {
|
"expiration": {
|
||||||
"expired": "",
|
"expired": "終了",
|
||||||
"until": ""
|
"until": "終了 <0 />"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"screenshot": {
|
"screenshot": {
|
||||||
"title": "",
|
"title": "プライバシー保護",
|
||||||
"message": "",
|
"message": "ユーザー名やアバターなど、他のユーザーを特定する情報は公開しないでください。",
|
||||||
"button": ""
|
"button": "確定"
|
||||||
},
|
},
|
||||||
"localCorrupt": {
|
"localCorrupt": {
|
||||||
"message": ""
|
"message": "ログイン期限が切れました。もう一度ログインしてください。"
|
||||||
},
|
},
|
||||||
"pushError": {
|
"pushError": {
|
||||||
"message": "",
|
"message": "プッシュサービスのエラー",
|
||||||
"description": ""
|
"description": "設定でプッシュ通知を再度有効にしてください"
|
||||||
},
|
},
|
||||||
"shareError": {
|
"shareError": {
|
||||||
"imageNotSupported": "",
|
"imageNotSupported": "画像ファイル形式 {{type}} はサポートされていません",
|
||||||
"videoNotSupported": ""
|
"videoNotSupported": "動画ファイル形式 {{type}} はサポートされていません"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"heading": "",
|
"heading": "共有先",
|
||||||
"content": {
|
"content": {
|
||||||
"select_account": ""
|
"select_account": "アカウントを選択"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"content": {
|
"content": {
|
||||||
"altText": {
|
"altText": {
|
||||||
"heading": ""
|
"heading": "代替テキスト"
|
||||||
},
|
},
|
||||||
"notificationsFilter": {
|
"notificationsFilter": {
|
||||||
"heading": "",
|
"heading": "通知の種類を表示",
|
||||||
"content": {
|
"content": {
|
||||||
"follow": "",
|
"follow": "$t(screenTabs:me.push.follow.heading)",
|
||||||
"follow_request": "",
|
"follow_request": "フォローリクエスト",
|
||||||
"favourite": "",
|
"favourite": "$t(screenTabs:me.push.favourite.heading)",
|
||||||
"reblog": "",
|
"reblog": "$t(screenTabs:me.push.reblog.heading)",
|
||||||
"mention": "",
|
"mention": "$t(screenTabs:me.push.mention.heading)",
|
||||||
"poll": "",
|
"poll": "$t(screenTabs:me.push.poll.heading)",
|
||||||
"status": "",
|
"status": "購読中のユーザーからのトゥート",
|
||||||
"update": ""
|
"update": "リブログが編集されました"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"heading": "",
|
"heading": "お知らせ",
|
||||||
"content": {
|
"content": {
|
||||||
"published": "",
|
"published": "公開 <0 />",
|
||||||
"button": {
|
"button": {
|
||||||
"read": "",
|
"read": "既読",
|
||||||
"unread": ""
|
"unread": "既読にする"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"heading": {
|
"heading": {
|
||||||
"left": {
|
"left": {
|
||||||
"button": "",
|
"button": "キャンセル",
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "編集をキャンセルしますか?",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"save": "",
|
"save": "下書きを保存",
|
||||||
"delete": "",
|
"delete": "下書きを削除",
|
||||||
"cancel": ""
|
"cancel": "キャンセル"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"right": {
|
"right": {
|
||||||
"button": {
|
"button": {
|
||||||
"default": "",
|
"default": "トゥート",
|
||||||
"conversation": "",
|
"conversation": "DMをトゥート",
|
||||||
"reply": "",
|
"reply": "トゥートに返信",
|
||||||
"deleteEdit": "",
|
"deleteEdit": "トゥート",
|
||||||
"edit": "",
|
"edit": "トゥート",
|
||||||
"share": ""
|
"share": "トゥート"
|
||||||
},
|
},
|
||||||
"alert": {
|
"alert": {
|
||||||
"default": {
|
"default": {
|
||||||
"title": "",
|
"title": "トゥートに失敗しました",
|
||||||
"button": ""
|
"button": "もう一度やり直す"
|
||||||
},
|
},
|
||||||
"removeReply": {
|
"removeReply": {
|
||||||
"title": "",
|
"title": "返信されたトゥートが見つかりませんでした",
|
||||||
"description": "",
|
"description": "返信されたトゥートが削除された可能性があります。参照から削除しますか?",
|
||||||
"cancel": "",
|
"cancel": "$t(common:buttons.cancel)",
|
||||||
"confirm": ""
|
"confirm": "参照を削除"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,143 +37,143 @@
|
|||||||
"content": {
|
"content": {
|
||||||
"root": {
|
"root": {
|
||||||
"header": {
|
"header": {
|
||||||
"postingAs": "",
|
"postingAs": "@{{acct}}@{{domain}} としてトゥート",
|
||||||
"spoilerInput": {
|
"spoilerInput": {
|
||||||
"placeholder": ""
|
"placeholder": "注意書き"
|
||||||
},
|
},
|
||||||
"textInput": {
|
"textInput": {
|
||||||
"placeholder": "",
|
"placeholder": "今なにかんがえてるの?",
|
||||||
"keyboardImage": {
|
"keyboardImage": {
|
||||||
"exceedMaximum": {
|
"exceedMaximum": {
|
||||||
"title": "",
|
"title": "アップロードできるメディアの数の上限に達しました",
|
||||||
"OK": ""
|
"OK": "$t(common:buttons.OK)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"footer": {
|
"footer": {
|
||||||
"attachments": {
|
"attachments": {
|
||||||
"sensitive": "",
|
"sensitive": "メディアを閲覧注意にする",
|
||||||
"remove": {
|
"remove": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "{{attachment}} のメディアを削除する"
|
||||||
},
|
},
|
||||||
"edit": {
|
"edit": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "{{attachment}} のメディアを編集する"
|
||||||
},
|
},
|
||||||
"upload": {
|
"upload": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "アップロードするメディアを追加する"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"emojis": {
|
"emojis": {
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "タップして絵文字を追加"
|
||||||
},
|
},
|
||||||
"poll": {
|
"poll": {
|
||||||
"option": {
|
"option": {
|
||||||
"placeholder": {
|
"placeholder": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "投票オプション {{index}}",
|
||||||
"single": "",
|
"single": "単一選択項目",
|
||||||
"multiple": ""
|
"multiple": "複数選択項目"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quantity": {
|
"quantity": {
|
||||||
"reduce": {
|
"reduce": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "投票の選択肢を {{amount}} に減らす",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "最小の投票数 {{amount}} に到達しました"
|
||||||
},
|
},
|
||||||
"increase": {
|
"increase": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "投票の選択肢を {{amount}} に増やす",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "最大の投票数 {{amount}} に到達しました"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"multiple": {
|
"multiple": {
|
||||||
"heading": "",
|
"heading": "投票タイプ",
|
||||||
"options": {
|
"options": {
|
||||||
"single": "",
|
"single": "単一選択式",
|
||||||
"multiple": "",
|
"multiple": "複数選択式",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expiration": {
|
"expiration": {
|
||||||
"heading": "",
|
"heading": "終了時間",
|
||||||
"options": {
|
"options": {
|
||||||
"300": "",
|
"300": "5分",
|
||||||
"1800": "",
|
"1800": "30分",
|
||||||
"3600": "",
|
"3600": "1時間",
|
||||||
"21600": "",
|
"21600": "6時間",
|
||||||
"86400": "",
|
"86400": "1日",
|
||||||
"259200": "",
|
"259200": "3日",
|
||||||
"604800": "",
|
"604800": "7日",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"attachment": {
|
"attachment": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "メディアをアップロード",
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "メディアをアップロードした場合、投票機能は無効化されます",
|
||||||
"failed": {
|
"failed": {
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "アップロードに失敗",
|
||||||
"button": ""
|
"button": "再試行"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"poll": {
|
"poll": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "投票を追加",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "投票がアクティブな場合、メディアのアップロードは無効化されます"
|
||||||
},
|
},
|
||||||
"visibility": {
|
"visibility": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "公開範囲は {{visibility}} です",
|
||||||
"title": "",
|
"title": "公開範囲",
|
||||||
"options": {
|
"options": {
|
||||||
"public": "",
|
"public": "公開",
|
||||||
"unlisted": "",
|
"unlisted": "未収載",
|
||||||
"private": "",
|
"private": "フォロワー限定",
|
||||||
"direct": "",
|
"direct": "ダイレクトメッセージ",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spoiler": {
|
"spoiler": {
|
||||||
"accessibilityLabel": ""
|
"accessibilityLabel": "スポイラーの設定"
|
||||||
},
|
},
|
||||||
"emoji": {
|
"emoji": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "絵文字を追加",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "絵文字選択パネルを開き、横にスワイプしてページを変更します"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drafts_one": "",
|
"drafts_one": "下書き ({{count}})",
|
||||||
"drafts_other": ""
|
"drafts_other": "下書き ({{count}})"
|
||||||
},
|
},
|
||||||
"editAttachment": {
|
"editAttachment": {
|
||||||
"header": {
|
"header": {
|
||||||
"title": "",
|
"title": "メディアを編集",
|
||||||
"right": {
|
"right": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "メディアの編集を保存",
|
||||||
"failed": {
|
"failed": {
|
||||||
"title": "",
|
"title": "編集に失敗",
|
||||||
"button": ""
|
"button": "再試行"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"content": {
|
"content": {
|
||||||
"altText": {
|
"altText": {
|
||||||
"heading": "",
|
"heading": "閲覧が難しいユーザーへの説明",
|
||||||
"placeholder": ""
|
"placeholder": "目の不自由な人や視覚障がいを持つ人を含むより多くの人がメディアにアクセスできるようになる、代替テキスト(alt-text)とも呼ばれる説明をメディアに追加することができます。\n\n簡潔でありながらも、メディアの文脈を正確に理解できるような表現が良い説明です。"
|
||||||
},
|
},
|
||||||
"imageFocus": ""
|
"imageFocus": "円形の枠をドラッグしてサムネイルの焦点にしたい場所を更新します"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"draftsList": {
|
"draftsList": {
|
||||||
"header": {
|
"header": {
|
||||||
"title": ""
|
"title": "下書き"
|
||||||
},
|
},
|
||||||
"warning": "",
|
"warning": "下書きは端末内のみに保存されます。下書きが不幸な出来事によって失われる可能性があります。そのため下書きを長期保存のために使用しないことを推奨します。",
|
||||||
"content": {
|
"content": {
|
||||||
"accessibilityHint": "",
|
"accessibilityHint": "下書きを保存しました。タップしてこの下書きを編集します",
|
||||||
"textEmpty": ""
|
"textEmpty": "コンテンツが空です"
|
||||||
},
|
},
|
||||||
"checkAttachment": ""
|
"checkAttachment": "サーバー上にあるメディアを確認しています…"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"content": {
|
"content": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "この画像に対するほかのアクション",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "この画像を保存または共有できます"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"save": "",
|
"save": "画像を保存",
|
||||||
"share": "",
|
"share": "画像を共有",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
},
|
},
|
||||||
"save": {
|
"save": {
|
||||||
"succeed": "",
|
"succeed": "画像を保存しました",
|
||||||
"failed": ""
|
"failed": "画像の保存に失敗しました"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,353 +1,353 @@
|
|||||||
{
|
{
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"local": {
|
"local": {
|
||||||
"name": ""
|
"name": "ホーム"
|
||||||
},
|
},
|
||||||
"public": {
|
"public": {
|
||||||
"name": "",
|
"name": "",
|
||||||
"segments": {
|
"segments": {
|
||||||
"left": "",
|
"left": "連合",
|
||||||
"right": ""
|
"right": "ローカル"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"name": ""
|
"name": "通知"
|
||||||
},
|
},
|
||||||
"me": {
|
"me": {
|
||||||
"name": ""
|
"name": "私について"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"search": {
|
"search": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "検索",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "ハッシュタグ、ユーザー、トゥートを検索"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"filter": {
|
"filter": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "フィルター",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "表示される通知の種類をフィルターする"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"me": {
|
"me": {
|
||||||
"stacks": {
|
"stacks": {
|
||||||
"bookmarks": {
|
"bookmarks": {
|
||||||
"name": ""
|
"name": "ブックマーク"
|
||||||
},
|
},
|
||||||
"conversations": {
|
"conversations": {
|
||||||
"name": ""
|
"name": "ダイレクトメッセージ"
|
||||||
},
|
},
|
||||||
"favourites": {
|
"favourites": {
|
||||||
"name": ""
|
"name": "お気に入り"
|
||||||
},
|
},
|
||||||
"fontSize": {
|
"fontSize": {
|
||||||
"name": ""
|
"name": "トゥートのフォントサイズ"
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"name": ""
|
"name": "言語"
|
||||||
},
|
},
|
||||||
"lists": {
|
"lists": {
|
||||||
"name": ""
|
"name": "リスト"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"name": ""
|
"name": "リスト: {{list}}"
|
||||||
},
|
},
|
||||||
"push": {
|
"push": {
|
||||||
"name": ""
|
"name": "プッシュ通知"
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
"name": ""
|
"name": "プロフィールを編集"
|
||||||
},
|
},
|
||||||
"profileName": {
|
"profileName": {
|
||||||
"name": ""
|
"name": "表示名を編集"
|
||||||
},
|
},
|
||||||
"profileNote": {
|
"profileNote": {
|
||||||
"name": ""
|
"name": "説明文を編集"
|
||||||
},
|
},
|
||||||
"profileFields": {
|
"profileFields": {
|
||||||
"name": ""
|
"name": "プロフィール補足情報を編集"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"name": ""
|
"name": "アプリの設定"
|
||||||
},
|
},
|
||||||
"webSettings": {
|
"webSettings": {
|
||||||
"name": ""
|
"name": "アカウントの設定"
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
"name": ""
|
"name": "アカウントを切り替える"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fontSize": {
|
"fontSize": {
|
||||||
"demo": "",
|
"demo": "<p>これはトゥートの例です。😊 フォントサイズを以下の選択肢から選択できます。<br /><br />この設定はトゥートのメインコンテンツにのみ影響し、他のフォントサイズには影響しません。</p>",
|
||||||
"sizes": {
|
"sizes": {
|
||||||
"S": "",
|
"S": "小",
|
||||||
"M": "",
|
"M": "中 (デフォルト)",
|
||||||
"L": "",
|
"L": "大",
|
||||||
"XL": "",
|
"XL": "特大",
|
||||||
"XXL": ""
|
"XXL": "最大"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
"cancellation": {
|
"cancellation": {
|
||||||
"title": "",
|
"title": "変更を破棄",
|
||||||
"message": "",
|
"message": "変更は保存されていません。変更の保存を破棄しますか?",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"cancel": "",
|
"cancel": "$t(common:buttons.cancel)",
|
||||||
"discard": ""
|
"discard": "破棄"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"feedback": {
|
"feedback": {
|
||||||
"succeed": "",
|
"succeed": "{{type}} がアップデートされました",
|
||||||
"failed": ""
|
"failed": "{{type}} のアップデートに失敗しました。もういちどお試しください"
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"name": {
|
"name": {
|
||||||
"title": ""
|
"title": "表示名"
|
||||||
},
|
},
|
||||||
"avatar": {
|
"avatar": {
|
||||||
"title": "",
|
"title": "アイコン",
|
||||||
"description": ""
|
"description": "400x400pxまで縮小されます"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"title": "",
|
"title": "ヘッダー",
|
||||||
"description": ""
|
"description": "1500x1500pxまで縮小されます"
|
||||||
},
|
},
|
||||||
"note": {
|
"note": {
|
||||||
"title": ""
|
"title": "プロフィール補足情報"
|
||||||
},
|
},
|
||||||
"fields": {
|
"fields": {
|
||||||
"title": "",
|
"title": "プロフィール補足情報",
|
||||||
"total_one": "",
|
"total_one": "{{count}} つのフィールド",
|
||||||
"total_other": ""
|
"total_other": "{{count}} つのフィールド"
|
||||||
},
|
},
|
||||||
"visibility": {
|
"visibility": {
|
||||||
"title": "",
|
"title": "デフォルトの投稿の公開範囲",
|
||||||
"options": {
|
"options": {
|
||||||
"public": "",
|
"public": "公開",
|
||||||
"unlisted": "",
|
"unlisted": "未収載",
|
||||||
"private": "",
|
"private": "フォロワー限定",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensitive": {
|
"sensitive": {
|
||||||
"title": ""
|
"title": "メディアを常に閲覧注意として投稿する"
|
||||||
},
|
},
|
||||||
"lock": {
|
"lock": {
|
||||||
"title": "",
|
"title": "承認制アカウント",
|
||||||
"description": ""
|
"description": "フォロワーを手動で承認する必要があります"
|
||||||
},
|
},
|
||||||
"bot": {
|
"bot": {
|
||||||
"title": "",
|
"title": "ボットアカウント",
|
||||||
"description": ""
|
"description": "このアカウントを主に自動で動作するものとし、人による監視がされていない可能性があるものとします"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fields": {
|
"fields": {
|
||||||
"group": "",
|
"group": "グループ {{index}}",
|
||||||
"label": "",
|
"label": "ラベル",
|
||||||
"content": ""
|
"content": "内容"
|
||||||
},
|
},
|
||||||
"mediaSelectionFailed": ""
|
"mediaSelectionFailed": "画像処理に失敗しました。もういちどお試しください。"
|
||||||
},
|
},
|
||||||
"push": {
|
"push": {
|
||||||
"notAvailable": "",
|
"notAvailable": "あなたがお使いのデバイスでは tooot のプッシュ通知をサポートしていません",
|
||||||
"enable": {
|
"enable": {
|
||||||
"direct": "",
|
"direct": "プッシュ通知を有効にする",
|
||||||
"settings": ""
|
"settings": "設定で有効にする"
|
||||||
},
|
},
|
||||||
"global": {
|
"global": {
|
||||||
"heading": "",
|
"heading": "{{acct}} の通知を有効にする",
|
||||||
"description": ""
|
"description": "メッセージは tooot のサーバー経由で到達します"
|
||||||
},
|
},
|
||||||
"decode": {
|
"decode": {
|
||||||
"heading": "",
|
"heading": "メッセージの詳細を表示",
|
||||||
"description": ""
|
"description": "tooot のサーバーを介して到達するメッセージは暗号化されますが、サーバー上でメッセージを復号することを選択できます。サーバーのソースコードはオープンソースであり、ログを保存することはありません。"
|
||||||
},
|
},
|
||||||
"default": {
|
"default": {
|
||||||
"heading": ""
|
"heading": "デフォルト"
|
||||||
},
|
},
|
||||||
"follow": {
|
"follow": {
|
||||||
"heading": ""
|
"heading": "新しいフォロワー"
|
||||||
},
|
},
|
||||||
"follow_request": {
|
"follow_request": {
|
||||||
"heading": ""
|
"heading": "フォローリクエスト"
|
||||||
},
|
},
|
||||||
"favourite": {
|
"favourite": {
|
||||||
"heading": ""
|
"heading": "お気に入り"
|
||||||
},
|
},
|
||||||
"reblog": {
|
"reblog": {
|
||||||
"heading": ""
|
"heading": "ブースト"
|
||||||
},
|
},
|
||||||
"mention": {
|
"mention": {
|
||||||
"heading": ""
|
"heading": "返信"
|
||||||
},
|
},
|
||||||
"poll": {
|
"poll": {
|
||||||
"heading": ""
|
"heading": "投票"
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"heading": ""
|
"heading": "購読したユーザーのトゥート"
|
||||||
},
|
},
|
||||||
"howitworks": ""
|
"howitworks": "通知到達(routing)のしくみを学ぶ"
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"announcements": {
|
"announcements": {
|
||||||
"content": {
|
"content": {
|
||||||
"unread": "",
|
"unread": "未読数: {{amount}}",
|
||||||
"read": "",
|
"read": "すべて読みました",
|
||||||
"empty": ""
|
"empty": "ありません"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"push": {
|
"push": {
|
||||||
"content": {
|
"content": {
|
||||||
"enabled": "",
|
"enabled": "有効",
|
||||||
"disabled": ""
|
"disabled": "無効"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"update": {
|
"update": {
|
||||||
"title": ""
|
"title": "最新バージョンへのアップデート"
|
||||||
},
|
},
|
||||||
"logout": {
|
"logout": {
|
||||||
"button": "",
|
"button": "ログアウト",
|
||||||
"alert": {
|
"alert": {
|
||||||
"title": "",
|
"title": "ログアウトしますか?",
|
||||||
"message": "",
|
"message": "ログアウトすると、再度ログインする必要があります",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"logout": "",
|
"logout": "ログアウト",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"fontsize": {
|
"fontsize": {
|
||||||
"heading": "",
|
"heading": "$t(me.stacks.fontSize.name)",
|
||||||
"content": {
|
"content": {
|
||||||
"S": "",
|
"S": "$t(me.fontSize.sizes.S)",
|
||||||
"M": "",
|
"M": "$t(me.fontSize.sizes.M)",
|
||||||
"L": "",
|
"L": "$t(me.fontSize.sizes.L)",
|
||||||
"XL": "",
|
"XL": "$t(me.fontSize.sizes.XL)",
|
||||||
"XXL": ""
|
"XXL": "$t(me.fontSize.sizes.XXL)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"heading": "",
|
"heading": "$t(me.stacks.language.name)",
|
||||||
"options": {
|
"options": {
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"heading": "",
|
"heading": "外観",
|
||||||
"options": {
|
"options": {
|
||||||
"auto": "",
|
"auto": "システムの設定に従う",
|
||||||
"light": "",
|
"light": "ライトモード",
|
||||||
"dark": "",
|
"dark": "ダークモード",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"darkTheme": {
|
"darkTheme": {
|
||||||
"heading": "",
|
"heading": "ダークテーマ",
|
||||||
"options": {
|
"options": {
|
||||||
"lighter": "",
|
"lighter": "明るめ",
|
||||||
"darker": "",
|
"darker": "暗め",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"heading": "",
|
"heading": "リンクを開く",
|
||||||
"options": {
|
"options": {
|
||||||
"internal": "",
|
"internal": "アプリ内で開く",
|
||||||
"external": "",
|
"external": "システムブラウザを使用する",
|
||||||
"cancel": ""
|
"cancel": "$t(common:buttons.cancel)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"staticEmoji": {
|
"staticEmoji": {
|
||||||
"heading": "",
|
"heading": "静的な絵文字リスト",
|
||||||
"description": ""
|
"description": "絵文字リストを表示しているときにアプリが頻繁にクラッシュする場合、代わりにアニメーションが無効化された絵文字リストを使用してみてください。"
|
||||||
},
|
},
|
||||||
"feedback": {
|
"feedback": {
|
||||||
"heading": ""
|
"heading": "機能リクエスト"
|
||||||
},
|
},
|
||||||
"support": {
|
"support": {
|
||||||
"heading": ""
|
"heading": "tooot をサポート"
|
||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"heading": ""
|
"heading": "tooot をレビュー"
|
||||||
},
|
},
|
||||||
"contact": {
|
"contact": {
|
||||||
"heading": ""
|
"heading": "tooot に関する連絡"
|
||||||
},
|
},
|
||||||
"analytics": {
|
"analytics": {
|
||||||
"heading": "",
|
"heading": "ソフトウェア改善への協力",
|
||||||
"description": ""
|
"description": "ユーザーに関連しない情報のみ収集します"
|
||||||
},
|
},
|
||||||
"version": "",
|
"version": "バージョン v{{version}}",
|
||||||
"instanceVersion": ""
|
"instanceVersion": "Mastodonのバージョン v{{version}}"
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
"existing": "",
|
"existing": "ログイン済みのアカウント",
|
||||||
"new": ""
|
"new": "インスタンスに新規ログイン"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared": {
|
"shared": {
|
||||||
"account": {
|
"account": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"accessibilityLabel": "",
|
"accessibilityLabel": "ユーザー {{user}} に対するアクション",
|
||||||
"accessibilityHint": ""
|
"accessibilityHint": "このユーザーをミュート、ブロック、報告または共有できます"
|
||||||
},
|
},
|
||||||
"followed_by": "",
|
"followed_by": "はあなたをフォローしています",
|
||||||
"moved": "",
|
"moved": "ユーザーは引っ越ししました",
|
||||||
"created_at": "",
|
"created_at": "登録日: {{date}}",
|
||||||
"summary": {
|
"summary": {
|
||||||
"statuses_count": "",
|
"statuses_count": "{{count}} 投稿",
|
||||||
"following_count": "",
|
"following_count": "$t(shared.users.accounts.following)",
|
||||||
"followers_count": ""
|
"followers_count": "$t(shared.users.accounts.followers)"
|
||||||
},
|
},
|
||||||
"toots": {
|
"toots": {
|
||||||
"default": "",
|
"default": "投稿",
|
||||||
"all": ""
|
"all": "投稿と返信"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"attachments": {
|
"attachments": {
|
||||||
"name": ""
|
"name": "<0 /><1>\" のメディア</1>"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"header": {
|
"header": {
|
||||||
"prefix": "",
|
"prefix": "検索",
|
||||||
"placeholder": ""
|
"placeholder": "検索したいことは…?"
|
||||||
},
|
},
|
||||||
"empty": {
|
"empty": {
|
||||||
"general": "",
|
"general": "検索キーワードを入力して<bold>$t(screenTabs:shared.search.sections.accounts)</bold>、<bold>$t(screenTabs:shared.search.sections.hashtags)</bold> または <bold>$t(screenTabs:shared.search.sections.statuses)</bold>を検索",
|
||||||
"advanced": {
|
"advanced": {
|
||||||
"header": "",
|
"header": "高度な検索のフォーマット",
|
||||||
"example": {
|
"example": {
|
||||||
"account": "",
|
"account": "$t(shared.search.header.prefix) $t(shared.search.sections.accounts)",
|
||||||
"hashtag": "",
|
"hashtag": "$t(shared.search.header.prefix) $t(shared.search.sections.hashtags)",
|
||||||
"statusLink": "",
|
"statusLink": "$t(shared.search.header.prefix) $t(shared.search.sections.statuses)",
|
||||||
"accountLink": ""
|
"accountLink": "$t(shared.search.header.prefix) $t(shared.search.sections.accounts)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sections": {
|
"sections": {
|
||||||
"accounts": "",
|
"accounts": "ユーザー",
|
||||||
"hashtags": "",
|
"hashtags": "ハッシュタグ",
|
||||||
"statuses": ""
|
"statuses": "投稿"
|
||||||
},
|
},
|
||||||
"notFound": ""
|
"notFound": "{{type}} <bold>{{searchTerm}}</bold> は見つかりませんでした"
|
||||||
},
|
},
|
||||||
"toot": {
|
"toot": {
|
||||||
"name": ""
|
"name": "スレッド"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"accounts": {
|
"accounts": {
|
||||||
"following": "",
|
"following": "{{count}} フォロー",
|
||||||
"followers": ""
|
"followers": "{{count}} フォロワー"
|
||||||
},
|
},
|
||||||
"statuses": {
|
"statuses": {
|
||||||
"reblogged_by": "",
|
"reblogged_by": "{{count}} ブースト",
|
||||||
"favourited_by": ""
|
"favourited_by": "{{count}} お気に入り"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"history": {
|
"history": {
|
||||||
"name": ""
|
"name": "編集履歴"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ const LOCALES = {
|
|||||||
de: 'Deutsch',
|
de: 'Deutsch',
|
||||||
en: 'English',
|
en: 'English',
|
||||||
it: 'Italiano',
|
it: 'Italiano',
|
||||||
|
ja: '日本語',
|
||||||
ko: '한국어',
|
ko: '한국어',
|
||||||
'pt-BR': 'Português (Brasil)',
|
'pt-BR': 'Português (Brasil)',
|
||||||
vi: 'Tiếng Việt',
|
vi: 'Tiếng Việt',
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"copy": {
|
"copy": {
|
||||||
"action": "",
|
"action": "",
|
||||||
"succeed": ""
|
"succeed": "Copiado"
|
||||||
},
|
},
|
||||||
"instance": {
|
"instance": {
|
||||||
"title": "Ação da Instância",
|
"title": "Ação da Instância",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"heading": "",
|
"heading": "Compartilhar com ...",
|
||||||
"content": {
|
"content": {
|
||||||
"select_account": ""
|
"select_account": "Selecione a conta"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,13 +5,7 @@ import { StyleConstants } from '@utils/styles/constants'
|
|||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import { chunk, forEach, groupBy, sortBy } from 'lodash'
|
import { chunk, forEach, groupBy, sortBy } from 'lodash'
|
||||||
import React, { useContext, useEffect, useMemo, useRef } from 'react'
|
import React, { useContext, useEffect, useMemo, useRef } from 'react'
|
||||||
import {
|
import { AccessibilityInfo, findNodeHandle, FlatList, StyleSheet, View } from 'react-native'
|
||||||
AccessibilityInfo,
|
|
||||||
findNodeHandle,
|
|
||||||
FlatList,
|
|
||||||
StyleSheet,
|
|
||||||
View
|
|
||||||
} from 'react-native'
|
|
||||||
import { Circle } from 'react-native-animated-spinkit'
|
import { Circle } from 'react-native-animated-spinkit'
|
||||||
import ComposeActions from './Root/Actions'
|
import ComposeActions from './Root/Actions'
|
||||||
import ComposePosting from './Posting'
|
import ComposePosting from './Posting'
|
||||||
@ -79,8 +73,7 @@ const ComposeRoot = React.memo(
|
|||||||
|
|
||||||
const { isFetching, data, refetch } = useSearchQuery({
|
const { isFetching, data, refetch } = useSearchQuery({
|
||||||
type:
|
type:
|
||||||
composeState.tag?.type === 'accounts' ||
|
composeState.tag?.type === 'accounts' || composeState.tag?.type === 'hashtags'
|
||||||
composeState.tag?.type === 'hashtags'
|
|
||||||
? composeState.tag.type
|
? composeState.tag.type
|
||||||
: undefined,
|
: undefined,
|
||||||
term: composeState.tag?.text.substring(1),
|
term: composeState.tag?.text.substring(1),
|
||||||
@ -89,8 +82,7 @@ const ComposeRoot = React.memo(
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
(composeState.tag?.type === 'accounts' ||
|
(composeState.tag?.type === 'accounts' || composeState.tag?.type === 'hashtags') &&
|
||||||
composeState.tag?.type === 'hashtags') &&
|
|
||||||
composeState.tag?.text
|
composeState.tag?.text
|
||||||
) {
|
) {
|
||||||
refetch()
|
refetch()
|
||||||
@ -106,9 +98,7 @@ const ComposeRoot = React.memo(
|
|||||||
title: string
|
title: string
|
||||||
data: Pick<Mastodon.Emoji, 'shortcode' | 'url' | 'static_url'>[][]
|
data: Pick<Mastodon.Emoji, 'shortcode' | 'url' | 'static_url'>[][]
|
||||||
}[] = []
|
}[] = []
|
||||||
forEach(
|
forEach(groupBy(sortBy(emojisData, ['category', 'shortcode']), 'category'), (value, key) =>
|
||||||
groupBy(sortBy(emojisData, ['category', 'shortcode']), 'category'),
|
|
||||||
(value, key) =>
|
|
||||||
sortedEmojis.push({ title: key, data: chunk(value, 5) })
|
sortedEmojis.push({ title: key, data: chunk(value, 5) })
|
||||||
)
|
)
|
||||||
if (frequentEmojis.length) {
|
if (frequentEmojis.length) {
|
||||||
@ -132,15 +122,22 @@ const ComposeRoot = React.memo(
|
|||||||
if (isFetching) {
|
if (isFetching) {
|
||||||
return (
|
return (
|
||||||
<View key='listEmpty' style={styles.loading}>
|
<View key='listEmpty' style={styles.loading}>
|
||||||
<Circle
|
<Circle size={StyleConstants.Font.Size.M * 1.25} color={colors.secondary} />
|
||||||
size={StyleConstants.Font.Size.M * 1.25}
|
|
||||||
color={colors.secondary}
|
|
||||||
/>
|
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, [isFetching])
|
}, [isFetching])
|
||||||
|
|
||||||
|
const Footer = useMemo(
|
||||||
|
() => (
|
||||||
|
<ComposeRootFooter
|
||||||
|
accessibleRefAttachments={accessibleRefAttachments}
|
||||||
|
accessibleRefEmojis={accessibleRefEmojis}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
[accessibleRefAttachments.current, accessibleRefEmojis.current]
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.base}>
|
<View style={styles.base}>
|
||||||
<FlatList
|
<FlatList
|
||||||
@ -154,12 +151,7 @@ const ComposeRoot = React.memo(
|
|||||||
ListEmptyComponent={listEmpty}
|
ListEmptyComponent={listEmpty}
|
||||||
keyboardShouldPersistTaps='always'
|
keyboardShouldPersistTaps='always'
|
||||||
ListHeaderComponent={ComposeRootHeader}
|
ListHeaderComponent={ComposeRootHeader}
|
||||||
ListFooterComponent={() => (
|
ListFooterComponent={Footer}
|
||||||
<ComposeRootFooter
|
|
||||||
accessibleRefAttachments={accessibleRefAttachments}
|
|
||||||
accessibleRefEmojis={accessibleRefEmojis}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
ItemSeparatorComponent={ComponentSeparator}
|
ItemSeparatorComponent={ComponentSeparator}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
data={data ? data[composeState.tag?.type] : undefined}
|
data={data ? data[composeState.tag?.type] : undefined}
|
||||||
|
5
src/screens/Compose/utils/types.d.ts
vendored
5
src/screens/Compose/utils/types.d.ts
vendored
@ -53,10 +53,7 @@ export type ComposeState = {
|
|||||||
active: boolean
|
active: boolean
|
||||||
total: number
|
total: number
|
||||||
options: {
|
options: {
|
||||||
'0': string | undefined
|
[key: string]: string | undefined
|
||||||
'1': string | undefined
|
|
||||||
'2': string | undefined
|
|
||||||
'3': string | undefined
|
|
||||||
}
|
}
|
||||||
multiple: boolean
|
multiple: boolean
|
||||||
expire: '300' | '1800' | '3600' | '21600' | '86400' | '259200' | '604800'
|
expire: '300' | '1800' | '3600' | '21600' | '86400' | '259200' | '604800'
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import * as rn from "react-native";
|
|
||||||
|
|
||||||
declare module "react-native" {
|
|
||||||
class VirtualizedList<ItemT> extends React.Component<
|
|
||||||
VirtualizedListProps<ItemT>
|
|
||||||
> {}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
export type Dimensions = {
|
|
||||||
width: number
|
|
||||||
height: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Position = {
|
|
||||||
x: number
|
|
||||||
y: number
|
|
||||||
}
|
|
@ -1,132 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { RootStackParamList } from '@utils/navigation/navigators'
|
|
||||||
import React, { ComponentType, useCallback, useEffect } from 'react'
|
|
||||||
import {
|
|
||||||
Animated,
|
|
||||||
Dimensions,
|
|
||||||
StyleSheet,
|
|
||||||
View,
|
|
||||||
VirtualizedList
|
|
||||||
} from 'react-native'
|
|
||||||
import ImageItem from './components/ImageItem'
|
|
||||||
import useAnimatedComponents from './hooks/useAnimatedComponents'
|
|
||||||
import useImageIndexChange from './hooks/useImageIndexChange'
|
|
||||||
import useRequestClose from './hooks/useRequestClose'
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
images: RootStackParamList['Screen-ImagesViewer']['imageUrls']
|
|
||||||
imageIndex: number
|
|
||||||
onRequestClose: () => void
|
|
||||||
onLongPress?: (
|
|
||||||
image: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
|
||||||
) => void
|
|
||||||
onImageIndexChange?: (imageIndex: number) => void
|
|
||||||
backgroundColor?: string
|
|
||||||
swipeToCloseEnabled?: boolean
|
|
||||||
delayLongPress?: number
|
|
||||||
HeaderComponent: ComponentType<{ imageIndex: number }>
|
|
||||||
}
|
|
||||||
|
|
||||||
const DEFAULT_BG_COLOR = '#000'
|
|
||||||
const DEFAULT_DELAY_LONG_PRESS = 800
|
|
||||||
const SCREEN = Dimensions.get('screen')
|
|
||||||
const SCREEN_WIDTH = SCREEN.width
|
|
||||||
|
|
||||||
function ImageViewer ({
|
|
||||||
images,
|
|
||||||
imageIndex,
|
|
||||||
onRequestClose,
|
|
||||||
onLongPress = () => {},
|
|
||||||
onImageIndexChange,
|
|
||||||
backgroundColor = DEFAULT_BG_COLOR,
|
|
||||||
swipeToCloseEnabled,
|
|
||||||
delayLongPress = DEFAULT_DELAY_LONG_PRESS,
|
|
||||||
HeaderComponent
|
|
||||||
}: Props) {
|
|
||||||
const imageList = React.createRef<
|
|
||||||
VirtualizedList<RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]>
|
|
||||||
>()
|
|
||||||
const [opacity, onRequestCloseEnhanced] = useRequestClose(onRequestClose)
|
|
||||||
const [currentImageIndex, onScroll] = useImageIndexChange(imageIndex, SCREEN)
|
|
||||||
const [headerTransform, toggleBarsVisible] = useAnimatedComponents()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (onImageIndexChange) {
|
|
||||||
onImageIndexChange(currentImageIndex)
|
|
||||||
}
|
|
||||||
}, [currentImageIndex])
|
|
||||||
|
|
||||||
const onZoom = useCallback(
|
|
||||||
(isScaled: boolean) => {
|
|
||||||
// @ts-ignore
|
|
||||||
imageList?.current?.setNativeProps({ scrollEnabled: !isScaled })
|
|
||||||
toggleBarsVisible(!isScaled)
|
|
||||||
},
|
|
||||||
[imageList]
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={[styles.container, { opacity, backgroundColor }]}>
|
|
||||||
<Animated.View style={[styles.header, { transform: headerTransform }]}>
|
|
||||||
{React.createElement(HeaderComponent, {
|
|
||||||
imageIndex: currentImageIndex
|
|
||||||
})}
|
|
||||||
</Animated.View>
|
|
||||||
<VirtualizedList
|
|
||||||
ref={imageList}
|
|
||||||
data={images}
|
|
||||||
horizontal
|
|
||||||
pagingEnabled
|
|
||||||
windowSize={2}
|
|
||||||
initialNumToRender={1}
|
|
||||||
maxToRenderPerBatch={1}
|
|
||||||
showsHorizontalScrollIndicator={false}
|
|
||||||
showsVerticalScrollIndicator={false}
|
|
||||||
initialScrollIndex={
|
|
||||||
imageIndex > images.length - 1 ? images.length - 1 : imageIndex
|
|
||||||
}
|
|
||||||
getItem={(_, index) => images[index]}
|
|
||||||
getItemCount={() => images.length}
|
|
||||||
getItemLayout={(_, index) => ({
|
|
||||||
length: SCREEN_WIDTH,
|
|
||||||
offset: SCREEN_WIDTH * index,
|
|
||||||
index
|
|
||||||
})}
|
|
||||||
renderItem={({ item: imageSrc }) => (
|
|
||||||
<ImageItem
|
|
||||||
onZoom={onZoom}
|
|
||||||
imageSrc={imageSrc}
|
|
||||||
onRequestClose={onRequestCloseEnhanced}
|
|
||||||
onLongPress={onLongPress}
|
|
||||||
delayLongPress={delayLongPress}
|
|
||||||
swipeToCloseEnabled={swipeToCloseEnabled}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
onMomentumScrollEnd={onScroll}
|
|
||||||
keyExtractor={imageSrc => imageSrc.url}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: '#000'
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
position: 'absolute',
|
|
||||||
width: '100%',
|
|
||||||
zIndex: 1,
|
|
||||||
top: 0
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default ImageViewer
|
|
@ -1,123 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import GracefullyImage from '@components/GracefullyImage'
|
|
||||||
import { RootStackParamList } from '@utils/navigation/navigators'
|
|
||||||
import React, { useState, useCallback } from 'react'
|
|
||||||
import { Animated, Dimensions, StyleSheet } from 'react-native'
|
|
||||||
import usePanResponder from '../hooks/usePanResponder'
|
|
||||||
import { getImageStyles, getImageTransform } from '../utils'
|
|
||||||
|
|
||||||
const SCREEN = Dimensions.get('window')
|
|
||||||
const SCREEN_WIDTH = SCREEN.width
|
|
||||||
const SCREEN_HEIGHT = SCREEN.height
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
imageSrc: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
|
||||||
onRequestClose: () => void
|
|
||||||
onZoom: (isZoomed: boolean) => void
|
|
||||||
onLongPress: (
|
|
||||||
image: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
|
||||||
) => void
|
|
||||||
delayLongPress: number
|
|
||||||
swipeToCloseEnabled?: boolean
|
|
||||||
doubleTapToZoomEnabled?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
const ImageItem = ({
|
|
||||||
imageSrc,
|
|
||||||
onZoom,
|
|
||||||
onRequestClose,
|
|
||||||
onLongPress,
|
|
||||||
delayLongPress,
|
|
||||||
doubleTapToZoomEnabled = true
|
|
||||||
}: Props) => {
|
|
||||||
const imageContainer = React.createRef<any>()
|
|
||||||
const [imageDimensions, setImageDimensions] = useState({
|
|
||||||
width: imageSrc.width || 0,
|
|
||||||
height: imageSrc.height || 0
|
|
||||||
})
|
|
||||||
const [translate, scale] = getImageTransform(imageDimensions, SCREEN)
|
|
||||||
|
|
||||||
const onZoomPerformed = (isZoomed: boolean) => {
|
|
||||||
onZoom(isZoomed)
|
|
||||||
if (imageContainer?.current) {
|
|
||||||
// @ts-ignore
|
|
||||||
imageContainer.current.setNativeProps({
|
|
||||||
scrollEnabled: !isZoomed
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onLongPressHandler = useCallback(() => {
|
|
||||||
onLongPress(imageSrc)
|
|
||||||
}, [imageSrc, onLongPress])
|
|
||||||
|
|
||||||
const [panHandlers, scaleValue, translateValue] = usePanResponder({
|
|
||||||
initialScale: scale || 1,
|
|
||||||
initialTranslate: translate || { x: 0, y: 0 },
|
|
||||||
onZoom: onZoomPerformed,
|
|
||||||
doubleTapToZoomEnabled,
|
|
||||||
onLongPress: onLongPressHandler,
|
|
||||||
delayLongPress,
|
|
||||||
onRequestClose
|
|
||||||
})
|
|
||||||
|
|
||||||
const imagesStyles = getImageStyles(
|
|
||||||
imageDimensions,
|
|
||||||
translateValue,
|
|
||||||
scaleValue
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Animated.ScrollView
|
|
||||||
ref={imageContainer}
|
|
||||||
style={styles.listItem}
|
|
||||||
pagingEnabled
|
|
||||||
nestedScrollEnabled
|
|
||||||
showsHorizontalScrollIndicator={false}
|
|
||||||
showsVerticalScrollIndicator={false}
|
|
||||||
contentContainerStyle={styles.imageScrollContainer}
|
|
||||||
scrollEnabled={false}
|
|
||||||
>
|
|
||||||
<Animated.View
|
|
||||||
{...panHandlers}
|
|
||||||
style={imagesStyles}
|
|
||||||
children={
|
|
||||||
<GracefullyImage
|
|
||||||
uri={{
|
|
||||||
preview: imageSrc.preview_url,
|
|
||||||
original: imageSrc.url,
|
|
||||||
remote: imageSrc.remote_url
|
|
||||||
}}
|
|
||||||
{...((!imageSrc.width || !imageSrc.height) && {
|
|
||||||
setImageDimensions
|
|
||||||
})}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
imageStyle={{
|
|
||||||
flex: 1,
|
|
||||||
resizeMode: 'stretch'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Animated.ScrollView>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
listItem: {
|
|
||||||
width: SCREEN_WIDTH,
|
|
||||||
height: SCREEN_HEIGHT
|
|
||||||
},
|
|
||||||
imageScrollContainer: {
|
|
||||||
height: SCREEN_HEIGHT * 2
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default React.memo(ImageItem)
|
|
@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from "react";
|
|
||||||
import { GestureResponderEvent } from "react-native";
|
|
||||||
import { ImageSource } from "../@types";
|
|
||||||
|
|
||||||
declare type Props = {
|
|
||||||
imageSrc: ImageSource;
|
|
||||||
onRequestClose: () => void;
|
|
||||||
onZoom: (isZoomed: boolean) => void;
|
|
||||||
onLongPress: (image: ImageSource) => void;
|
|
||||||
delayLongPress: number;
|
|
||||||
swipeToCloseEnabled?: boolean;
|
|
||||||
doubleTapToZoomEnabled?: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
declare const _default: React.MemoExoticComponent<({
|
|
||||||
imageSrc,
|
|
||||||
onZoom,
|
|
||||||
onRequestClose,
|
|
||||||
onLongPress,
|
|
||||||
delayLongPress,
|
|
||||||
swipeToCloseEnabled,
|
|
||||||
}: Props) => JSX.Element>;
|
|
||||||
|
|
||||||
export default _default;
|
|
@ -1,177 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import GracefullyImage from '@components/GracefullyImage'
|
|
||||||
import { RootStackParamList } from '@utils/navigation/navigators'
|
|
||||||
import React, { createRef, useCallback, useRef, useState } from 'react'
|
|
||||||
import {
|
|
||||||
Animated,
|
|
||||||
Dimensions,
|
|
||||||
NativeScrollEvent,
|
|
||||||
NativeSyntheticEvent,
|
|
||||||
ScrollView,
|
|
||||||
StyleSheet
|
|
||||||
} from 'react-native'
|
|
||||||
import {
|
|
||||||
LongPressGestureHandler,
|
|
||||||
State,
|
|
||||||
TapGestureHandler
|
|
||||||
} from 'react-native-gesture-handler'
|
|
||||||
import useDoubleTapToZoom from '../hooks/useDoubleTapToZoom'
|
|
||||||
import { getImageStyles, getImageTransform } from '../utils'
|
|
||||||
|
|
||||||
const SWIPE_CLOSE_OFFSET = 75
|
|
||||||
const SWIPE_CLOSE_VELOCITY = 0.55
|
|
||||||
const SCREEN = Dimensions.get('screen')
|
|
||||||
const SCREEN_WIDTH = SCREEN.width
|
|
||||||
const SCREEN_HEIGHT = SCREEN.height
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
imageSrc: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
|
||||||
onRequestClose: () => void
|
|
||||||
onZoom: (scaled: boolean) => void
|
|
||||||
onLongPress: (
|
|
||||||
image: RootStackParamList['Screen-ImagesViewer']['imageUrls'][0]
|
|
||||||
) => void
|
|
||||||
swipeToCloseEnabled?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
const doubleTap = createRef()
|
|
||||||
|
|
||||||
const ImageItem = ({
|
|
||||||
imageSrc,
|
|
||||||
onZoom,
|
|
||||||
onRequestClose,
|
|
||||||
onLongPress,
|
|
||||||
swipeToCloseEnabled = true
|
|
||||||
}: Props) => {
|
|
||||||
const scrollViewRef = useRef<ScrollView>(null)
|
|
||||||
const [scaled, setScaled] = useState(false)
|
|
||||||
const [imageDimensions, setImageDimensions] = useState({
|
|
||||||
width: imageSrc.width || 1,
|
|
||||||
height: imageSrc.height || 1
|
|
||||||
})
|
|
||||||
const handleDoubleTap = useDoubleTapToZoom(scrollViewRef, scaled, SCREEN)
|
|
||||||
|
|
||||||
const [translate, scale] = getImageTransform(imageDimensions, SCREEN)
|
|
||||||
const scrollValueY = new Animated.Value(0)
|
|
||||||
const scaleValue = new Animated.Value(scale || 1)
|
|
||||||
const translateValue = new Animated.ValueXY(translate)
|
|
||||||
const maxScale = scale && scale > 0 ? Math.max(1 / scale, 1) : 1
|
|
||||||
|
|
||||||
const imageOpacity = scrollValueY.interpolate({
|
|
||||||
inputRange: [-SWIPE_CLOSE_OFFSET, 0, SWIPE_CLOSE_OFFSET],
|
|
||||||
outputRange: [0.5, 1, 0.5]
|
|
||||||
})
|
|
||||||
const imagesStyles = getImageStyles(
|
|
||||||
imageDimensions,
|
|
||||||
translateValue,
|
|
||||||
scaleValue
|
|
||||||
)
|
|
||||||
const imageStylesWithOpacity = { ...imagesStyles, opacity: imageOpacity }
|
|
||||||
|
|
||||||
const onScrollEndDrag = useCallback(
|
|
||||||
({ nativeEvent }: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
||||||
const velocityY = nativeEvent?.velocity?.y ?? 0
|
|
||||||
const scaled = nativeEvent?.zoomScale > 1
|
|
||||||
|
|
||||||
onZoom(scaled)
|
|
||||||
setScaled(scaled)
|
|
||||||
|
|
||||||
if (
|
|
||||||
!scaled &&
|
|
||||||
swipeToCloseEnabled &&
|
|
||||||
Math.abs(velocityY) > SWIPE_CLOSE_VELOCITY
|
|
||||||
) {
|
|
||||||
onRequestClose()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[scaled]
|
|
||||||
)
|
|
||||||
|
|
||||||
const onScroll = ({
|
|
||||||
nativeEvent
|
|
||||||
}: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
||||||
const offsetY = nativeEvent?.contentOffset?.y ?? 0
|
|
||||||
|
|
||||||
if (nativeEvent?.zoomScale > 1) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollValueY.setValue(offsetY)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<LongPressGestureHandler
|
|
||||||
onHandlerStateChange={({ nativeEvent }) => {
|
|
||||||
if (nativeEvent.state === State.ACTIVE) {
|
|
||||||
onLongPress(imageSrc)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TapGestureHandler
|
|
||||||
onHandlerStateChange={({ nativeEvent }) =>
|
|
||||||
nativeEvent.state === State.ACTIVE && onRequestClose()
|
|
||||||
}
|
|
||||||
waitFor={doubleTap}
|
|
||||||
>
|
|
||||||
<TapGestureHandler
|
|
||||||
ref={doubleTap}
|
|
||||||
onHandlerStateChange={handleDoubleTap}
|
|
||||||
numberOfTaps={2}
|
|
||||||
>
|
|
||||||
<ScrollView
|
|
||||||
ref={scrollViewRef}
|
|
||||||
style={styles.listItem}
|
|
||||||
pinchGestureEnabled
|
|
||||||
nestedScrollEnabled={true}
|
|
||||||
showsHorizontalScrollIndicator={false}
|
|
||||||
showsVerticalScrollIndicator={false}
|
|
||||||
maximumZoomScale={maxScale}
|
|
||||||
contentContainerStyle={styles.imageScrollContainer}
|
|
||||||
scrollEnabled={swipeToCloseEnabled}
|
|
||||||
onScrollEndDrag={onScrollEndDrag}
|
|
||||||
scrollEventThrottle={1}
|
|
||||||
{...(swipeToCloseEnabled && {
|
|
||||||
onScroll
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<Animated.View
|
|
||||||
style={imageStylesWithOpacity}
|
|
||||||
children={
|
|
||||||
<GracefullyImage
|
|
||||||
uri={{
|
|
||||||
preview: imageSrc.preview_url,
|
|
||||||
original: imageSrc.url,
|
|
||||||
remote: imageSrc.remote_url
|
|
||||||
}}
|
|
||||||
{...((!imageSrc.width || !imageSrc.height) && {
|
|
||||||
setImageDimensions
|
|
||||||
})}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</ScrollView>
|
|
||||||
</TapGestureHandler>
|
|
||||||
</TapGestureHandler>
|
|
||||||
</LongPressGestureHandler>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
listItem: {
|
|
||||||
width: SCREEN_WIDTH,
|
|
||||||
height: SCREEN_HEIGHT
|
|
||||||
},
|
|
||||||
imageScrollContainer: {
|
|
||||||
height: SCREEN_HEIGHT
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default React.memo(ImageItem)
|
|
@ -1,40 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Animated } from 'react-native'
|
|
||||||
|
|
||||||
const INITIAL_POSITION = { x: 0, y: 0 }
|
|
||||||
const ANIMATION_CONFIG = {
|
|
||||||
duration: 200,
|
|
||||||
useNativeDriver: true
|
|
||||||
}
|
|
||||||
|
|
||||||
const useAnimatedComponents = () => {
|
|
||||||
const headerTranslate = new Animated.ValueXY(INITIAL_POSITION)
|
|
||||||
|
|
||||||
const toggleVisible = (isVisible: boolean) => {
|
|
||||||
if (isVisible) {
|
|
||||||
Animated.parallel([
|
|
||||||
Animated.timing(headerTranslate.y, { ...ANIMATION_CONFIG, toValue: 0 })
|
|
||||||
]).start()
|
|
||||||
} else {
|
|
||||||
Animated.parallel([
|
|
||||||
Animated.timing(headerTranslate.y, {
|
|
||||||
...ANIMATION_CONFIG,
|
|
||||||
toValue: -300
|
|
||||||
})
|
|
||||||
]).start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const headerTransform = headerTranslate.getTranslateTransform()
|
|
||||||
|
|
||||||
return [headerTransform, toggleVisible] as const
|
|
||||||
}
|
|
||||||
|
|
||||||
export default useAnimatedComponents
|
|
@ -1,64 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React, { useCallback } from 'react'
|
|
||||||
import { ScrollView } from 'react-native'
|
|
||||||
import {
|
|
||||||
HandlerStateChangeEvent,
|
|
||||||
State,
|
|
||||||
TapGestureHandlerEventPayload
|
|
||||||
} from 'react-native-gesture-handler'
|
|
||||||
import { Dimensions } from '../@types'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is iOS only.
|
|
||||||
* Same functionality for Android implemented inside usePanResponder hook.
|
|
||||||
*/
|
|
||||||
function useDoubleTapToZoom (
|
|
||||||
scrollViewRef: React.RefObject<ScrollView>,
|
|
||||||
scaled: boolean,
|
|
||||||
screen: Dimensions
|
|
||||||
) {
|
|
||||||
const handleDoubleTap = useCallback(
|
|
||||||
({
|
|
||||||
nativeEvent
|
|
||||||
}: HandlerStateChangeEvent<TapGestureHandlerEventPayload>) => {
|
|
||||||
if (nativeEvent.state === State.ACTIVE) {
|
|
||||||
const scrollResponderRef = scrollViewRef?.current?.getScrollResponder()
|
|
||||||
|
|
||||||
const { absoluteX, absoluteY } = nativeEvent
|
|
||||||
let targetX = 0
|
|
||||||
let targetY = 0
|
|
||||||
let targetWidth = screen.width
|
|
||||||
let targetHeight = screen.height
|
|
||||||
|
|
||||||
// Zooming in
|
|
||||||
// TODO: Add more precise calculation of targetX, targetY based on touch
|
|
||||||
if (!scaled) {
|
|
||||||
targetX = absoluteX / 2
|
|
||||||
targetY = absoluteY / 2
|
|
||||||
targetWidth = screen.width / 2
|
|
||||||
targetHeight = screen.height / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollResponderRef?.scrollResponderZoomTo({
|
|
||||||
x: targetX,
|
|
||||||
y: targetY,
|
|
||||||
width: targetWidth,
|
|
||||||
height: targetHeight,
|
|
||||||
animated: true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[scaled]
|
|
||||||
)
|
|
||||||
|
|
||||||
return handleDoubleTap
|
|
||||||
}
|
|
||||||
|
|
||||||
export default useDoubleTapToZoom
|
|
@ -1,31 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { useState } from 'react'
|
|
||||||
import { NativeSyntheticEvent, NativeScrollEvent } from 'react-native'
|
|
||||||
import { Dimensions } from '../@types'
|
|
||||||
|
|
||||||
const useImageIndexChange = (imageIndex: number, screen: Dimensions) => {
|
|
||||||
const [currentImageIndex, setImageIndex] = useState(imageIndex)
|
|
||||||
const onScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
||||||
const {
|
|
||||||
nativeEvent: {
|
|
||||||
contentOffset: { x: scrollX }
|
|
||||||
}
|
|
||||||
} = event
|
|
||||||
|
|
||||||
if (screen.width) {
|
|
||||||
const nextIndex = Math.round(scrollX / screen.width)
|
|
||||||
setImageIndex(nextIndex < 0 ? 0 : nextIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [currentImageIndex, onScroll] as const
|
|
||||||
}
|
|
||||||
|
|
||||||
export default useImageIndexChange
|
|
@ -1,406 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { useMemo, useEffect } from 'react'
|
|
||||||
import {
|
|
||||||
Animated,
|
|
||||||
Dimensions,
|
|
||||||
GestureResponderEvent,
|
|
||||||
GestureResponderHandlers,
|
|
||||||
NativeTouchEvent,
|
|
||||||
PanResponderGestureState
|
|
||||||
} from 'react-native'
|
|
||||||
import { Position } from '../@types'
|
|
||||||
import {
|
|
||||||
createPanResponder,
|
|
||||||
getDistanceBetweenTouches,
|
|
||||||
getImageTranslate,
|
|
||||||
getImageDimensionsByTranslate
|
|
||||||
} from '../utils'
|
|
||||||
|
|
||||||
const SCREEN = Dimensions.get('window')
|
|
||||||
const SCREEN_WIDTH = SCREEN.width
|
|
||||||
const SCREEN_HEIGHT = SCREEN.height
|
|
||||||
const MIN_DIMENSION = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT)
|
|
||||||
|
|
||||||
const SCALE_MAX = 1
|
|
||||||
const DOUBLE_TAP_DELAY = 300
|
|
||||||
const OUT_BOUND_MULTIPLIER = 0.75
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
initialScale: number
|
|
||||||
initialTranslate: Position
|
|
||||||
onZoom: (isZoomed: boolean) => void
|
|
||||||
doubleTapToZoomEnabled: boolean
|
|
||||||
onLongPress: () => void
|
|
||||||
delayLongPress: number
|
|
||||||
onRequestClose: () => void
|
|
||||||
}
|
|
||||||
|
|
||||||
const usePanResponder = ({
|
|
||||||
initialScale,
|
|
||||||
initialTranslate,
|
|
||||||
onZoom,
|
|
||||||
doubleTapToZoomEnabled,
|
|
||||||
onLongPress,
|
|
||||||
delayLongPress,
|
|
||||||
onRequestClose
|
|
||||||
}: Props): Readonly<
|
|
||||||
[GestureResponderHandlers, Animated.Value, Animated.ValueXY]
|
|
||||||
> => {
|
|
||||||
let numberInitialTouches = 1
|
|
||||||
let initialTouches: NativeTouchEvent[] = []
|
|
||||||
let currentScale = initialScale
|
|
||||||
let currentTranslate = initialTranslate
|
|
||||||
let tmpScale = 0
|
|
||||||
let tmpTranslate: Position | null = null
|
|
||||||
let isDoubleTapPerformed = false
|
|
||||||
let lastTapTS: number | null = null
|
|
||||||
let timer: number | null = null
|
|
||||||
let longPressHandlerRef: number | null = null
|
|
||||||
|
|
||||||
const meaningfulShift = MIN_DIMENSION * 0.01
|
|
||||||
const scaleValue = new Animated.Value(initialScale)
|
|
||||||
const translateValue = new Animated.ValueXY(initialTranslate)
|
|
||||||
|
|
||||||
const imageDimensions = getImageDimensionsByTranslate(
|
|
||||||
initialTranslate,
|
|
||||||
SCREEN
|
|
||||||
)
|
|
||||||
|
|
||||||
const getBounds = (scale: number) => {
|
|
||||||
const scaledImageDimensions = {
|
|
||||||
width: imageDimensions.width * scale,
|
|
||||||
height: imageDimensions.height * scale
|
|
||||||
}
|
|
||||||
const translateDelta = getImageTranslate(scaledImageDimensions, SCREEN)
|
|
||||||
|
|
||||||
const left = initialTranslate.x - translateDelta.x
|
|
||||||
const right = left - (scaledImageDimensions.width - SCREEN.width)
|
|
||||||
const top = initialTranslate.y - translateDelta.y
|
|
||||||
const bottom = top - (scaledImageDimensions.height - SCREEN.height)
|
|
||||||
|
|
||||||
return [top, left, bottom, right]
|
|
||||||
}
|
|
||||||
|
|
||||||
const getTranslateInBounds = (translate: Position, scale: number) => {
|
|
||||||
const inBoundTranslate = { x: translate.x, y: translate.y }
|
|
||||||
const [topBound, leftBound, bottomBound, rightBound] = getBounds(scale)
|
|
||||||
|
|
||||||
if (translate.x > leftBound) {
|
|
||||||
inBoundTranslate.x = leftBound
|
|
||||||
} else if (translate.x < rightBound) {
|
|
||||||
inBoundTranslate.x = rightBound
|
|
||||||
}
|
|
||||||
|
|
||||||
if (translate.y > topBound) {
|
|
||||||
inBoundTranslate.y = topBound
|
|
||||||
} else if (translate.y < bottomBound) {
|
|
||||||
inBoundTranslate.y = bottomBound
|
|
||||||
}
|
|
||||||
|
|
||||||
return inBoundTranslate
|
|
||||||
}
|
|
||||||
|
|
||||||
const fitsScreenByWidth = () =>
|
|
||||||
imageDimensions.width * currentScale < SCREEN_WIDTH
|
|
||||||
const fitsScreenByHeight = () =>
|
|
||||||
imageDimensions.height * currentScale < SCREEN_HEIGHT
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
scaleValue.addListener(({ value }) => {
|
|
||||||
if (typeof onZoom === 'function') {
|
|
||||||
onZoom(value !== initialScale)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return () => scaleValue.removeAllListeners()
|
|
||||||
})
|
|
||||||
|
|
||||||
const cancelLongPressHandle = () => {
|
|
||||||
longPressHandlerRef && clearTimeout(longPressHandlerRef)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handlers = {
|
|
||||||
onGrant: (
|
|
||||||
_: GestureResponderEvent,
|
|
||||||
gestureState: PanResponderGestureState
|
|
||||||
) => {
|
|
||||||
numberInitialTouches = gestureState.numberActiveTouches
|
|
||||||
|
|
||||||
if (gestureState.numberActiveTouches > 1) return
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
longPressHandlerRef = setTimeout(onLongPress, delayLongPress)
|
|
||||||
},
|
|
||||||
onStart: (
|
|
||||||
event: GestureResponderEvent,
|
|
||||||
gestureState: PanResponderGestureState
|
|
||||||
) => {
|
|
||||||
initialTouches = event.nativeEvent.touches
|
|
||||||
numberInitialTouches = gestureState.numberActiveTouches
|
|
||||||
|
|
||||||
if (gestureState.numberActiveTouches > 1) return
|
|
||||||
|
|
||||||
const tapTS = Date.now()
|
|
||||||
!timer &&
|
|
||||||
// @ts-ignore
|
|
||||||
(timer = setTimeout(() => onRequestClose(), DOUBLE_TAP_DELAY + 50))
|
|
||||||
// Handle double tap event by calculating diff between first and second taps timestamps
|
|
||||||
|
|
||||||
isDoubleTapPerformed = Boolean(
|
|
||||||
lastTapTS && tapTS - lastTapTS < DOUBLE_TAP_DELAY
|
|
||||||
)
|
|
||||||
|
|
||||||
if (doubleTapToZoomEnabled && isDoubleTapPerformed) {
|
|
||||||
// @ts-ignore
|
|
||||||
clearTimeout(timer)
|
|
||||||
const isScaled = currentTranslate.x !== initialTranslate.x // currentScale !== initialScale;
|
|
||||||
const { pageX: touchX, pageY: touchY } = event.nativeEvent.touches[0]
|
|
||||||
const targetScale = SCALE_MAX
|
|
||||||
const nextScale = isScaled ? initialScale : targetScale
|
|
||||||
const nextTranslate = isScaled
|
|
||||||
? initialTranslate
|
|
||||||
: getTranslateInBounds(
|
|
||||||
{
|
|
||||||
x:
|
|
||||||
initialTranslate.x +
|
|
||||||
(SCREEN_WIDTH / 2 - touchX) * (targetScale / currentScale),
|
|
||||||
y:
|
|
||||||
initialTranslate.y +
|
|
||||||
(SCREEN_HEIGHT / 2 - -touchY) * (targetScale / currentScale)
|
|
||||||
},
|
|
||||||
targetScale
|
|
||||||
)
|
|
||||||
|
|
||||||
onZoom(!isScaled)
|
|
||||||
|
|
||||||
Animated.parallel(
|
|
||||||
[
|
|
||||||
Animated.timing(translateValue.x, {
|
|
||||||
toValue: nextTranslate.x,
|
|
||||||
duration: 300,
|
|
||||||
useNativeDriver: true
|
|
||||||
}),
|
|
||||||
Animated.timing(translateValue.y, {
|
|
||||||
toValue: nextTranslate.y,
|
|
||||||
duration: 300,
|
|
||||||
useNativeDriver: true
|
|
||||||
}),
|
|
||||||
Animated.timing(scaleValue, {
|
|
||||||
toValue: nextScale,
|
|
||||||
duration: 300,
|
|
||||||
useNativeDriver: true
|
|
||||||
})
|
|
||||||
],
|
|
||||||
{ stopTogether: false }
|
|
||||||
).start(() => {
|
|
||||||
currentScale = nextScale
|
|
||||||
currentTranslate = nextTranslate
|
|
||||||
})
|
|
||||||
|
|
||||||
lastTapTS = null
|
|
||||||
timer = null
|
|
||||||
} else {
|
|
||||||
lastTapTS = Date.now()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onMove: (
|
|
||||||
event: GestureResponderEvent,
|
|
||||||
gestureState: PanResponderGestureState
|
|
||||||
) => {
|
|
||||||
const { dx, dy } = gestureState
|
|
||||||
|
|
||||||
if (Math.abs(dx) >= meaningfulShift || Math.abs(dy) >= meaningfulShift) {
|
|
||||||
cancelLongPressHandle()
|
|
||||||
timer && clearTimeout(timer)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't need to handle move because double tap in progress (was handled in onStart)
|
|
||||||
if (doubleTapToZoomEnabled && isDoubleTapPerformed) {
|
|
||||||
cancelLongPressHandle()
|
|
||||||
timer && clearTimeout(timer)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
numberInitialTouches === 1 &&
|
|
||||||
gestureState.numberActiveTouches === 2
|
|
||||||
) {
|
|
||||||
numberInitialTouches = 2
|
|
||||||
initialTouches = event.nativeEvent.touches
|
|
||||||
}
|
|
||||||
|
|
||||||
const isTapGesture =
|
|
||||||
numberInitialTouches == 1 && gestureState.numberActiveTouches === 1
|
|
||||||
const isPinchGesture =
|
|
||||||
numberInitialTouches === 2 && gestureState.numberActiveTouches === 2
|
|
||||||
|
|
||||||
if (isPinchGesture) {
|
|
||||||
cancelLongPressHandle()
|
|
||||||
timer && clearTimeout(timer)
|
|
||||||
|
|
||||||
const initialDistance = getDistanceBetweenTouches(initialTouches)
|
|
||||||
const currentDistance = getDistanceBetweenTouches(
|
|
||||||
event.nativeEvent.touches
|
|
||||||
)
|
|
||||||
|
|
||||||
let nextScale = (currentDistance / initialDistance) * currentScale
|
|
||||||
|
|
||||||
/**
|
|
||||||
* In case image is scaling smaller than initial size ->
|
|
||||||
* slow down this transition by applying OUT_BOUND_MULTIPLIER
|
|
||||||
*/
|
|
||||||
if (nextScale < initialScale) {
|
|
||||||
nextScale =
|
|
||||||
nextScale + (initialScale - nextScale) * OUT_BOUND_MULTIPLIER
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* In case image is scaling down -> move it in direction of initial position
|
|
||||||
*/
|
|
||||||
if (currentScale > initialScale && currentScale > nextScale) {
|
|
||||||
const k = (currentScale - initialScale) / (currentScale - nextScale)
|
|
||||||
|
|
||||||
const nextTranslateX =
|
|
||||||
nextScale < initialScale
|
|
||||||
? initialTranslate.x
|
|
||||||
: currentTranslate.x -
|
|
||||||
(currentTranslate.x - initialTranslate.x) / k
|
|
||||||
|
|
||||||
const nextTranslateY =
|
|
||||||
nextScale < initialScale
|
|
||||||
? initialTranslate.y
|
|
||||||
: currentTranslate.y -
|
|
||||||
(currentTranslate.y - initialTranslate.y) / k
|
|
||||||
|
|
||||||
translateValue.x.setValue(nextTranslateX)
|
|
||||||
translateValue.y.setValue(nextTranslateY)
|
|
||||||
|
|
||||||
tmpTranslate = { x: nextTranslateX, y: nextTranslateY }
|
|
||||||
}
|
|
||||||
|
|
||||||
scaleValue.setValue(nextScale)
|
|
||||||
tmpScale = nextScale
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isTapGesture && currentScale > initialScale) {
|
|
||||||
const { x, y } = currentTranslate
|
|
||||||
const { dx, dy } = gestureState
|
|
||||||
const [topBound, leftBound, bottomBound, rightBound] =
|
|
||||||
getBounds(currentScale)
|
|
||||||
|
|
||||||
let nextTranslateX = x + dx
|
|
||||||
let nextTranslateY = y + dy
|
|
||||||
|
|
||||||
if (nextTranslateX > leftBound) {
|
|
||||||
nextTranslateX =
|
|
||||||
nextTranslateX - (nextTranslateX - leftBound) * OUT_BOUND_MULTIPLIER
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextTranslateX < rightBound) {
|
|
||||||
nextTranslateX =
|
|
||||||
nextTranslateX -
|
|
||||||
(nextTranslateX - rightBound) * OUT_BOUND_MULTIPLIER
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextTranslateY > topBound) {
|
|
||||||
nextTranslateY =
|
|
||||||
nextTranslateY - (nextTranslateY - topBound) * OUT_BOUND_MULTIPLIER
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextTranslateY < bottomBound) {
|
|
||||||
nextTranslateY =
|
|
||||||
nextTranslateY -
|
|
||||||
(nextTranslateY - bottomBound) * OUT_BOUND_MULTIPLIER
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fitsScreenByWidth()) {
|
|
||||||
nextTranslateX = x
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fitsScreenByHeight()) {
|
|
||||||
nextTranslateY = y
|
|
||||||
}
|
|
||||||
|
|
||||||
translateValue.x.setValue(nextTranslateX)
|
|
||||||
translateValue.y.setValue(nextTranslateY)
|
|
||||||
|
|
||||||
tmpTranslate = { x: nextTranslateX, y: nextTranslateY }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onRelease: () => {
|
|
||||||
cancelLongPressHandle()
|
|
||||||
|
|
||||||
if (isDoubleTapPerformed) {
|
|
||||||
isDoubleTapPerformed = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmpScale > 0) {
|
|
||||||
if (tmpScale < initialScale || tmpScale > SCALE_MAX) {
|
|
||||||
tmpScale = tmpScale < initialScale ? initialScale : SCALE_MAX
|
|
||||||
Animated.timing(scaleValue, {
|
|
||||||
toValue: tmpScale,
|
|
||||||
duration: 100,
|
|
||||||
useNativeDriver: true
|
|
||||||
}).start()
|
|
||||||
}
|
|
||||||
|
|
||||||
currentScale = tmpScale
|
|
||||||
tmpScale = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmpTranslate) {
|
|
||||||
const { x, y } = tmpTranslate
|
|
||||||
const [topBound, leftBound, bottomBound, rightBound] =
|
|
||||||
getBounds(currentScale)
|
|
||||||
|
|
||||||
let nextTranslateX = x
|
|
||||||
let nextTranslateY = y
|
|
||||||
|
|
||||||
if (!fitsScreenByWidth()) {
|
|
||||||
if (nextTranslateX > leftBound) {
|
|
||||||
nextTranslateX = leftBound
|
|
||||||
} else if (nextTranslateX < rightBound) {
|
|
||||||
nextTranslateX = rightBound
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fitsScreenByHeight()) {
|
|
||||||
if (nextTranslateY > topBound) {
|
|
||||||
nextTranslateY = topBound
|
|
||||||
} else if (nextTranslateY < bottomBound) {
|
|
||||||
nextTranslateY = bottomBound
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Animated.parallel([
|
|
||||||
Animated.timing(translateValue.x, {
|
|
||||||
toValue: nextTranslateX,
|
|
||||||
duration: 100,
|
|
||||||
useNativeDriver: true
|
|
||||||
}),
|
|
||||||
Animated.timing(translateValue.y, {
|
|
||||||
toValue: nextTranslateY,
|
|
||||||
duration: 100,
|
|
||||||
useNativeDriver: true
|
|
||||||
})
|
|
||||||
]).start()
|
|
||||||
|
|
||||||
currentTranslate = { x: nextTranslateX, y: nextTranslateY }
|
|
||||||
tmpTranslate = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const panResponder = useMemo(() => createPanResponder(handlers), [handlers])
|
|
||||||
|
|
||||||
return [panResponder.panHandlers, scaleValue, translateValue]
|
|
||||||
}
|
|
||||||
|
|
||||||
export default usePanResponder
|
|
@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { useState } from 'react'
|
|
||||||
|
|
||||||
const useRequestClose = (onRequestClose: () => void) => {
|
|
||||||
const [opacity, setOpacity] = useState(1)
|
|
||||||
|
|
||||||
return [
|
|
||||||
opacity,
|
|
||||||
() => {
|
|
||||||
setOpacity(0)
|
|
||||||
onRequestClose()
|
|
||||||
}
|
|
||||||
] as const
|
|
||||||
}
|
|
||||||
|
|
||||||
export default useRequestClose
|
|
@ -1,147 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) JOB TODAY S.A. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {
|
|
||||||
Animated,
|
|
||||||
GestureResponderEvent,
|
|
||||||
PanResponder,
|
|
||||||
PanResponderGestureState,
|
|
||||||
PanResponderInstance,
|
|
||||||
NativeTouchEvent
|
|
||||||
} from 'react-native'
|
|
||||||
import { Dimensions, Position } from './@types'
|
|
||||||
|
|
||||||
export const getImageTransform = (
|
|
||||||
image: Dimensions | null,
|
|
||||||
screen: Dimensions
|
|
||||||
) => {
|
|
||||||
if (!image?.width || !image?.height) {
|
|
||||||
return [] as const
|
|
||||||
}
|
|
||||||
|
|
||||||
const wScale = screen.width / image.width
|
|
||||||
const hScale = screen.height / image.height
|
|
||||||
const scale = Math.min(wScale, hScale)
|
|
||||||
const { x, y } = getImageTranslate(image, screen)
|
|
||||||
|
|
||||||
return [{ x, y }, scale] as const
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getImageStyles = (
|
|
||||||
image: Dimensions | null,
|
|
||||||
translate: Animated.ValueXY,
|
|
||||||
scale?: Animated.Value
|
|
||||||
) => {
|
|
||||||
if (!image?.width || !image?.height) {
|
|
||||||
return { width: 0, height: 0 }
|
|
||||||
}
|
|
||||||
|
|
||||||
const transform = translate.getTranslateTransform()
|
|
||||||
|
|
||||||
if (scale) {
|
|
||||||
// @ts-ignore
|
|
||||||
transform.push({ scale }, { perspective: new Animated.Value(1000) })
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
width: image.width,
|
|
||||||
height: image.height,
|
|
||||||
transform
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getImageTranslate = (
|
|
||||||
image: Dimensions,
|
|
||||||
screen: Dimensions
|
|
||||||
): Position => {
|
|
||||||
const getTranslateForAxis = (axis: 'x' | 'y'): number => {
|
|
||||||
const imageSize = axis === 'x' ? image.width : image.height
|
|
||||||
const screenSize = axis === 'x' ? screen.width : screen.height
|
|
||||||
|
|
||||||
return (screenSize - imageSize) / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
x: getTranslateForAxis('x'),
|
|
||||||
y: getTranslateForAxis('y')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getImageDimensionsByTranslate = (
|
|
||||||
translate: Position,
|
|
||||||
screen: Dimensions
|
|
||||||
): Dimensions => ({
|
|
||||||
width: screen.width - translate.x * 2,
|
|
||||||
height: screen.height - translate.y * 2
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getImageTranslateForScale = (
|
|
||||||
currentTranslate: Position,
|
|
||||||
targetScale: number,
|
|
||||||
screen: Dimensions
|
|
||||||
): Position => {
|
|
||||||
const { width, height } = getImageDimensionsByTranslate(
|
|
||||||
currentTranslate,
|
|
||||||
screen
|
|
||||||
)
|
|
||||||
|
|
||||||
const targetImageDimensions = {
|
|
||||||
width: width * targetScale,
|
|
||||||
height: height * targetScale
|
|
||||||
}
|
|
||||||
|
|
||||||
return getImageTranslate(targetImageDimensions, screen)
|
|
||||||
}
|
|
||||||
|
|
||||||
type HandlerType = (
|
|
||||||
event: GestureResponderEvent,
|
|
||||||
state: PanResponderGestureState
|
|
||||||
) => void
|
|
||||||
|
|
||||||
type PanResponderProps = {
|
|
||||||
onGrant: HandlerType
|
|
||||||
onStart?: HandlerType
|
|
||||||
onMove: HandlerType
|
|
||||||
onRelease?: HandlerType
|
|
||||||
onTerminate?: HandlerType
|
|
||||||
}
|
|
||||||
|
|
||||||
export const createPanResponder = ({
|
|
||||||
onGrant,
|
|
||||||
onStart,
|
|
||||||
onMove,
|
|
||||||
onRelease,
|
|
||||||
onTerminate
|
|
||||||
}: PanResponderProps): PanResponderInstance =>
|
|
||||||
PanResponder.create({
|
|
||||||
onStartShouldSetPanResponder: () => true,
|
|
||||||
onStartShouldSetPanResponderCapture: () => true,
|
|
||||||
onMoveShouldSetPanResponder: () => true,
|
|
||||||
onMoveShouldSetPanResponderCapture: () => true,
|
|
||||||
onPanResponderGrant: onGrant,
|
|
||||||
onPanResponderStart: onStart,
|
|
||||||
onPanResponderMove: onMove,
|
|
||||||
onPanResponderRelease: onRelease,
|
|
||||||
onPanResponderTerminate: onTerminate,
|
|
||||||
onPanResponderTerminationRequest: () => false,
|
|
||||||
onShouldBlockNativeResponder: () => false
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getDistanceBetweenTouches = (
|
|
||||||
touches: NativeTouchEvent[]
|
|
||||||
): number => {
|
|
||||||
const [a, b] = touches
|
|
||||||
|
|
||||||
if (a == null || b == null) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.sqrt(
|
|
||||||
Math.pow(a.pageX - b.pageX, 2) + Math.pow(a.pageY - b.pageY, 2)
|
|
||||||
)
|
|
||||||
}
|
|
@ -1,4 +1,5 @@
|
|||||||
import analytics from '@components/analytics'
|
import analytics from '@components/analytics'
|
||||||
|
import GracefullyImage from '@components/GracefullyImage'
|
||||||
import { HeaderCenter, HeaderLeft, HeaderRight } from '@components/Header'
|
import { HeaderCenter, HeaderLeft, HeaderRight } from '@components/Header'
|
||||||
import { Message } from '@components/Message'
|
import { Message } from '@components/Message'
|
||||||
import { useActionSheet } from '@expo/react-native-action-sheet'
|
import { useActionSheet } from '@expo/react-native-action-sheet'
|
||||||
@ -6,15 +7,29 @@ import { RootStackScreenProps } from '@utils/navigation/navigators'
|
|||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useCallback, useRef, useState } from 'react'
|
import React, { useCallback, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Platform, Share, StatusBar, View } from 'react-native'
|
import {
|
||||||
|
Dimensions,
|
||||||
|
FlatList,
|
||||||
|
PixelRatio,
|
||||||
|
Platform,
|
||||||
|
Share,
|
||||||
|
StatusBar,
|
||||||
|
View,
|
||||||
|
ViewToken
|
||||||
|
} from 'react-native'
|
||||||
import FlashMessage from 'react-native-flash-message'
|
import FlashMessage from 'react-native-flash-message'
|
||||||
import {
|
import {
|
||||||
SafeAreaProvider,
|
Directions,
|
||||||
useSafeAreaInsets
|
FlingGestureHandler,
|
||||||
} from 'react-native-safe-area-context'
|
LongPressGestureHandler,
|
||||||
import ImageViewer from './ImageViewer/Root'
|
State
|
||||||
|
} from 'react-native-gesture-handler'
|
||||||
|
import { Zoom, createZoomListComponent } from 'react-native-reanimated-zoom'
|
||||||
|
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||||
import saveImage from './ImageViewer/save'
|
import saveImage from './ImageViewer/save'
|
||||||
|
|
||||||
|
const ZoomFlatList = createZoomListComponent(FlatList)
|
||||||
|
|
||||||
const ScreenImagesViewer = ({
|
const ScreenImagesViewer = ({
|
||||||
route: {
|
route: {
|
||||||
params: { imageUrls, id }
|
params: { imageUrls, id }
|
||||||
@ -26,6 +41,9 @@ const ScreenImagesViewer = ({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SCREEN_WIDTH = Dimensions.get('screen').width
|
||||||
|
const SCREEN_HEIGHT = Dimensions.get('screen').height
|
||||||
|
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
|
|
||||||
const { mode, theme } = useTheme()
|
const { mode, theme } = useTheme()
|
||||||
@ -34,6 +52,7 @@ const ScreenImagesViewer = ({
|
|||||||
const initialIndex = imageUrls.findIndex(image => image.id === id)
|
const initialIndex = imageUrls.findIndex(image => image.id === id)
|
||||||
const [currentIndex, setCurrentIndex] = useState(initialIndex)
|
const [currentIndex, setCurrentIndex] = useState(initialIndex)
|
||||||
|
|
||||||
|
const listRef = useRef<FlatList>(null)
|
||||||
const messageRef = useRef<FlashMessage>(null)
|
const messageRef = useRef<FlashMessage>(null)
|
||||||
|
|
||||||
const { showActionSheetWithOptions } = useActionSheet()
|
const { showActionSheetWithOptions } = useActionSheet()
|
||||||
@ -71,15 +90,95 @@ const ScreenImagesViewer = ({
|
|||||||
)
|
)
|
||||||
}, [currentIndex])
|
}, [currentIndex])
|
||||||
|
|
||||||
|
const renderItem = React.useCallback(
|
||||||
|
({
|
||||||
|
item
|
||||||
|
}: {
|
||||||
|
item: RootStackScreenProps<'Screen-ImagesViewer'>['route']['params']['imageUrls'][0]
|
||||||
|
}) => {
|
||||||
|
const screenRatio = SCREEN_WIDTH / SCREEN_HEIGHT
|
||||||
|
const imageRatio = item.width && item.height ? item.width / item.height : 1
|
||||||
|
const imageWidth = item.width || 100
|
||||||
|
const imageHeight = item.height || 100
|
||||||
|
|
||||||
|
const maxWidthScale = item.width ? (item.width / SCREEN_WIDTH / PixelRatio.get()) * 4 : 0
|
||||||
|
const maxHeightScale = item.height ? (item.height / SCREEN_WIDTH / PixelRatio.get()) * 4 : 0
|
||||||
|
const max = Math.max.apply(Math, [maxWidthScale, maxHeightScale, 4])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaProvider>
|
<Zoom
|
||||||
|
maximumZoomScale={max > 8 ? 8 : max}
|
||||||
|
children={
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
width: SCREEN_WIDTH,
|
||||||
|
height: SCREEN_HEIGHT,
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<GracefullyImage
|
||||||
|
uri={{ preview: item.preview_url, remote: item.remote_url, original: item.url }}
|
||||||
|
blurhash={item.blurhash}
|
||||||
|
dimension={{
|
||||||
|
width:
|
||||||
|
screenRatio > imageRatio
|
||||||
|
? (SCREEN_HEIGHT / imageHeight) * imageWidth
|
||||||
|
: SCREEN_WIDTH,
|
||||||
|
height:
|
||||||
|
screenRatio > imageRatio
|
||||||
|
? SCREEN_HEIGHT
|
||||||
|
: (SCREEN_WIDTH / imageWidth) * imageHeight
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
|
||||||
|
const onViewableItemsChanged = useCallback(
|
||||||
|
({ viewableItems }: { viewableItems: ViewToken[] }) => {
|
||||||
|
setCurrentIndex(viewableItems[0].index || 0)
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaProvider style={{ backgroundColor: 'black' }}>
|
||||||
<StatusBar hidden />
|
<StatusBar hidden />
|
||||||
<ImageViewer
|
<View
|
||||||
images={imageUrls}
|
style={{
|
||||||
imageIndex={initialIndex}
|
flexDirection: 'row',
|
||||||
onImageIndexChange={index => setCurrentIndex(index)}
|
justifyContent: 'space-between',
|
||||||
onRequestClose={() => navigation.goBack()}
|
alignItems: 'center',
|
||||||
onLongPress={() => {
|
marginTop: insets.top,
|
||||||
|
position: 'absolute',
|
||||||
|
width: '100%',
|
||||||
|
zIndex: 999
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<HeaderLeft content='X' native={false} background onPress={() => navigation.goBack()} />
|
||||||
|
<HeaderCenter inverted content={`${currentIndex + 1} / ${imageUrls.length}`} />
|
||||||
|
<HeaderRight
|
||||||
|
accessibilityLabel={t('content.actions.accessibilityLabel')}
|
||||||
|
accessibilityHint={t('content.actions.accessibilityHint')}
|
||||||
|
content='MoreHorizontal'
|
||||||
|
native={false}
|
||||||
|
background
|
||||||
|
onPress={onPress}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<FlingGestureHandler
|
||||||
|
direction={Directions.DOWN}
|
||||||
|
numberOfPointers={1}
|
||||||
|
onEnded={() => navigation.goBack()}
|
||||||
|
>
|
||||||
|
<LongPressGestureHandler
|
||||||
|
onEnded={() => {
|
||||||
analytics('imageviewer_more_press')
|
analytics('imageviewer_more_press')
|
||||||
showActionSheetWithOptions(
|
showActionSheetWithOptions(
|
||||||
{
|
{
|
||||||
@ -118,37 +217,26 @@ const ScreenImagesViewer = ({
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
HeaderComponent={() => (
|
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
marginTop: insets.top
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<HeaderLeft
|
<ZoomFlatList
|
||||||
content='X'
|
data={imageUrls}
|
||||||
native={false}
|
pagingEnabled
|
||||||
background
|
horizontal
|
||||||
onPress={() => navigation.goBack()}
|
keyExtractor={item => item.id}
|
||||||
/>
|
renderItem={renderItem}
|
||||||
<HeaderCenter
|
onViewableItemsChanged={onViewableItemsChanged}
|
||||||
inverted
|
viewabilityConfig={{
|
||||||
content={`${currentIndex + 1} / ${imageUrls.length}`}
|
itemVisiblePercentThreshold: 50
|
||||||
/>
|
}}
|
||||||
<HeaderRight
|
initialScrollIndex={initialIndex}
|
||||||
accessibilityLabel={t('content.actions.accessibilityLabel')}
|
getItemLayout={(_, index) => ({
|
||||||
accessibilityHint={t('content.actions.accessibilityHint')}
|
length: SCREEN_WIDTH,
|
||||||
content='MoreHorizontal'
|
offset: SCREEN_WIDTH * index,
|
||||||
native={false}
|
index
|
||||||
background
|
})}
|
||||||
onPress={onPress}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
|
</LongPressGestureHandler>
|
||||||
|
</FlingGestureHandler>
|
||||||
<Message ref={messageRef} />
|
<Message ref={messageRef} />
|
||||||
</SafeAreaProvider>
|
</SafeAreaProvider>
|
||||||
)
|
)
|
||||||
|
@ -7081,6 +7081,11 @@ react-native-pager-view@^5.4.25:
|
|||||||
resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-5.4.25.tgz#cd639d5387a7f3d5581b55a33c5faa1cbc200f97"
|
resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-5.4.25.tgz#cd639d5387a7f3d5581b55a33c5faa1cbc200f97"
|
||||||
integrity sha512-3drrYwaLat2fYszymZe3nHMPASJ4aJMaxiejfA1V5SK3OygYmdtmV2u5prX7TnjueJzGSyyaCYEr2JlrRt4YPg==
|
integrity sha512-3drrYwaLat2fYszymZe3nHMPASJ4aJMaxiejfA1V5SK3OygYmdtmV2u5prX7TnjueJzGSyyaCYEr2JlrRt4YPg==
|
||||||
|
|
||||||
|
react-native-reanimated-zoom@^0.3.0:
|
||||||
|
version "0.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-native-reanimated-zoom/-/react-native-reanimated-zoom-0.3.0.tgz#181825c1854853a4db33a86e521057e2e757d290"
|
||||||
|
integrity sha512-kvYVbLayX8Tj52oDmKE78gnEmZD5KsCHxkTSrMfahq9KyqU6aHWistfocFtzBBT+I0puzcHpivzy3dxYL1SL5Q==
|
||||||
|
|
||||||
react-native-reanimated@^2.9.1:
|
react-native-reanimated@^2.9.1:
|
||||||
version "2.9.1"
|
version "2.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.9.1.tgz#d9a932e312c13c05b4f919e43ebbf76d996e0bc1"
|
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.9.1.tgz#d9a932e312c13c05b4f919e43ebbf76d996e0bc1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user