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

🟣 Release 5.2.4 #6368

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 15 additions & 1 deletion packages/atlas/src/api/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ import { GraphQLWsLink } from '@apollo/client/link/subscriptions'
import { getMainDefinition } from '@apollo/client/utilities'
import { createClient } from 'graphql-ws'

import { ORION_GRAPHQL_URL, QUERY_NODE_GRAPHQL_SUBSCRIPTION_URL } from '@/config/env'
import {
FAUCET_URL,
ORION_AUTH_URL,
ORION_GRAPHQL_URL,
QUERY_NODE_GRAPHQL_SUBSCRIPTION_URL,
YPP_FAUCET_URL,
} from '@/config/env'
import { useUserLocationStore } from '@/providers/userLocation'
import { UserEventsLogger } from '@/utils/logs'

import { cache } from './cache'

const followedRequests = [YPP_FAUCET_URL, ORION_GRAPHQL_URL, ORION_AUTH_URL, FAUCET_URL]

const initializePerformanceObserver = () => {
try {
const observer = new PerformanceObserver((list) => {
Expand All @@ -17,6 +25,12 @@ const initializePerformanceObserver = () => {
const queryString = entry.name.split('?')?.[1]
const params = new URLSearchParams(queryString)
const queryType = params.get('queryName')

// Only follow requests to Atlas infra
if (!queryType && !followedRequests.some((allowedUrl) => entry.name.includes(allowedUrl))) {
return
}

UserEventsLogger.logUserEvent('request-response-time', {
requestName: queryType ?? entry.name,
timeToComplete: entry.duration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ export const TokenPortfolioUtils = ({
const [ref, setRef] = useState<HTMLButtonElement | null>(null)

return (
<RightAlignedCell>
<RightAlignedCell
onClick={(e) => {
e.stopPropagation()
e.preventDefault()
}}
>
<Button ref={setRef} icon={<SvgActionMore />} variant="tertiary" size="small" />
<ContextMenu
appendTo={document.body}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
GetTokenRevenueSharesQuery,
useGetCreatorTokenHoldersQuery,
useGetFullCreatorTokenQuery,
useGetRevenueShareDividendQuery,
} from '@/api/queries/__generated__/creatorTokens.generated'
import { SvgActionCalendar, SvgActionLock, SvgJoyTokenMonochrome16 } from '@/assets/icons'
import { Avatar } from '@/components/Avatar'
Expand Down Expand Up @@ -45,6 +46,13 @@ export const RevenueShareWidget = ({ tokenName, tokenId, revenueShare, memberId
},
},
})
const { data: dividendData, loading: loadingDividendData } = useGetRevenueShareDividendQuery({
variables: {
tokenId: tokenId,
stakingAmount: +(holderData?.tokenAccounts[0]?.totalAmount ?? 0),
},
skip: !holderData?.tokenAccounts[0] || !tokenId,
})
const status = getRevenueShareStatusForMember({
currentBlock,
endingAt: revenueShare.endsAt,
Expand Down Expand Up @@ -119,13 +127,17 @@ export const RevenueShareWidget = ({ tokenName, tokenId, revenueShare, memberId
</Detail>

<Detail title="YOUR SHARE">
<NumberFormat
value={new BN(memberStake?.earnings ?? 0)}
as="p"
variant="t300"
withDenomination="after"
icon={<SvgJoyTokenMonochrome16 />}
/>
{loadingDividendData ? (
<SkeletonLoader height={30} width={60} />
) : (
<NumberFormat
value={new BN(dividendData?.getShareDividend.dividendJoyAmount ?? memberStake?.earnings ?? 0)}
as="p"
variant="t300"
withDenomination="after"
icon={<SvgJoyTokenMonochrome16 />}
/>
)}
</Detail>

<Detail title="YOUR TOKENS">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import {
SvgActionMoney,
SvgActionNewTab,
SvgSidebarHome,
SvgSidebarMarketplace,
SvgSidebarNft,
SvgSidebarReferrals,
SvgSidebarToken,
} from '@/assets/icons'
import { AppLogo } from '@/components/AppLogo'
import { Button } from '@/components/_buttons/Button'
Expand All @@ -35,10 +36,17 @@ export const viewerNavItems = [
bottomNav: true,
},
{
icon: <SvgSidebarMarketplace />,
expandedName: 'Marketplace',
name: 'Market',
to: absoluteRoutes.viewer.marketplace(),
icon: <SvgSidebarToken />,
expandedName: 'Tokens',
name: 'Tokens',
to: absoluteRoutes.viewer.crtMarketplace(),
bottomNav: true,
},
{
icon: <SvgSidebarNft />,
expandedName: 'NFTs',
name: 'NFTs',
to: absoluteRoutes.viewer.nftMarketplace(),
bottomNav: true,
},
...(atlasConfig.features.ypp.googleConsoleClientId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ const getLink = (type: LinkType, params: string[] = []): string => {
return absoluteRoutes.viewer.category(params[0])

case 'marketplace-page':
return absoluteRoutes.viewer.marketplace()
return absoluteRoutes.viewer.nftMarketplace()

case 'payments-page':
return absoluteRoutes.studio.payments()
Expand Down
3 changes: 2 additions & 1 deletion packages/atlas/src/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const relativeRoutes = {
memberById: (id = ':id', query?: { [QUERY_PARAMS.TAB]?: MemberTabs }) =>
withQueryParameters(`member/id/${id}`, query),
memberNotifications: () => 'notifications/member',
marketplace: () => 'marketplace',
nftMarketplace: () => 'nft-marketplace',
crtMarketplace: () => 'crt-marketplace',
ypp: (query?: { [QUERY_PARAMS.REFERRER_ID]?: string }) => withQueryParameters('ypp', query),
yppTest: () => 'ypp/rewards',
yppDashboard: () => 'ypp-dashboard',
Expand Down
121 changes: 0 additions & 121 deletions packages/atlas/src/views/global/YppLandingView/YppLandingViewOld.tsx

This file was deleted.

This file was deleted.

Loading
Loading