-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheducational-staking.tsx
More file actions
75 lines (68 loc) Β· 2.76 KB
/
educational-staking.tsx
File metadata and controls
75 lines (68 loc) Β· 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from 'react';
import { NEARLogin } from '../../src';
import type { AuthConfig } from '../../src';
// Example with educational tooltips and help text
const config: AuthConfig = {
requireStaking: true,
validator: {
poolId: 'vitalpoint.pool.near',
minStake: '10',
displayName: 'VitalPoint Validator',
description: 'A reliable validator with competitive rewards'
},
nearConfig: {
networkId: 'testnet'
}
};
function EducationalStakingApp() {
const handleToast = ({ title, description, variant }: { title?: string; description?: string; variant?: string }) => {
console.log(`${variant?.toUpperCase()}: ${title} - ${description}`);
// In a real app, you'd show this in a toast notification
alert(`${title}: ${description}`);
};
return (
<NEARLogin
config={config}
onToast={handleToast}
// Enable educational features
showHelp={true}
helpTexts={{
walletConnection: "Your NEAR wallet is like a secure digital keychain. It never shares your private keys with websites.",
staking: "By staking NEAR tokens, you help secure the network and earn rewards. Think of it like earning interest on your savings!",
stakingAmount: "Start small while learning! You can always stake more later. The minimum is usually 1-10 NEAR.",
validatorSelection: "Validators are trusted nodes that process transactions. Choose one with good uptime and reasonable fees."
}}
showEducation={true}
educationTopics={['what-is-wallet', 'why-near', 'how-staking-works', 'security-tips']}
useGuidedStaking={true}
>
<div style={{ padding: '20px', textAlign: 'center' }}>
<h1>π Welcome to the Educational Staking App!</h1>
<p>You've successfully completed the onboarding process and staked your NEAR tokens.</p>
<div style={{
marginTop: '30px',
padding: '20px',
backgroundColor: '#f0f8ff',
borderRadius: '10px',
border: '2px solid #1976d2'
}}>
<h2>π Premium Features Unlocked!</h2>
<ul style={{ textAlign: 'left', display: 'inline-block' }}>
<li>β
Access to exclusive content</li>
<li>β
Earn staking rewards (8-12% APY)</li>
<li>β
Priority support</li>
<li>β
Advanced analytics</li>
<li>β
Community governance voting</li>
</ul>
</div>
<div style={{ marginTop: '20px', fontSize: '14px', color: '#666' }}>
<p>
π‘ <strong>Pro tip:</strong> Your staking rewards compound automatically!
You can check your earnings in your NEAR wallet anytime.
</p>
</div>
</div>
</NEARLogin>
);
}
export default EducationalStakingApp;