From e6037b430935720ce60245ae36ecd3622e8a22bf Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Mon, 2 Jun 2025 16:45:21 +0700 Subject: Updated openapi generator to use the latest version (camelCase to underscore - which respects API models). Updating views to use the new swagger definitions. AnswerSlice as a datastore alongside Questions TS interface --- src/pages/Community.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/pages/Community.tsx') diff --git a/src/pages/Community.tsx b/src/pages/Community.tsx index 88cb74d..9b49608 100644 --- a/src/pages/Community.tsx +++ b/src/pages/Community.tsx @@ -1,11 +1,11 @@ import React, {useEffect, useState} from 'react' import {Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle} from "@/components/ui/card.tsx"; -import {GRLWidgetSettings} from "@/Widget.tsx" import {CashoutMethodsResponse, WalletApi} from "@/api" -import {CashoutMethod} from "@/models/CashoutMethod.ts"; +import {CashoutMethodOut} from "@/api"; +import {useAppSelector} from "@/hooks.ts"; -const CashoutMethodPreview: React.FC<{ cashout_method: CashoutMethod }> = ({cashout_method}) => { +const CashoutMethodPreview: React.FC<{ cashout_method: CashoutMethodOut }> = ({cashout_method}) => { console.log("CashoutMethodPreview", cashout_method) @@ -22,12 +22,14 @@ const CashoutMethodPreview: React.FC<{ cashout_method: CashoutMethod }> = ({cash ) } -const CommunityPage: React.FC = ({settings}) => { +const CommunityPage = () => { + const app = useAppSelector(state => state.app) + const [cashoutMethods, setCashoutMethods] = useState([]); useEffect(() => { const x = new WalletApi(); - x.getCashoutMethodsProductIdCashoutMethodsGet(settings.bpid, settings.bpuid) + x.getCashoutMethodsProductIdCashoutMethodsGet(app.bpid, app.bpuid) .then(res => { const data: CashoutMethodsResponse = res.data; setCashoutMethods(data.cashout_methods); @@ -39,8 +41,7 @@ const CommunityPage: React.FC = ({settings}) => {
{ cashoutMethods.map((m, index) => { - const cm = new CashoutMethod(m); - return ; + return ; }) }
-- cgit v1.2.3