-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
298 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
Enjoy toooting! This version includes following improvements and fixes: | ||
- Added Belarusian language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
toooting愉快!此版本包括以下改进和修复: | ||
- 新增白俄罗斯语 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <RCTAppDelegate.h> | ||
#import <UIKit/UIKit.h> | ||
|
||
#import <Expo/Expo.h> | ||
|
||
@interface AppDelegate : RCTAppDelegate | ||
@interface AppDelegate : EXAppDelegateWrapper | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "tooot", | ||
"version": "4.9.1", | ||
"version": "4.9.2", | ||
"description": "tooot for Mastodon", | ||
"author": "xmflsct <[email protected]>", | ||
"license": "GPL-3.0-or-later", | ||
|
@@ -88,7 +88,6 @@ | |
"react-native-swipe-list-view": "^3.2.9", | ||
"react-native-tab-view": "^3.5.1", | ||
"rn-placeholder": "^3.0.3", | ||
"url-parse": "^1.5.10", | ||
"zeego": "^1.3.1" | ||
}, | ||
"devDependencies": { | ||
|
@@ -102,7 +101,6 @@ | |
"@types/react": "^18.0.28", | ||
"@types/react-dom": "^18.0.11", | ||
"@types/react-native-share-menu": "^5.0.2", | ||
"@types/url-parse": "^1.4.8", | ||
"babel-plugin-module-resolver": "^5.0.0", | ||
"babel-plugin-transform-remove-console": "^6.9.4", | ||
"chalk": "^4.1.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
import GracefullyImage from '@components/GracefullyImage' | ||
import openLink from '@components/openLink' | ||
import CustomText from '@components/Text' | ||
import { useNeodbQuery } from '@utils/queryHooks/neodb' | ||
import { StyleConstants } from '@utils/styles/constants' | ||
import { useTheme } from '@utils/styles/ThemeManager' | ||
import * as Linking from 'expo-linking' | ||
import { Pressable, View } from 'react-native' | ||
|
||
export const CardNeodb = ({ card }: { card: Mastodon.Card }) => { | ||
const { colors } = useTheme() | ||
|
||
const segments = Linking.parse(card.url).path?.split('/') | ||
if (!segments || !(segments[0] === 'movie' || segments[0] === 'book')) return null | ||
|
||
const { data } = useNeodbQuery({ path: `${segments[0]}/${segments[1]}` }) | ||
|
||
if (!data) return null | ||
|
||
switch (segments[0]) { | ||
case 'movie': | ||
return ( | ||
<Pressable | ||
style={{ | ||
marginTop: StyleConstants.Spacing.S, | ||
backgroundColor: colors.shimmerDefault, | ||
borderRadius: StyleConstants.BorderRadius, | ||
padding: StyleConstants.Spacing.S, | ||
flexDirection: 'row' | ||
}} | ||
onPress={() => openLink(card.url)} | ||
> | ||
<GracefullyImage | ||
sources={{ default: { uri: `https://neodb.social${data.image}` } }} | ||
dimension={{ | ||
width: StyleConstants.Font.LineHeight.M * 4, | ||
height: StyleConstants.Font.LineHeight.M * 5 | ||
}} | ||
style={{ marginRight: StyleConstants.Spacing.S }} | ||
imageStyle={{ borderRadius: StyleConstants.BorderRadius / 2 }} | ||
dim | ||
/> | ||
<View style={{ flex: 1, gap: StyleConstants.Spacing.S }}> | ||
<CustomText | ||
fontStyle='S' | ||
fontWeight='Bold' | ||
style={{ color: colors.primaryDefault }} | ||
numberOfLines={3} | ||
> | ||
{[ | ||
data.data.title, | ||
data.data.orig_title, | ||
data.data.year ? `(${data.data.year})` : null | ||
] | ||
.filter(d => d) | ||
.join(' ')} | ||
</CustomText> | ||
<CustomText fontStyle='S' style={{ color: colors.secondary }} numberOfLines={2}> | ||
{[ | ||
data.data.duration ? `${data.data.duration}分钟` : null, | ||
data.data.area?.join(' '), | ||
data.data.genre?.join(' '), | ||
data.data.director?.join(' ') | ||
] | ||
.filter(d => d) | ||
.join(' / ')} | ||
</CustomText> | ||
</View> | ||
</Pressable> | ||
) | ||
case 'book': | ||
return ( | ||
<Pressable | ||
style={{ | ||
marginTop: StyleConstants.Spacing.S, | ||
backgroundColor: colors.shimmerDefault, | ||
borderRadius: StyleConstants.BorderRadius, | ||
padding: StyleConstants.Spacing.S, | ||
flexDirection: 'row' | ||
}} | ||
onPress={() => openLink(card.url)} | ||
> | ||
<GracefullyImage | ||
sources={{ default: { uri: `https://neodb.social${data.image}` } }} | ||
dimension={{ | ||
width: StyleConstants.Font.LineHeight.M * 4, | ||
height: StyleConstants.Font.LineHeight.M * 5 | ||
}} | ||
style={{ marginRight: StyleConstants.Spacing.S }} | ||
imageStyle={{ borderRadius: StyleConstants.BorderRadius / 2 }} | ||
dim | ||
/> | ||
<View style={{ flex: 1, gap: StyleConstants.Spacing.S }}> | ||
<CustomText | ||
fontStyle='S' | ||
fontWeight='Bold' | ||
style={{ color: colors.primaryDefault }} | ||
numberOfLines={3} | ||
> | ||
{[ | ||
data.data.title, | ||
data.data.pub_year && data.data.pub_month | ||
? `(${data.data.pub_year}年${data.data.pub_month}月)` | ||
: null | ||
] | ||
.filter(d => d) | ||
.join(' ')} | ||
</CustomText> | ||
<CustomText fontStyle='S' style={{ color: colors.secondary }} numberOfLines={2}> | ||
{[ | ||
data.data.author?.join(' '), | ||
data.data.language, | ||
data.data.pages ? `${data.data.pages}页` : null, | ||
data.data.pub_house | ||
] | ||
.filter(d => d) | ||
.join(' / ')} | ||
</CustomText> | ||
</View> | ||
</Pressable> | ||
) | ||
default: | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.