forked from czy0729/Bangumi
-
Notifications
You must be signed in to change notification settings - Fork 0
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
43 changed files
with
685 additions
and
481 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* @Author: czy0729 | ||
* @Date: 2024-08-24 13:08:10 | ||
* @Last Modified by: czy0729 | ||
* @Last Modified time: 2024-08-24 13:16:37 | ||
*/ | ||
import React from 'react' | ||
import { Cover, Flex, Text, Touchable } from '@components' | ||
import { _ } from '@stores' | ||
import { cnjp } from '@utils' | ||
import { ob } from '@utils/decorators' | ||
import { t } from '@utils/fetch' | ||
import { MonoId } from '@types' | ||
import { InView } from '../../../base' | ||
import { styles } from './styles' | ||
import { Props } from './types' | ||
|
||
function Actors({ navigation, actors, y, event }: Props) { | ||
return ( | ||
<Flex style={_.mt.sm} wrap='wrap'> | ||
{actors.map(item => { | ||
const cn = cnjp(item.nameCn, item.name) | ||
const jp = cnjp(item.name, item.nameCn) | ||
return ( | ||
<Touchable | ||
key={item.id} | ||
style={styles.touch} | ||
animate | ||
onPress={() => { | ||
const monoId = ( | ||
String(item.id).includes('person') ? item.id : `person/${item.id}` | ||
) as MonoId | ||
navigation.push('Mono', { | ||
monoId | ||
}) | ||
|
||
t(event.id, { | ||
to: 'Mono', | ||
monoId | ||
}) | ||
}} | ||
> | ||
<Flex> | ||
<InView style={styles.inView} y={y}> | ||
<Cover src={item.cover} size={_.r(32)} radius /> | ||
</InView> | ||
<Flex.Item style={_.ml.sm}> | ||
<Text size={12} numberOfLines={1} bold lineHeight={13}> | ||
{cn} | ||
</Text> | ||
{!!jp && jp !== cn && ( | ||
<Text size={11} type='sub' numberOfLines={1}> | ||
{jp} | ||
</Text> | ||
)} | ||
</Flex.Item> | ||
</Flex> | ||
</Touchable> | ||
) | ||
})} | ||
</Flex> | ||
) | ||
} | ||
|
||
export default ob(Actors) |
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,20 @@ | ||
/* | ||
* @Author: czy0729 | ||
* @Date: 2024-08-24 13:09:57 | ||
* @Last Modified by: czy0729 | ||
* @Last Modified time: 2024-08-24 13:11:53 | ||
*/ | ||
import { _ } from '@stores' | ||
|
||
export const styles = _.create({ | ||
touch: { | ||
minWidth: 128, | ||
marginTop: _.md, | ||
borderRadius: _.radiusSm, | ||
overflow: 'hidden' | ||
}, | ||
inView: { | ||
minWidth: _.r(32), | ||
minHeight: _.r(32) | ||
} | ||
}) |
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,15 @@ | ||
/* | ||
* @Author: czy0729 | ||
* @Date: 2024-08-24 13:13:27 | ||
* @Last Modified by: czy0729 | ||
* @Last Modified time: 2024-08-24 13:15:11 | ||
*/ | ||
import { EventType, Navigation } from '@types' | ||
import { Actors } from '../types' | ||
|
||
export type Props = { | ||
navigation: Navigation | ||
actors: Actors | ||
y: number | ||
event: EventType | ||
} |
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,52 @@ | ||
/* | ||
* @Author: czy0729 | ||
* @Date: 2024-08-25 00:59:00 | ||
* @Last Modified by: czy0729 | ||
* @Last Modified time: 2024-08-25 13:02:45 | ||
*/ | ||
import React from 'react' | ||
import { Flex, Text, Touchable } from '@components' | ||
import { _ } from '@stores' | ||
import { HTMLDecode } from '@utils' | ||
import { ob } from '@utils/decorators' | ||
import { Tag } from '../../../base' | ||
import { styles } from './styles' | ||
import { Props } from './types' | ||
|
||
function Content({ cn, jp, replies, info, position, onPress }: Props) { | ||
return ( | ||
<Touchable style={styles.touch} animate onPress={onPress}> | ||
<Flex style={_.container.block} align='start'> | ||
<Flex.Item style={_.mr.md}> | ||
<Text size={15} numberOfLines={2} bold> | ||
{cn} | ||
{!!jp && jp !== cn && ( | ||
<Text type='sub' size={11} lineHeight={15} bold> | ||
{' '} | ||
{jp} | ||
</Text> | ||
)} | ||
{!!replies && ( | ||
<Text type='main' size={11} lineHeight={15} bold> | ||
{' '} | ||
{replies.replace(/\(|\)/g, '')} | ||
</Text> | ||
)} | ||
</Text> | ||
</Flex.Item> | ||
</Flex> | ||
<Flex style={_.mt.sm} wrap='wrap'> | ||
{position.map(item => ( | ||
<Tag key={item} style={styles.position} value={item} /> | ||
))} | ||
</Flex> | ||
{!!info && ( | ||
<Text style={_.mt.sm} size={12}> | ||
{HTMLDecode(info)} | ||
</Text> | ||
)} | ||
</Touchable> | ||
) | ||
} | ||
|
||
export default ob(Content) |
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,20 @@ | ||
/* | ||
* @Author: czy0729 | ||
* @Date: 2024-08-25 01:03:41 | ||
* @Last Modified by: czy0729 | ||
* @Last Modified time: 2024-08-25 08:49:55 | ||
*/ | ||
import { _ } from '@stores' | ||
|
||
export const styles = _.create({ | ||
touch: { | ||
paddingLeft: _.xs, | ||
marginLeft: -_.xs, | ||
borderRadius: _.radiusSm, | ||
overflow: 'hidden' | ||
}, | ||
position: { | ||
marginTop: _.sm, | ||
marginRight: _.sm | ||
} | ||
}) |
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,16 @@ | ||
/* | ||
* @Author: czy0729 | ||
* @Date: 2024-08-25 13:02:07 | ||
* @Last Modified by: czy0729 | ||
* @Last Modified time: 2024-08-25 13:02:34 | ||
*/ | ||
import { Fn } from '@types' | ||
|
||
export type Props = { | ||
cn: string | ||
jp: string | ||
replies: string | ||
info: string | ||
position: string[] | ||
onPress: Fn | ||
} |
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.