Skip to Content

User Center Widget

UserCenterWidget displays user rewards, identity data, and activity history tabs.

Import

import { UserCenterWidget } from "@taskon/widget-react/user-center";

Usage

Cloud Config Mode

<UserCenterWidget widgetId={789} />

Local Config Mode (No widgetId)

import type { UserCenterConfig } from "@taskon/core"; const config: UserCenterConfig = getUserCenterConfigFromYourServer(); <UserCenterWidget config={config} />

Key Props

PropTypeDescription
widgetIdnumberLoad config and theme from cloud
themeMode"light" | "dark" | "auto"Override cloud mode
configUserCenterConfigLocal tab configuration
defaultTabUserCenterTabTypeDefault tab
defaultRewardCardUserCenterRewardCardTypeDefault reward card in My Rewards
defaultPointIdnumberDefault point ID when reward card is points
onTabChange(tab) => voidCallback on tab switch
classNamestringCustom wrapper class
styleReact.CSSPropertiesCustom wrapper style

widgetId or config should provide a valid User Center setup.

Example

UserCenterPage.tsx
import { TaskOnProvider } from "@taskon/widget-react/core"; import { UserCenterWidget } from "@taskon/widget-react/user-center"; function UserCenterPage() { return ( <TaskOnProvider config={{ clientId: "YOUR_CLIENT_ID" }}> <UserCenterWidget widgetId={789} /> </TaskOnProvider> ); }
Last updated on