Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☎️ Query the new notifications from Orion #4868

Merged
merged 40 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
501a6e6
Add the membership and channel notifications queries
thesan Sep 12, 2023
fdd8a12
Add the MarkNotificationsAsRead mutation
thesan Sep 12, 2023
8c0067f
Update the `NotificationRecord` type
thesan Sep 12, 2023
84ac0a9
Rename the notifications query results
thesan Sep 12, 2023
7ab946b
Remove `markNotificationsAsUnread`
thesan Sep 12, 2023
066356d
Switch to channel notification when in studio
thesan Sep 12, 2023
9b5b8c4
Add the new notifications text
thesan Sep 12, 2023
4aa9655
Prepare the avatar data
thesan Sep 12, 2023
dc28613
Add links and icons
thesan Sep 13, 2023
e15c768
Move icon mapper and getNotificationUX into a utils file
thesan Sep 13, 2023
59e2cf4
Add the `useNotificationAvatar` hook
thesan Sep 13, 2023
2328aea
Handle notification actions by types
thesan Sep 13, 2023
1b9151e
Rename `NotificationTile.hooks.tsx`
thesan Sep 13, 2023
22d5a9c
Fix the NotificationTile story
thesan Sep 14, 2023
8786971
Set the notification settings links
thesan Sep 14, 2023
0fef2f8
Rename the channel settings hook
thesan Sep 14, 2023
d19f1ba
Fix notifications
thesan Sep 14, 2023
dd1174e
Rely on Orion to differentiate member from channel notifications
thesan Sep 14, 2023
f9b9a18
Fix some UI issues
thesan Sep 14, 2023
eeef2c5
Fix the last seen notification logic
thesan Sep 14, 2023
7e19569
Remove NoActorNotificationAvatar
thesan Sep 14, 2023
e45028f
Fix nfts and ChannelFundsWithdrawn notifications links
thesan Sep 18, 2023
6cc634b
Fix typos
thesan Sep 19, 2023
f2a0a58
Fix notifications counts
thesan Sep 19, 2023
548792c
Hide member dropdown notification count when opened
thesan Sep 19, 2023
757f29a
Fix local Orion config
thesan Sep 22, 2023
365414b
Fix infinite re-render on the notification center
thesan Sep 26, 2023
ea50959
Fix channel avatars
thesan Sep 26, 2023
cf7afff
Update notifications copies
thesan Sep 26, 2023
44a7f55
Update to the fixed Orion schema
thesan Oct 3, 2023
d98c7e3
Fix the profile setting page
thesan Oct 3, 2023
cccdbed
Fix reply copy
thesan Oct 10, 2023
05a4833
Fix video reaction copies
thesan Oct 12, 2023
647f43d
Refactor `getNotificationUX`
thesan Oct 12, 2023
b6f0452
Open nft widget based on query parameters
thesan Oct 12, 2023
bab4541
Fix the notifications counters
thesan Oct 18, 2023
b8d3181
Type `useNotifications`
thesan Oct 18, 2023
ac90643
Merge branch 'notifications' of github.com:Joystream/atlas into featu…
thesan Oct 18, 2023
a75fcf6
Fix some CRs
thesan Oct 25, 2023
fb850fc
Replace fragments by divs for notifications content
thesan Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/atlas/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import styled from '@emotion/styled'
import { useRef } from 'react'
import useResizeObserver from 'use-resize-observer'

import { OperatorsContext } from '@/providers/assets/assets.provider'
import { JoystreamContext } from '@/providers/joystream/joystream.provider'
import { GlobalStyles } from '@/styles'

const Wrapper = styled.div`
Expand All @@ -26,8 +28,19 @@ const StylesWrapperDecorator = (styleFn) => {
</Wrapper>
)
}
const OperatorsContextDecorator = (Story) => (
<OperatorsContext.Provider value={{}}>
<Story />
</OperatorsContext.Provider>
)

export const decorators = [StylesWrapperDecorator]
const TokenPriceDecorator = (Story) => (
<JoystreamContext.Provider value={{ tokenPrice: 0.5 }}>
<Story />
</JoystreamContext.Provider>
)

export const decorators = [OperatorsContextDecorator, TokenPriceDecorator, StylesWrapperDecorator]

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand Down
4 changes: 3 additions & 1 deletion packages/atlas/src/.env
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ VITE_NEXT_FAUCET_URL=https://atlas-next.joystream.org/member-faucet/register
VITE_NEXT_YPP_FAUCET_URL=https://52.204.147.11.nip.io/membership

# Local development env URLs
VITE_LOCAL_ORION_URL=http://localhost:6116/graphql
VITE_LOCAL_ORION_AUTH_URL=http://localhost:4074/api/v1
VITE_LOCAL_ORION_URL=http://localhost:4350/graphql
VITE_LOCAL_QUERY_NODE_SUBSCRIPTION_URL=ws://localhost:8081/graphql
VITE_LOCAL_NODE_URL=ws://localhost:9944/ws-rpc
VITE_LOCAL_FAUCET_URL=http://localhost:3002/register
VITE_LOCAL_YPP_FAUCET_URL=https://52.204.147.11.nip.io/membership

VITE_SENTRY_AUTH_TOKEN=
19 changes: 11 additions & 8 deletions packages/atlas/src/api/hooks/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,31 @@ import {
GetNftActivitiesCountQueryVariables,
GetNftActivitiesQuery,
GetNftActivitiesQueryVariables,
GetNotificationsConnectionQuery,
GetNotificationsConnectionQueryVariables,
useGetNftActivitiesCountQuery,
useGetNftActivitiesQuery,
useGetNotificationsConnectionQuery,
useMarkNotificationsAsReadMutation,
} from '@/api/queries/__generated__/notifications.generated'
import { RecipientType } from '@/providers/notifications/notifications.store'

import { NftActivityOrderByInput } from '../queries/__generated__/baseTypes.generated'

export const useRawNotifications = (
accountId: string,
opts?: QueryHookOptions<GetNotificationsConnectionQuery, GetNotificationsConnectionQueryVariables>
type: RecipientType,
opts?: Pick<QueryHookOptions, 'notifyOnNetworkStatusChange'>
) => {
const { data, ...rest } = useGetNotificationsConnectionQuery({
variables: { first: 10, accountId },
skip: !accountId,
variables: { first: 10, accountId, type },
...opts,
})

const [markNotificationsAsReadMutation] = useMarkNotificationsAsReadMutation()

return {
notifications: data?.notificationsConnection.edges || [],
totalCount: data?.notificationsConnection.totalCount,
pageInfo: data?.notificationsConnection.pageInfo,
notifications: data?.notificationInAppDeliveriesConnection.edges || [],
pageInfo: data?.notificationInAppDeliveriesConnection.pageInfo,
markNotificationsAsReadMutation,
...rest,
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading