Skip to content

Commit

Permalink
chor
Browse files Browse the repository at this point in the history
  • Loading branch information
tingyuan committed Oct 9, 2024
1 parent 07aed87 commit 0913f1a
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions src/routes/About/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { Button, Icon, Text } from '@rneui/themed'
import React from 'react'
import { Image, Linking, View } from 'react-native'
import { Image, Linking, Pressable, View } from 'react-native'

import { githubLink } from '../../constants'
import { githubLink, site } from '../../constants'

export default React.memo(Header)

function Header() {
return (
<>
<View className="mb-4 flex-1 items-center">
<Pressable
className="mb-5 mt-1 flex-1 items-center"
onPress={() => {
Linking.openURL(site)
}}>
<Image
source={require('../../../assets/minibili.png')}
className="aspect-[33/10] h-auto w-[85%]"
/>
</View>
</Pressable>
<View className="flex-row items-center justify-between mb-2">
<Text className="text-2xl shrink" numberOfLines={2}>
一款简单的B站浏览App
Expand Down
70 changes: 62 additions & 8 deletions src/routes/About/Feedback.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Dialog, Input } from '@rneui/themed'
import { BottomSheet, Button, Card, Dialog, Input, Text } from '@rneui/themed'
import React from 'react'
import { Share, View } from 'react-native'
import { Linking, View } from 'react-native'

import Modal2 from '@/components/Modal2'
import { colors } from '@/constants/colors.tw'
import { useStore } from '@/store'

import { site } from '../../constants'
import { githubLink } from '../../constants'
import { showToast } from '../../utils'
import { reportUserFeedback } from '../../utils/report'
import TextAction from './TextAction'
Expand All @@ -14,6 +15,10 @@ export default React.memo(Feedback)

function Feedback() {
const [feedBackVisible, setFeedbackVisible] = React.useState(false)
const { get$showUsageStatement, set$showUsageStatement } = useStore()
const [showStatement, setShowStatement] = React.useState(
get$showUsageStatement(),
)
const hideFeedback = () => {
setFeedbackVisible(false)
}
Expand All @@ -35,14 +40,12 @@ function Feedback() {
}
return (
<TextAction
text="💗 欢迎分享本应用"
text="💗 欢迎使用本应用"
buttons={[
{
text: '分享',
text: '使用声明',
onPress: () => {
Share.share({
message: `MiniBili - 简单的B站浏览\n点击下载:${site}`,
})
setShowStatement(true)
},
},
{
Expand Down Expand Up @@ -82,6 +85,57 @@ function Feedback() {
<Dialog.Button title="取消" onPress={hideFeedback} />
</Dialog.Actions>
</Dialog>
<BottomSheet
onBackdropPress={() => {
setShowStatement(false)
}}
backdropStyle={tw('opacity-80 bg-gray-800')}
modalProps={{
onRequestClose: () => {
setShowStatement(false)
},
statusBarTranslucent: true,
}}
isVisible={showStatement}>
<Card containerStyle={tw('m-0')}>
<Card.Title h4 className="text-left">
📣使用声明
</Card.Title>
<Card.Divider />
<View>
<Text className="text-base">感谢你使用这款应用(MiniBili) ❤</Text>
<Text />
<Text className="text-base">
本应用完全开源并且所有数据均为B站官网公开,不涉及任何个人隐私数据,
<Text className="font-bold">*仅供*</Text>
个人使用及学习交流!
</Text>
<Text className="text-base">
有问题欢迎使用意见反馈或者在
<Text
className={colors.primary.text}
onPress={() => {
Linking.openURL(githubLink)
}}>
{' Github '}
</Text>
中提出 😀
</Text>
<Text />
<Text className="text-base">⚠️ 切勿频繁刷新数据!🙏</Text>
<View className="items-end my-3">
<Button
size="sm"
onPress={() => {
set$showUsageStatement(false)
setShowStatement(false)
}}>
{' 我已知晓 '}
</Button>
</View>
</View>
</Card>
</BottomSheet>
</TextAction>
)
}
10 changes: 6 additions & 4 deletions src/routes/About/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button } from '@rneui/themed'
import { Button, Icon } from '@rneui/themed'
import React from 'react'
import { Linking } from 'react-native'
import { Share } from 'react-native'

import { site } from '@/constants'

Expand All @@ -9,8 +9,10 @@ export const headerRight = () => (
type="clear"
size="sm"
onPress={() => {
Linking.openURL(site)
Share.share({
message: `MiniBili - 简单的B站浏览\n点击下载:${site}`,
})
}}>
更新日志
<Icon name="share" type="material-community" />
</Button>
)
8 changes: 8 additions & 0 deletions src/routes/About/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import * as Updates from 'expo-updates'
import React from 'react'
import { Alert, Linking } from 'react-native'

import { site } from '@/constants'

import {
checkUpdate as checkUpdateApi,
currentVersion,
Expand Down Expand Up @@ -75,6 +77,12 @@ function Version() {
loading: checkingUpdate,
onPress: checkUpdate,
},
{
text: '更新日志',
onPress: () => {
Linking.openURL(site + '?showchangelog')
},
},
]}
/>
)
Expand Down
2 changes: 0 additions & 2 deletions src/routes/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Feedback from './Feedback'
import History from './History'
import Music from './Music'
import SortCate from './SortCate'
import Statement from './Statement'
import Version from './Version'

export default React.memo(About)
Expand All @@ -28,7 +27,6 @@ function About() {
<Collect />
<History />
<Music />
<Statement />
</View>
<Divider className="my-4" />
<BlackTags />
Expand Down
3 changes: 1 addition & 2 deletions src/routes/Follow/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useNavigation } from '@react-navigation/native'
import { Icon } from '@rneui/base'
import { Button } from '@rneui/themed'
import { Button, Icon } from '@rneui/themed'
import React from 'react'
import { View } from 'react-native'

Expand Down
10 changes: 8 additions & 2 deletions website/components/top-nav.htm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav class="flex gap-2 items-center absolute top-2 right-4">
<button
@click=" changeLogModal.showModal(); getChangelogs()"
@click="showChangeLog"
class="btn btn-ghost btn-sm btn-success font-normal text-neutral-600 hover:text-neutral-900">
更新日志
</button>
Expand Down Expand Up @@ -61,7 +61,13 @@ <h3 class="text-lg font-bold text-left">更新日志</h3>
function setup() {
return {
changeLogs: [],
getChangelogs() {
init() {
if (location.search.includes('showchangelog')) {
this.showChangeLog()
}
},
showChangeLog() {
changeLogModal.showModal()
if (this.changeLogs.length) {
return
}
Expand Down

0 comments on commit 0913f1a

Please sign in to comment.