add a notification type
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
AppBskyNotificationListNotifications,
|
|
||||||
AppBskyFeedDefs,
|
AppBskyFeedDefs,
|
||||||
|
AppBskyNotificationListNotifications,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
|
||||||
export type NotificationType =
|
export type NotificationType =
|
||||||
@@ -11,6 +11,7 @@ export type NotificationType =
|
|||||||
| 'reply'
|
| 'reply'
|
||||||
| 'quote'
|
| 'quote'
|
||||||
| 'follow'
|
| 'follow'
|
||||||
|
| 'starter-pack-signup'
|
||||||
| 'unknown'
|
| 'unknown'
|
||||||
|
|
||||||
export interface FeedNotification {
|
export interface FeedNotification {
|
||||||
|
|||||||
@@ -78,6 +78,38 @@ export function Feed({
|
|||||||
} else {
|
} else {
|
||||||
arr.push(LOADING_ITEM)
|
arr.push(LOADING_ITEM)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO remove this temp plc
|
||||||
|
arr = [
|
||||||
|
{
|
||||||
|
type: 'starter-pack-signup',
|
||||||
|
_reactKey: 'plc',
|
||||||
|
notification: {
|
||||||
|
uri: 'https://blueskyweb.xyz',
|
||||||
|
cid: 'abcdefg',
|
||||||
|
author: {
|
||||||
|
did: 'did:plc:temp',
|
||||||
|
handle: 'hailey alt',
|
||||||
|
avatar: undefined,
|
||||||
|
viewer: {
|
||||||
|
muted: false,
|
||||||
|
blockedBy: false,
|
||||||
|
},
|
||||||
|
labels: [],
|
||||||
|
description: '',
|
||||||
|
indexedAt: '2024-05-27T21:52:22.554Z',
|
||||||
|
},
|
||||||
|
reason: 'starter-pack-signup',
|
||||||
|
reasonSubject: 'at://did:plc:temp/app.bsky.starterpack/abcdefg',
|
||||||
|
record: {},
|
||||||
|
isRead: true,
|
||||||
|
indexedAt: '2024-06-04T23:57:19.521Z',
|
||||||
|
labels: [],
|
||||||
|
},
|
||||||
|
subjectUri: 'at://did:plc:temp/app.bsky.starterpack/abcdefg',
|
||||||
|
},
|
||||||
|
...arr,
|
||||||
|
]
|
||||||
return arr
|
return arr
|
||||||
}, [isFetched, isError, isEmpty, data])
|
}, [isFetched, isError, isEmpty, data])
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import {TimeElapsed} from '../util/TimeElapsed'
|
|||||||
import {PreviewableUserAvatar, UserAvatar} from '../util/UserAvatar'
|
import {PreviewableUserAvatar, UserAvatar} from '../util/UserAvatar'
|
||||||
|
|
||||||
import hairlineWidth = StyleSheet.hairlineWidth
|
import hairlineWidth = StyleSheet.hairlineWidth
|
||||||
|
import {StarterPackIcon} from '#/components/icons/StarterPackIcon'
|
||||||
|
|
||||||
const MAX_AUTHORS = 5
|
const MAX_AUTHORS = 5
|
||||||
|
|
||||||
@@ -92,6 +93,10 @@ let FeedItem = ({
|
|||||||
const urip = new AtUri(item.subjectUri)
|
const urip = new AtUri(item.subjectUri)
|
||||||
return `/profile/${urip.host}/feed/${urip.rkey}`
|
return `/profile/${urip.host}/feed/${urip.rkey}`
|
||||||
}
|
}
|
||||||
|
} else if (item.type === 'starter-pack-signup') {
|
||||||
|
// TODO create the right href for navigating to the starterpack
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
const urip = '/'
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
}, [item])
|
}, [item])
|
||||||
@@ -119,7 +124,12 @@ let FeedItem = ({
|
|||||||
]
|
]
|
||||||
}, [item, moderationOpts])
|
}, [item, moderationOpts])
|
||||||
|
|
||||||
if (item.subjectUri && !item.subject && item.type !== 'feedgen-like') {
|
if (
|
||||||
|
item.subjectUri &&
|
||||||
|
!item.subject &&
|
||||||
|
item.type !== 'feedgen-like' &&
|
||||||
|
item.type !== 'starter-pack-signup'
|
||||||
|
) {
|
||||||
// don't render anything if the target post was deleted or unfindable
|
// don't render anything if the target post was deleted or unfindable
|
||||||
return <View />
|
return <View />
|
||||||
}
|
}
|
||||||
@@ -174,6 +184,14 @@ let FeedItem = ({
|
|||||||
icon = <PersonPlusIcon size="xl" style={{color: t.palette.primary_500}} />
|
icon = <PersonPlusIcon size="xl" style={{color: t.palette.primary_500}} />
|
||||||
} else if (item.type === 'feedgen-like') {
|
} else if (item.type === 'feedgen-like') {
|
||||||
action = _(msg`liked your custom feed`)
|
action = _(msg`liked your custom feed`)
|
||||||
|
} else if (item.type === 'starter-pack-signup') {
|
||||||
|
console.log('has one')
|
||||||
|
icon = (
|
||||||
|
<View style={{height: 30, width: 30}}>
|
||||||
|
<StarterPackIcon />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
action = _(msg`signed up with your starter pack`)
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -287,6 +305,7 @@ let FeedItem = ({
|
|||||||
showLikes
|
showLikes
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
{item.type === 'starter-pack-signup' ? <></> : null}
|
||||||
</View>
|
</View>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user