mirror of
https://github.com/tooot-app/app
synced 2025-04-17 19:57:33 +02:00
Fixed notification
This commit is contained in:
parent
c9726d904f
commit
3e3ae67155
@ -55,6 +55,14 @@ const TimelineNotifications: React.FC<Props> = ({
|
|||||||
notification
|
notification
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
opacity:
|
||||||
|
notification.type === 'follow' || notification.type === 'mention'
|
||||||
|
? 1
|
||||||
|
: 0.5
|
||||||
|
}}
|
||||||
|
>
|
||||||
<View style={styles.header}>
|
<View style={styles.header}>
|
||||||
<TimelineAvatar queryKey={queryKey} account={actualAccount} />
|
<TimelineAvatar queryKey={queryKey} account={actualAccount} />
|
||||||
<TimelineHeaderNotification notification={notification} />
|
<TimelineHeaderNotification notification={notification} />
|
||||||
@ -94,6 +102,7 @@ const TimelineNotifications: React.FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
</View>
|
||||||
|
|
||||||
{notification.status && (
|
{notification.status && (
|
||||||
<View
|
<View
|
||||||
|
@ -62,7 +62,7 @@ const TimelineActioned: React.FC<Props> = ({
|
|||||||
<Feather
|
<Feather
|
||||||
name='bar-chart-2'
|
name='bar-chart-2'
|
||||||
size={StyleConstants.Font.Size.S}
|
size={StyleConstants.Font.Size.S}
|
||||||
color='black'
|
color={iconColor}
|
||||||
style={styles.icon}
|
style={styles.icon}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@ -87,11 +87,7 @@ const TimelineActioned: React.FC<Props> = ({
|
|||||||
{content && (
|
{content && (
|
||||||
<View style={styles.content}>
|
<View style={styles.content}>
|
||||||
{account.emojis ? (
|
{account.emojis ? (
|
||||||
<Emojis
|
<Emojis content={content} emojis={account.emojis} size='S' />
|
||||||
content={content}
|
|
||||||
emojis={account.emojis}
|
|
||||||
size='S'
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<Text>{content}</Text>
|
<Text>{content}</Text>
|
||||||
)}
|
)}
|
||||||
|
@ -134,7 +134,8 @@ const styles = StyleSheet.create({
|
|||||||
width: '80%'
|
width: '80%'
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
flexDirection: 'row'
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center'
|
||||||
},
|
},
|
||||||
account: {
|
account: {
|
||||||
flexShrink: 1,
|
flexShrink: 1,
|
||||||
|
@ -17,10 +17,12 @@ export interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TimelineHeaderNotification: React.FC<Props> = ({ notification }) => {
|
const TimelineHeaderNotification: React.FC<Props> = ({ notification }) => {
|
||||||
const name =
|
const actualAccount = notification.status
|
||||||
notification.account.display_name || notification.account.username
|
? notification.status.account
|
||||||
const emojis = notification.account.emojis
|
: notification.account
|
||||||
const account = notification.account.acct
|
const name = actualAccount.display_name || actualAccount.username
|
||||||
|
const emojis = actualAccount.emojis
|
||||||
|
const account = actualAccount.acct
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
|
|
||||||
const [since, setSince] = useState(relativeTime(notification.created_at))
|
const [since, setSince] = useState(relativeTime(notification.created_at))
|
||||||
@ -123,14 +125,9 @@ const TimelineHeaderNotification: React.FC<Props> = ({ notification }) => {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.base}>
|
<View style={styles.base}>
|
||||||
<View style={styles.nameAndMeta}>
|
<View style={styles.nameAndMeta}>
|
||||||
<View style={styles.name}>
|
<View style={styles.nameAndAccount}>
|
||||||
{emojis?.length ? (
|
{emojis?.length ? (
|
||||||
<Emojis
|
<Emojis content={name} emojis={emojis} size='M' fontBold={true} />
|
||||||
content={name}
|
|
||||||
emojis={emojis}
|
|
||||||
size='M'
|
|
||||||
fontBold={true}
|
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<Text
|
<Text
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
@ -190,8 +187,9 @@ const styles = StyleSheet.create({
|
|||||||
nameAndMeta: {
|
nameAndMeta: {
|
||||||
width: '80%'
|
width: '80%'
|
||||||
},
|
},
|
||||||
name: {
|
nameAndAccount: {
|
||||||
flexDirection: 'row'
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center'
|
||||||
},
|
},
|
||||||
nameWithoutEmoji: {
|
nameWithoutEmoji: {
|
||||||
...StyleConstants.FontStyle.M,
|
...StyleConstants.FontStyle.M,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user