From 8f147c85a9ebb2b193bc948a95d11893a42f6a4c Mon Sep 17 00:00:00 2001 From: Ash Keel Date: Tue, 18 May 2021 13:30:08 +0200 Subject: [PATCH] User point editing let's gooo --- frontend/src/store/api/reducer.ts | 3 +- frontend/src/ui/components/PageList.tsx | 20 ++- frontend/src/ui/components/TabbedView.tsx | 8 +- frontend/src/ui/pages/loyalty/Queue.tsx | 11 +- frontend/src/ui/pages/loyalty/Rewards.tsx | 1 + frontend/src/ui/pages/loyalty/UserList.tsx | 160 +++++++++++++++++++-- 6 files changed, 184 insertions(+), 19 deletions(-) diff --git a/frontend/src/store/api/reducer.ts b/frontend/src/store/api/reducer.ts index 127ea6d..5e528b1 100644 --- a/frontend/src/store/api/reducer.ts +++ b/frontend/src/store/api/reducer.ts @@ -68,7 +68,7 @@ interface LoyaltyConfig { banlist: string[]; } -interface LoyaltyPointsEntry { +export interface LoyaltyPointsEntry { points: number; } @@ -100,6 +100,7 @@ export interface LoyaltyRedeem { display_name: string; when: Date; reward: LoyaltyReward; + request_text: string; } export interface APIState { diff --git a/frontend/src/ui/components/PageList.tsx b/frontend/src/ui/components/PageList.tsx index 7a4ba55..933d4e2 100644 --- a/frontend/src/ui/components/PageList.tsx +++ b/frontend/src/ui/components/PageList.tsx @@ -4,6 +4,8 @@ export interface PageListProps { current: number; max: number; min: number; + itemsPerPage: number; + onSelectChange: (itemsPerPage: number) => void; onPageChange: (page: number) => void; } @@ -11,11 +13,13 @@ export default function PageList({ current, max, min, + itemsPerPage, + onSelectChange, onPageChange, }: PageListProps): React.ReactElement { return (