Skip to content

Commit

Permalink
chore:
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock committed Apr 6, 2024
1 parent 240da6d commit 9ce0a38
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ android {
applicationId "com.satoriapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode 2
versionName "0.0.0"
}
signingConfigs {
debug {
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
"test": "jest",
"debug-key": "adb shell input keyevent 82",
"release": "react-native run-android --mode=release"
},
"dependencies": {
"@pchmn/expo-material3-theme": "^1.3.2",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-native-camera-roll/camera-roll": "^7.5.2",
"@react-native-clipboard/clipboard": "^1.14.0",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"cosmokit": "^1.5.2",
Expand All @@ -30,7 +31,8 @@
"react-native-use-persist-storage": "^1.0.2",
"react-native-vector-icons": "^10.0.3",
"react-navigation": "^5.0.0",
"zustand": "^4.5.2"
"zustand": "^4.5.2",
"@react-native-clipboard/clipboard": "^1.14.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
6 changes: 4 additions & 2 deletions src/components/elements/img.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useState } from "react"
import { useEffect, useState } from "react"
import { Image, Modal, PermissionsAndroid, Platform } from "react-native"
import { Card, TouchableRipple } from "react-native-paper"
import ImageViewer from 'react-native-image-zoom-viewer';
import { CameraRoll } from '@react-native-camera-roll/camera-roll'
import Animated, { useSharedValue, withTiming } from "react-native-reanimated";


async function hasAndroidPermission() {
Expand Down Expand Up @@ -66,12 +67,13 @@ export const Img = ({ src }) => {
console.log(e.nativeEvent.source.width * scale, e.nativeEvent.source.height * scale)
}} />
</TouchableRipple>
<Modal visible={visible}>
<Modal visible={visible} transparent>
<ImageViewer imageUrls={[{ url: src }]}
onCancel={() => setIsVisible(false)}
onSwipeDown={() => setIsVisible(false)}
onClick={() => setIsVisible(false)}
enableSwipeDown={true}
backgroundColor="#00000099"
menuContext={{ "saveToLocal": "保存图片", "cancel": "取消" }}
onSave={async e => {
if (Platform.OS === "android" && !(await hasAndroidPermission())) {
Expand Down
11 changes: 8 additions & 3 deletions src/screens/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ const Message = memo(({ message }: { message: SaMessage }) => {
setMenuVisible(false)
const inspect = v => JSON.stringify(v, null, 4)
Alert.alert('消息信息',
`Sender ${inspect(message.user)}
Channel ${inspect(message.channel)}
Content ${inspect(content)}`)
`
ID ${message.id}
Sender ${inspect(message.user)}
Channel ${inspect(message.channel)}
Content ${inspect(content)}`)
}} title="详细信息" />
</Menu>
</>
Expand Down Expand Up @@ -226,6 +228,9 @@ export const Chat = ({
}} title="清除当前聊天数据" />
</Menu>
<FlatList
removeClippedSubviews
maxToRenderPerBatch={5}
windowSize={8}
ref={flatListRef}
data={[...messages].reverse()}
inverted
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5784,6 +5784,11 @@ react-native-image-zoom-viewer@^3.0.1:
dependencies:
react-native-image-pan-zoom "^2.1.12"

react-native-lightbox-v2@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/react-native-lightbox-v2/-/react-native-lightbox-v2-0.9.0.tgz#b97be4d892ebb959069c451948b11da390bc46d8"
integrity sha512-Fc5VFHFj2vokS+OegyTsANKb1CYoUlOtAv+EBH5wtpJn1b5cey6jVXH7136G5+8OC9JmKWSgKHc5thFwOoZTUg==

react-native-paper@^5.12.3:
version "5.12.3"
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-5.12.3.tgz#d583119722ebbfbb7fe40400181d63748cca3683"
Expand Down

0 comments on commit 9ce0a38

Please sign in to comment.