Skip to content

Commit 9367a2a

Browse files
committed
GAME-181 #comment remove unassign btn
1 parent 588ed5d commit 9367a2a

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

src-ts/lib/pagination/infinite-page-handler.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export interface InfinitePageHandler<T> {
66
data?: ReadonlyArray<T>
77
getAndSetNext: () => void
88
hasMore: boolean
9+
isValidating: boolean
910
mutate: KeyedMutator<Array<InfinitePageDao<T>>>
1011
}

src-ts/lib/pagination/use-infinite-page.hook.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { InfinitePageHandler } from './infinite-page-handler.model'
88
export function useGetInfinitePage<T>(getKey: (index: number, previousPageData: InfinitePageDao<T>) => string | undefined):
99
InfinitePageHandler<T> {
1010

11-
const { data, mutate, setSize, size }: SWRInfiniteResponse<InfinitePageDao<T>> = useSWRInfinite(getKey, { revalidateFirstPage: false })
11+
const { data, isValidating, mutate, setSize, size }: SWRInfiniteResponse<InfinitePageDao<T>> = useSWRInfinite(getKey, { revalidateFirstPage: false })
1212

1313
// flatten version of badges paginated data
1414
const outputData: ReadonlyArray<T> = flatten(map(data, dao => dao.rows))
@@ -21,6 +21,7 @@ export function useGetInfinitePage<T>(getKey: (index: number, previousPageData:
2121
data: outputData,
2222
getAndSetNext,
2323
hasMore: outputData.length < (data?.[0]?.count || 0),
24+
isValidating,
2425
mutate,
2526
}
2627
}

src-ts/tools/gamification-admin/pages/badge-detail/AwardedMembersTab/awarded-members-table/member-action-renderer/MemberActionRenderer.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
import { Button, ButtonProps, useCheckIsMobile } from '../../../../../../../lib'
1+
// TODO: enable when unassign feature is ready
2+
// import { Button, ButtonProps, useCheckIsMobile } from '../../../../../../../lib'
23
import { MemberBadgeAward } from '../../../../../game-lib'
34

45
import styles from './MemberActionRenderer.module.scss'
56

67
function MemberActionRenderer(memberAward: MemberBadgeAward): JSX.Element {
78

8-
const isMobile: boolean = useCheckIsMobile()
9+
// const isMobile: boolean = useCheckIsMobile()
910

10-
const buttonProps: ButtonProps = {
11-
buttonStyle: 'secondary',
12-
size: isMobile ? 'xs' : 'sm',
13-
}
11+
// const buttonProps: ButtonProps = {
12+
// buttonStyle: 'secondary',
13+
// size: isMobile ? 'xs' : 'sm',
14+
// }
1415

15-
const actionButtons: Array<{
16-
label: string
17-
}> = [
18-
{
19-
label: 'Unassign',
20-
},
21-
]
16+
// const actionButtons: Array<{
17+
// label: string
18+
// }> = [
19+
// {
20+
// label: 'Unassign',
21+
// },
22+
// ]
2223

23-
function onUnassign(): void {
24-
// TODO: unassign feature
25-
}
24+
// function onUnassign(): void {
25+
26+
// }
2627

2728
return (
2829
<div className={styles['badge-actions']}>
29-
{actionButtons.map((button, index) => {
30+
{/* {actionButtons.map((button, index) => {
3031
return (
3132
<Button
3233
{...buttonProps}
@@ -35,7 +36,7 @@ function MemberActionRenderer(memberAward: MemberBadgeAward): JSX.Element {
3536
onClick={onUnassign}
3637
/>
3738
)
38-
})}
39+
})} */}
3940
</div>
4041
)
4142
}

0 commit comments

Comments
 (0)