Skip to content

Commit

Permalink
Merge pull request #698 from thematters/fix/badge
Browse files Browse the repository at this point in the history
fix(badge): handle new `grand_slam` badge
  • Loading branch information
gary02 authored Aug 14, 2024
2 parents a1b50b2 + 0f76f60 commit e54d2e6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/components/BadgedUser/DigestList/index.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
1 change: 1 addition & 0 deletions src/components/BadgedUser/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
}
3 changes: 1 addition & 2 deletions src/definitions/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {
GQLUserRestrictionType,
GQLCampaignState,
GQLDatetimeRange,
GQLCampaignStage,
GQLCampaignApplicationState,
GQLCampaignApplication,
} from './schema'

Expand All @@ -30,6 +28,7 @@ export type USER_BADGE_TYPES =
| 'nomad2'
| 'nomad3'
| 'nomad4'
| 'grand_slam'

export type UserDigest = {
id: string
Expand Down
7 changes: 1 addition & 6 deletions src/pages/BadgedUserList/index.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -8,7 +7,7 @@ import withBadgedUserList, { BadgedUsersChildProps } from './withBadgedUserList'
import { UserDigest } from '../../definitions'

class BadgedUserList extends React.Component<BadgedUsersChildProps> {
private _renderContent() {
public render() {
const {
data: { oss, loading, error, fetchMore, variables },
} = this.props
Expand All @@ -32,10 +31,6 @@ class BadgedUserList extends React.Component<BadgedUsersChildProps> {
/>
)
}

public render() {
return <>{this._renderContent()}</>
}
}

export default withBadgedUserList(BadgedUserList)
2 changes: 1 addition & 1 deletion src/pages/BadgedUserList/withBadgedUserList.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit e54d2e6

Please sign in to comment.