Skip to content

Commit

Permalink
- 修复了若干用户反馈的小问题
Browse files Browse the repository at this point in the history
  • Loading branch information
czy0729 committed Apr 2, 2023
1 parent 85e0822 commit 4fbe3fb
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 34 deletions.
4 changes: 2 additions & 2 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-06-02 14:42:28
* @Last Modified by: czy0729
* @Last Modified time: 2023-04-01 13:01:29
* @Last Modified time: 2023-04-02 08:47:14
*/
import { Paths } from '@types'

Expand All @@ -28,7 +28,7 @@ export const TEXT_ONLY = DEV ? DEV : false
const CONFIGS: Configs = {
initialRouteName: 'HomeTab', // HomeTab
initialRouteParams: {
// subjectId: 393217 // anime: 296870, music: 302514, book: 267358, game: 137458
// subjectId: 393238 // anime: 296870, music: 302514, book: 267358, game: 137458
// topicId: 'group/379812' // group/366561
// userId: 456208 // 456208, 419012, 'lilyurey'
// monoId: 'character/76270' // character/70323 person/5745
Expand Down
16 changes: 13 additions & 3 deletions src/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,29 @@ export const Button = observer(
const textStyle: TextStyle[] = [styles.text]
let textBold = false

if (shadow && !_.isDark) wrapStyle.push(styles.shadow)
if ((shadow && !_.isDark && type === 'plain') || type === 'ghostPlain') {
wrapStyle.push(styles.shadow)
}

if (type) {
wrapStyle.push(styles[type])
textStyle.push(styles[`text${titleCase(type)}`])
}
if (radius) wrapStyle.push(styles.radius)

if (radius) {
wrapStyle.push(styles.radius)
}

if (size) {
const textSize = `text${titleCase(size)}`
wrapStyle.push(styles[size])
textStyle.push(styles[textSize])
if (textSize === 'textSm') textBold = true
}
if (style) wrapStyle.push(style)

if (style) {
wrapStyle.push(style)
}

const content = (
<Flex justify='center'>
Expand Down
18 changes: 10 additions & 8 deletions src/components/button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,16 @@ export const memoStyles = _.memoStyles(() => ({

// other
shadow: {
shadowColor: _.colorShadow,
shadowOffset: {
width: 1,
height: 3
},
shadowOpacity: 0.16,
shadowRadius: 3,
elevation: 3
// shadowColor: _.colorShadow,
// shadowOffset: {
// width: 1,
// height: 3
// },
// shadowOpacity: 0.16,
// shadowRadius: 3,
// elevation: 3
borderWidth: 1,
borderColor: _.colorBorder
},
radius: {
borderRadius: _.radiusSm,
Expand Down
7 changes: 5 additions & 2 deletions src/components/list-view/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2021-11-30 04:24:34
* @Last Modified by: czy0729
* @Last Modified time: 2022-09-20 16:32:32
* @Last Modified time: 2023-04-02 08:28:45
*/
import React from 'react'
import { FlatList, SectionList, Animated } from 'react-native'
Expand All @@ -23,6 +23,8 @@ type PassProps = {

/** https://reactnative.dev/docs/scrollview#alwaysbouncevertical-ios */
alwaysBounceVertical: false

removeClippedSubviews: true
}

const ASectionList = Animated.createAnimatedComponent(SectionList)
Expand All @@ -43,7 +45,8 @@ function List({
...other,
overScrollMode: 'never',
alwaysBounceHorizontal: false,
alwaysBounceVertical: false
alwaysBounceVertical: false,
removeClippedSubviews: true
}

if (sections) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2022-05-01 11:46:08
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-11 15:51:24
* @Last Modified time: 2023-04-02 08:39:38
*/
import React from 'react'
import { Text as RNText } from 'react-native'
Expand Down Expand Up @@ -78,6 +78,7 @@ function CompText(
{...other}
suppressHighlighting
textBreakStrategy='simple'
// @ts-expect-error
android_hyphenationFrequency='none'
>
{systemStore.setting.s2t ? format(children) : children}
Expand Down
17 changes: 16 additions & 1 deletion src/screens/_/base/auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,26 @@ export const Auth = obc((props, { navigation }) => (
<Touchable style={styles.zhinan} onPress={() => open(URL_ZHINAN)}>
<Flex>
<Iconfont name='md-chrome-reader-mode' color={_.colorDesc} size={20} />
<Text style={_.ml.sm} size={13}>
<Text style={_.ml.sm} size={13} lineHeight={14}>
指南
</Text>
</Flex>
</Touchable>
<IconTouchable
style={_.mr.xs}
name={_.isDark ? 'ios-moon' : 'ios-sunny'}
color={_.colorDesc}
size={22}
onPress={() => {
setTimeout(() => {
_.toggleMode()

setTimeout(() => {
if (_.mode !== _.tinygrailThemeMode) _.toggleTinygrailThemeMode()
}, 40)
}, 40)
}}
/>
<Flex.Item />
<IconTouchable
style={_.mr.xs}
Expand Down
1 change: 0 additions & 1 deletion src/screens/_/base/auth/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const styles = _.create({
},
zhinan: {
padding: _.sm,
marginTop: -_.sm,
borderRadius: _.radiusSm,
overflow: 'hidden'
},
Expand Down
20 changes: 19 additions & 1 deletion src/screens/_/base/avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ export const Avatar = ob(
_src = _src.replace(USER_MEDIUM, USER_LARGE)
}

_src = fixed(_src)

if (isUrl && !_src.includes(USER_LARGE) && !_src.includes(HOST_API_V0)) {
fallback = true
}
Expand All @@ -189,7 +191,7 @@ export const Avatar = ob(
quality: false,
placeholder: placeholder,
fallback: fallback,
fallbackSrc: String(fallbackSrc || src)
fallbackSrc: fixed(String(fallbackSrc || src))
}
if (_onPress || onLongPress) {
return (
Expand All @@ -209,3 +211,19 @@ export const Avatar = ob(
return <Image {...passProps} />
}
)

/**
* 网页端新出的图片规则, 需要处理一下
* please use '/r/<size>/pic/cover/l/' path instead
* @date 2023-04-02
*/
function fixed(src: any) {
if (typeof src === 'string') {
return src.replace(
/\/r\/(\d+)x(\d+)\/pic\/cover\/(s|c|m)\//g,
'/r/$1x$2/pic/cover/l/'
)
}

return src
}
7 changes: 5 additions & 2 deletions src/screens/_/base/likes-grid/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export const memoStyles = _.memoStyles(() => {
container: {
width,
height: width * 0.8,
backgroundColor: _.select('rgba(0, 0, 0, 0.08)', 'rgba(255, 255, 255, 0.24)'),
backgroundColor: _.select(
`rgba(0, 0, 0, ${_.ios('0.08', '0.16')})`,
`rgba(255, 255, 255, ${_.ios('0.24', '0.05')})`
),
borderRadius: _.radiusSm,
overflow: 'hidden'
},
Expand All @@ -32,7 +35,7 @@ export const memoStyles = _.memoStyles(() => {
height: width * 0.2
},
itemActive: {
backgroundColor: 'rgba(254, 138, 149, 0.28)'
backgroundColor: 'rgba(254, 138, 149, 0.12)'
}
}
})
7 changes: 6 additions & 1 deletion src/screens/_/base/likes/btn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ function Btn({ topicId, id, formhash, ...item }) {
style={stl(styles.item, item.selected && styles.itemActive)}
justify='center'
>
<BgmText size={14} index={Number(item.emoji)} selectable={false} />
<BgmText
style={styles.bgm}
size={16}
index={Number(item.emoji)}
selectable={false}
/>
<Text
style={styles.text}
size={12}
Expand Down
7 changes: 5 additions & 2 deletions src/screens/_/base/likes/btn/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import { _ } from '@stores'
export const memoStyles = _.memoStyles(() => ({
item: {
height: 28,
paddingRight: 8,
paddingRight: 9,
paddingLeft: 10,
marginRight: _.sm,
backgroundColor: _.colorBg,
borderRadius: 16
},
itemActive: {
backgroundColor: _.select('rgba(255, 208, 214, 0.5)', _.colorMainLight)
backgroundColor: _.select('rgba(255, 208, 214, 0.4)', _.colorMainLight)
},
bgm: {
marginTop: _.ios(0, 3)
},
text: {
marginLeft: 6
Expand Down
2 changes: 1 addition & 1 deletion src/screens/_/item/comment/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2022-06-17 12:43:33
* @Last Modified by: czy0729
* @Last Modified time: 2023-02-03 19:07:06
* @Last Modified time: 2023-04-02 08:46:25
*/
import React from 'react'
import { Flex, Iconfont, Text, UserStatus } from '@components'
Expand Down
6 changes: 5 additions & 1 deletion src/screens/home/mono/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export default class ScreenMono extends store {
* @opitimize 1h
* */
fetchMono = (refresh: boolean = false) => {
if (!refresh && opitimize(this.mono, 60 * 60) && this.monoComments.list.length) {
if (
refresh === true &&
opitimize(this.mono, 60 * 60) &&
this.monoComments.list.length
) {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion src/screens/home/subject/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-03-23 04:16:27
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-11 15:13:57
* @Last Modified time: 2023-04-02 08:17:53
*/
import React, { useCallback, useRef } from 'react'
import { Page, Heatmap } from '@components'
Expand Down
2 changes: 1 addition & 1 deletion src/screens/home/subject/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2020-04-06 05:41:34
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-11 14:22:52
* @Last Modified time: 2023-04-02 08:21:26
*/
import React from 'react'
import { ListView } from '@components'
Expand Down
8 changes: 4 additions & 4 deletions src/screens/home/subject/store/computed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@ export default class Computed extends State {
@computed get year() {
// 连载开始为最优先
const year =
(this.info.match(/<li><span>(连载开始): <\/span>(.+?)<\/li>/)?.[2] || '').match(
/(\d{4})/
)?.[0] || ''
(
this.info.match(/<li><span>(连载开始|开始): <\/span>(.+?)<\/li>/)?.[2] || ''
).match(/(\d{4})/)?.[0] || ''
if (year) return year

return (
(
this.info.match(
/<li><span>(发售日|放送开始|上映年度|上映时间|开始|发行日期): <\/span>(.+?)<\/li>/
/<li><span>(发售日|放送开始|上映年度|上映时间|发行日期): <\/span>(.+?)<\/li>/
)?.[2] || ''
).match(/(\d{4})/)?.[0] || ''
)
Expand Down
4 changes: 4 additions & 0 deletions src/screens/home/subject/tags/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import { Ctx } from '../types'
import { memoStyles } from './styles'
import Tags from './tags'

// function slice(target: any) {
// return target?.length ? target.slice() : target
// }

export default obc((props, { $, navigation }: Ctx) => {
global.rerender('Subject.Tags')

Expand Down
3 changes: 2 additions & 1 deletion src/screens/user/v2/list/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React, { useCallback, useMemo } from 'react'
import { Animated, View } from 'react-native'
import { Heatmap, ListView } from '@components'
import { keyExtractor } from '@utils'
import { getKeyString, keyExtractor } from '@utils'
import { memo } from '@utils/decorators'
import { useMount } from '@utils/hooks'
import FixedToolBar from '../fixed-tool-bar'
Expand Down Expand Up @@ -84,6 +84,7 @@ const List = memo(

return (
<ListView
key={getKeyString(list, numColumns)}
ref={_forwardRef}
keyExtractor={keyExtractor}
style={styles.listView}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2021-10-07 06:37:41
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-31 02:47:37
* @Last Modified time: 2023-04-02 08:16:11
*/
import { ComponentType } from 'react'
import {
Expand Down
1 change: 1 addition & 0 deletions web/package.ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"react-native-shimmer-placeholder": "^2.0.9",
"react-native-smb": "^0.2.4",
"react-native-tab-view": "2.14.3",
"react-native-text-ticker": "^1.14.0",
"react-native-web": "~0.18.7",
"react-native-webview": "11.23.0",
"react-navigation": "3.0.9",
Expand Down

0 comments on commit 4fbe3fb

Please sign in to comment.