fix satistics profile photo issue
This commit is contained in:
parent
fcd5c6cdf3
commit
daa4dc750b
@ -1,5 +1,6 @@
|
|||||||
import { gql } from '@apollo/client'
|
import { gql } from '@apollo/client'
|
||||||
import { ITEM_FIELDS } from './items'
|
import { ITEM_FIELDS } from './items'
|
||||||
|
import { USER_FIELDS } from './users'
|
||||||
|
|
||||||
export const INVOICE = gql`
|
export const INVOICE = gql`
|
||||||
query Invoice($id: ID!) {
|
query Invoice($id: ID!) {
|
||||||
@ -27,8 +28,12 @@ export const WITHDRAWL = gql`
|
|||||||
|
|
||||||
export const WALLET_HISTORY = gql`
|
export const WALLET_HISTORY = gql`
|
||||||
${ITEM_FIELDS}
|
${ITEM_FIELDS}
|
||||||
|
${USER_FIELDS}
|
||||||
|
|
||||||
query WalletHistory($cursor: String, $inc: String) {
|
query WalletHistory($cursor: String, $inc: String) {
|
||||||
|
me {
|
||||||
|
...UserFields
|
||||||
|
}
|
||||||
walletHistory(cursor: $cursor, inc: $inc) {
|
walletHistory(cursor: $cursor, inc: $inc) {
|
||||||
facts {
|
facts {
|
||||||
id
|
id
|
||||||
|
@ -3,7 +3,6 @@ import Link from 'next/link'
|
|||||||
import { Table } from 'react-bootstrap'
|
import { Table } from 'react-bootstrap'
|
||||||
import { getGetServerSideProps } from '../api/ssrApollo'
|
import { getGetServerSideProps } from '../api/ssrApollo'
|
||||||
import Layout from '../components/layout'
|
import Layout from '../components/layout'
|
||||||
import { useMe } from '../components/me'
|
|
||||||
import MoreFooter from '../components/more-footer'
|
import MoreFooter from '../components/more-footer'
|
||||||
import UserHeader from '../components/user-header'
|
import UserHeader from '../components/user-header'
|
||||||
import { WALLET_HISTORY } from '../fragments/wallet'
|
import { WALLET_HISTORY } from '../fragments/wallet'
|
||||||
@ -115,8 +114,7 @@ function Detail ({ fact }) {
|
|||||||
return <div className={styles.commentWrapper}><Comment item={fact.item} includeParent noReply truncate /></div>
|
return <div className={styles.commentWrapper}><Comment item={fact.item} includeParent noReply truncate /></div>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Satistics ({ data: { walletHistory: { facts, cursor } } }) {
|
export default function Satistics ({ data: { me, walletHistory: { facts, cursor } } }) {
|
||||||
const me = useMe()
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { data, fetchMore } = useQuery(WALLET_HISTORY, { variables: { inc: router.query.inc } })
|
const { data, fetchMore } = useQuery(WALLET_HISTORY, { variables: { inc: router.query.inc } })
|
||||||
|
|
||||||
@ -150,7 +148,7 @@ export default function Satistics ({ data: { walletHistory: { facts, cursor } }
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
({ walletHistory: { facts, cursor } } = data)
|
({ me, walletHistory: { facts, cursor } } = data)
|
||||||
}
|
}
|
||||||
|
|
||||||
const SatisticsSkeleton = () => (
|
const SatisticsSkeleton = () => (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user