@chainloyalty/react 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/pages/LeaderboardPage.d.ts +19 -0
- package/dist/pages/LeaderboardPage.d.ts.map +1 -0
- package/dist/pages/LeaderboardPage.js +7 -0
- package/dist/pages/LeaderboardPage.js.map +1 -0
- package/dist/pages/RewardsDashboardPage.d.ts +19 -0
- package/dist/pages/RewardsDashboardPage.d.ts.map +1 -0
- package/dist/pages/RewardsDashboardPage.js +7 -0
- package/dist/pages/RewardsDashboardPage.js.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +5 -1
- package/src/pages/LeaderboardPage.tsx +44 -0
- package/src/pages/RewardsDashboardPage.tsx +44 -0
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export { RewardsDashboard } from './RewardsDashboard.js';
|
|
|
8
8
|
export type { RewardsDashboardProps, Badge, RewardHistoryItem, TierInfo, DashboardData } from './RewardsDashboard.js';
|
|
9
9
|
export { Leaderboard } from './Leaderboard.js';
|
|
10
10
|
export type { LeaderboardProps, LeaderboardEntry, LeaderboardTimeframe } from './Leaderboard.js';
|
|
11
|
+
export { RewardsDashboardPage } from './pages/RewardsDashboardPage.js';
|
|
12
|
+
export { LeaderboardPage } from './pages/LeaderboardPage.js';
|
|
11
13
|
export { getThemeColors, getThemeStylesheet, createThemeStyles } from './theme.js';
|
|
12
14
|
export type { ThemeColors } from './theme.js';
|
|
13
|
-
export declare const PACKAGE_VERSION = "1.
|
|
15
|
+
export declare const PACKAGE_VERSION = "1.3.0";
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[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,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,eAAO,MAAM,eAAe,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,11 @@ export { useTrackEvent, trackEvent } from './useTrackEvent.js';
|
|
|
7
7
|
// Export components
|
|
8
8
|
export { RewardsDashboard } from './RewardsDashboard.js';
|
|
9
9
|
export { Leaderboard } from './Leaderboard.js';
|
|
10
|
+
// Export page components
|
|
11
|
+
export { RewardsDashboardPage } from './pages/RewardsDashboardPage.js';
|
|
12
|
+
export { LeaderboardPage } from './pages/LeaderboardPage.js';
|
|
10
13
|
// Export theme utilities
|
|
11
14
|
export { getThemeColors, getThemeStylesheet, createThemeStyles } from './theme.js';
|
|
12
15
|
// Version info
|
|
13
|
-
export const PACKAGE_VERSION = '1.
|
|
16
|
+
export const PACKAGE_VERSION = '1.3.0';
|
|
14
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAG/D,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,yBAAyB;AACzB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGnF,eAAe;AACf,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAG/D,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,yBAAyB;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,yBAAyB;AACzB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGnF,eAAe;AACf,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chainloyalty/react - Leaderboard Page
|
|
3
|
+
*
|
|
4
|
+
* A full-page wrapper for the Leaderboard component.
|
|
5
|
+
* Use this in your app's routing to display the leaderboard on a dedicated page.
|
|
6
|
+
*
|
|
7
|
+
* Example usage in your app's router:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { LeaderboardPage } from '@chainloyalty/react';
|
|
10
|
+
*
|
|
11
|
+
* // Add to your routes
|
|
12
|
+
* { path: '/leaderboard', element: <LeaderboardPage walletAddress={userWallet} /> }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import { type LeaderboardProps } from '../Leaderboard.js';
|
|
17
|
+
export declare const LeaderboardPage: React.FC<LeaderboardProps>;
|
|
18
|
+
export default LeaderboardPage;
|
|
19
|
+
//# sourceMappingURL=LeaderboardPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeaderboardPage.d.ts","sourceRoot":"","sources":["../../src/pages/LeaderboardPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuBtD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Leaderboard } from '../Leaderboard.js';
|
|
3
|
+
export const LeaderboardPage = (props) => {
|
|
4
|
+
return (_jsxs("div", { className: "min-h-screen", style: { backgroundColor: 'hsl(var(--background))' }, children: [_jsx("div", { className: "border-b", style: { borderColor: 'hsl(var(--border))' }, children: _jsxs("div", { className: "container mx-auto px-4 py-6", children: [_jsx("h1", { className: "text-3xl font-bold", style: { color: 'hsl(var(--foreground))' }, children: "Leaderboard" }), _jsx("p", { className: "text-sm mt-1", style: { color: 'hsl(var(--muted-foreground))' }, children: "See how you rank against other community members" })] }) }), _jsx("div", { className: "container mx-auto px-4 py-8", children: _jsx("div", { className: "max-w-6xl mx-auto", children: _jsx(Leaderboard, { ...props }) }) })] }));
|
|
5
|
+
};
|
|
6
|
+
export default LeaderboardPage;
|
|
7
|
+
//# sourceMappingURL=LeaderboardPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeaderboardPage.js","sourceRoot":"","sources":["../../src/pages/LeaderboardPage.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AAEvE,MAAM,CAAC,MAAM,eAAe,GAA+B,CAAC,KAAK,EAAE,EAAE;IACnE,OAAO,CACL,eAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,eAAe,EAAE,wBAAwB,EAAE,aAEhF,cAAK,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,YACpE,eAAK,SAAS,EAAC,6BAA6B,aAC1C,aAAI,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,4BAExE,EACL,YAAG,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,iEAExE,IACA,GACF,EAGN,cAAK,SAAS,EAAC,6BAA6B,YAC1C,cAAK,SAAS,EAAC,mBAAmB,YAChC,KAAC,WAAW,OAAK,KAAK,GAAI,GACtB,GACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chainloyalty/react - RewardsDashboard Page
|
|
3
|
+
*
|
|
4
|
+
* A full-page wrapper for the RewardsDashboard component.
|
|
5
|
+
* Use this in your app's routing to display rewards on a dedicated page.
|
|
6
|
+
*
|
|
7
|
+
* Example usage in your app's router:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { RewardsDashboardPage } from '@chainloyalty/react';
|
|
10
|
+
*
|
|
11
|
+
* // Add to your routes
|
|
12
|
+
* { path: '/rewards', element: <RewardsDashboardPage walletAddress={userWallet} /> }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import { type RewardsDashboardProps } from '../RewardsDashboard.js';
|
|
17
|
+
export declare const RewardsDashboardPage: React.FC<RewardsDashboardProps>;
|
|
18
|
+
export default RewardsDashboardPage;
|
|
19
|
+
//# sourceMappingURL=RewardsDashboardPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsDashboardPage.d.ts","sourceRoot":"","sources":["../../src/pages/RewardsDashboardPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAuBhE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RewardsDashboard } from '../RewardsDashboard.js';
|
|
3
|
+
export const RewardsDashboardPage = (props) => {
|
|
4
|
+
return (_jsxs("div", { className: "min-h-screen", style: { backgroundColor: 'hsl(var(--background))' }, children: [_jsx("div", { className: "border-b", style: { borderColor: 'hsl(var(--border))' }, children: _jsxs("div", { className: "container mx-auto px-4 py-6", children: [_jsx("h1", { className: "text-3xl font-bold", style: { color: 'hsl(var(--foreground))' }, children: "Your Rewards" }), _jsx("p", { className: "text-sm mt-1", style: { color: 'hsl(var(--muted-foreground))' }, children: "Track your points, badges, achievements, and tier level" })] }) }), _jsx("div", { className: "container mx-auto px-4 py-8", children: _jsx("div", { className: "max-w-4xl mx-auto", children: _jsx(RewardsDashboard, { ...props }) }) })] }));
|
|
5
|
+
};
|
|
6
|
+
export default RewardsDashboardPage;
|
|
7
|
+
//# sourceMappingURL=RewardsDashboardPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsDashboardPage.js","sourceRoot":"","sources":["../../src/pages/RewardsDashboardPage.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,gBAAgB,EAA8B,MAAM,wBAAwB,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAoC,CAAC,KAAK,EAAE,EAAE;IAC7E,OAAO,CACL,eAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,eAAe,EAAE,wBAAwB,EAAE,aAEhF,cAAK,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE,YACpE,eAAK,SAAS,EAAC,6BAA6B,aAC1C,aAAI,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,6BAExE,EACL,YAAG,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,8BAA8B,EAAE,wEAExE,IACA,GACF,EAGN,cAAK,SAAS,EAAC,6BAA6B,YAC1C,cAAK,SAAS,EAAC,mBAAmB,YAChC,KAAC,gBAAgB,OAAK,KAAK,GAAI,GAC3B,GACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainloyalty/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "ChainLoyalty React Components -
|
|
5
|
+
"description": "ChainLoyalty React Components - Rewards dashboard and leaderboard pages with automatic theme detection. Install and add routes to your app.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
package/src/index.ts
CHANGED
|
@@ -14,9 +14,13 @@ export type { RewardsDashboardProps, Badge, RewardHistoryItem, TierInfo, Dashboa
|
|
|
14
14
|
export { Leaderboard } from './Leaderboard.js';
|
|
15
15
|
export type { LeaderboardProps, LeaderboardEntry, LeaderboardTimeframe } from './Leaderboard.js';
|
|
16
16
|
|
|
17
|
+
// Export page components
|
|
18
|
+
export { RewardsDashboardPage } from './pages/RewardsDashboardPage.js';
|
|
19
|
+
export { LeaderboardPage } from './pages/LeaderboardPage.js';
|
|
20
|
+
|
|
17
21
|
// Export theme utilities
|
|
18
22
|
export { getThemeColors, getThemeStylesheet, createThemeStyles } from './theme.js';
|
|
19
23
|
export type { ThemeColors } from './theme.js';
|
|
20
24
|
|
|
21
25
|
// Version info
|
|
22
|
-
export const PACKAGE_VERSION = '1.
|
|
26
|
+
export const PACKAGE_VERSION = '1.3.0';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chainloyalty/react - Leaderboard Page
|
|
3
|
+
*
|
|
4
|
+
* A full-page wrapper for the Leaderboard component.
|
|
5
|
+
* Use this in your app's routing to display the leaderboard on a dedicated page.
|
|
6
|
+
*
|
|
7
|
+
* Example usage in your app's router:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { LeaderboardPage } from '@chainloyalty/react';
|
|
10
|
+
*
|
|
11
|
+
* // Add to your routes
|
|
12
|
+
* { path: '/leaderboard', element: <LeaderboardPage walletAddress={userWallet} /> }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { Leaderboard, type LeaderboardProps } from '../Leaderboard.js';
|
|
18
|
+
|
|
19
|
+
export const LeaderboardPage: React.FC<LeaderboardProps> = (props) => {
|
|
20
|
+
return (
|
|
21
|
+
<div className="min-h-screen" style={{ backgroundColor: 'hsl(var(--background))' }}>
|
|
22
|
+
{/* Header */}
|
|
23
|
+
<div className="border-b" style={{ borderColor: 'hsl(var(--border))' }}>
|
|
24
|
+
<div className="container mx-auto px-4 py-6">
|
|
25
|
+
<h1 className="text-3xl font-bold" style={{ color: 'hsl(var(--foreground))' }}>
|
|
26
|
+
Leaderboard
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="text-sm mt-1" style={{ color: 'hsl(var(--muted-foreground))' }}>
|
|
29
|
+
See how you rank against other community members
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
{/* Content */}
|
|
35
|
+
<div className="container mx-auto px-4 py-8">
|
|
36
|
+
<div className="max-w-6xl mx-auto">
|
|
37
|
+
<Leaderboard {...props} />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default LeaderboardPage;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chainloyalty/react - RewardsDashboard Page
|
|
3
|
+
*
|
|
4
|
+
* A full-page wrapper for the RewardsDashboard component.
|
|
5
|
+
* Use this in your app's routing to display rewards on a dedicated page.
|
|
6
|
+
*
|
|
7
|
+
* Example usage in your app's router:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { RewardsDashboardPage } from '@chainloyalty/react';
|
|
10
|
+
*
|
|
11
|
+
* // Add to your routes
|
|
12
|
+
* { path: '/rewards', element: <RewardsDashboardPage walletAddress={userWallet} /> }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { RewardsDashboard, type RewardsDashboardProps } from '../RewardsDashboard.js';
|
|
18
|
+
|
|
19
|
+
export const RewardsDashboardPage: React.FC<RewardsDashboardProps> = (props) => {
|
|
20
|
+
return (
|
|
21
|
+
<div className="min-h-screen" style={{ backgroundColor: 'hsl(var(--background))' }}>
|
|
22
|
+
{/* Header */}
|
|
23
|
+
<div className="border-b" style={{ borderColor: 'hsl(var(--border))' }}>
|
|
24
|
+
<div className="container mx-auto px-4 py-6">
|
|
25
|
+
<h1 className="text-3xl font-bold" style={{ color: 'hsl(var(--foreground))' }}>
|
|
26
|
+
Your Rewards
|
|
27
|
+
</h1>
|
|
28
|
+
<p className="text-sm mt-1" style={{ color: 'hsl(var(--muted-foreground))' }}>
|
|
29
|
+
Track your points, badges, achievements, and tier level
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
{/* Content */}
|
|
35
|
+
<div className="container mx-auto px-4 py-8">
|
|
36
|
+
<div className="max-w-4xl mx-auto">
|
|
37
|
+
<RewardsDashboard {...props} />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default RewardsDashboardPage;
|