diff options
| author | Max Nanis | 2025-06-02 16:45:21 +0700 |
|---|---|---|
| committer | Max Nanis | 2025-06-02 16:45:21 +0700 |
| commit | e6037b430935720ce60245ae36ecd3622e8a22bf (patch) | |
| tree | 13919b0f73729ad47a31e06bdd710f774d70cac0 /src/pages/Community.tsx | |
| parent | 8caa77413ea372e5cbd2980a9922d701af359c04 (diff) | |
| download | panel-ui-e6037b430935720ce60245ae36ecd3622e8a22bf.tar.gz panel-ui-e6037b430935720ce60245ae36ecd3622e8a22bf.zip | |
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
Diffstat (limited to 'src/pages/Community.tsx')
| -rw-r--r-- | src/pages/Community.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
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<GRLWidgetSettings> = ({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<GRLWidgetSettings> = ({settings}) => { <div className="grid grid-cols-3 gap-1 p-1"> { cashoutMethods.map((m, index) => { - const cm = new CashoutMethod(m); - return <CashoutMethodPreview key={index} cashout_method={cm} />; + return <CashoutMethodPreview key={index} cashout_method={m} />; }) } </div> |
