From 0f76f6045284ca7957cf2491da491dd88a6d1506 Mon Sep 17 00:00:00 2001 From: j <13580441+gary02@users.noreply.github.com> Date: Tue, 13 Aug 2024 23:08:52 +0800 Subject: [PATCH] fix(badge): handle new `grand_slam` badge --- src/components/BadgedUser/DigestList/index.tsx | 1 - src/components/BadgedUser/enums.ts | 1 + src/definitions/index.d.ts | 3 +-- src/pages/BadgedUserList/index.tsx | 7 +------ src/pages/BadgedUserList/withBadgedUserList.tsx | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/components/BadgedUser/DigestList/index.tsx b/src/components/BadgedUser/DigestList/index.tsx index 0ffb6ca5..5c44385d 100644 --- a/src/components/BadgedUser/DigestList/index.tsx +++ b/src/components/BadgedUser/DigestList/index.tsx @@ -1,6 +1,5 @@ import * as React from 'react' import { Table } from 'antd' -import _get from 'lodash/get' import _compact from 'lodash/compact' import { Tag } from 'antd' diff --git a/src/components/BadgedUser/enums.ts b/src/components/BadgedUser/enums.ts index 96e1cc66..622eecf9 100644 --- a/src/components/BadgedUser/enums.ts +++ b/src/components/BadgedUser/enums.ts @@ -10,4 +10,5 @@ export const USER_BADGES: { nomad2: { text: '流星號', color: '#066320' }, nomad3: { text: '光輪號', color: '#5b0707' }, nomad4: { text: '火閃電', color: '#bf9604' }, + grand_slam: { text: '大滿貫', color: '#ffA500' }, } diff --git a/src/definitions/index.d.ts b/src/definitions/index.d.ts index bc619e14..a84784e6 100644 --- a/src/definitions/index.d.ts +++ b/src/definitions/index.d.ts @@ -12,8 +12,6 @@ import { GQLUserRestrictionType, GQLCampaignState, GQLDatetimeRange, - GQLCampaignStage, - GQLCampaignApplicationState, GQLCampaignApplication, } from './schema' @@ -30,6 +28,7 @@ export type USER_BADGE_TYPES = | 'nomad2' | 'nomad3' | 'nomad4' + | 'grand_slam' export type UserDigest = { id: string diff --git a/src/pages/BadgedUserList/index.tsx b/src/pages/BadgedUserList/index.tsx index 070a1f5a..9425c8ee 100644 --- a/src/pages/BadgedUserList/index.tsx +++ b/src/pages/BadgedUserList/index.tsx @@ -1,5 +1,4 @@ import * as React from 'react' -import _get from 'lodash/get' import ErrorMessage from '../../components/ErrorMessage' import BadgedUserDigestList from '../../components/BadgedUser/DigestList' @@ -8,7 +7,7 @@ import withBadgedUserList, { BadgedUsersChildProps } from './withBadgedUserList' import { UserDigest } from '../../definitions' class BadgedUserList extends React.Component { - private _renderContent() { + public render() { const { data: { oss, loading, error, fetchMore, variables }, } = this.props @@ -32,10 +31,6 @@ class BadgedUserList extends React.Component { /> ) } - - public render() { - return <>{this._renderContent()} - } } export default withBadgedUserList(BadgedUserList) diff --git a/src/pages/BadgedUserList/withBadgedUserList.tsx b/src/pages/BadgedUserList/withBadgedUserList.tsx index 5d01c6d8..7477593f 100644 --- a/src/pages/BadgedUserList/withBadgedUserList.tsx +++ b/src/pages/BadgedUserList/withBadgedUserList.tsx @@ -1,4 +1,4 @@ -import { graphql, ChildDataProps, compose } from 'react-apollo' +import { graphql, ChildDataProps } from 'react-apollo' import { RouteComponentProps } from 'react-router-dom' import { PAGE_SIZE } from '../../constants'