forked from Nova-reward/Nova-Rewards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelpCenterFAQ.js
More file actions
263 lines (251 loc) · 10.4 KB
/
Copy pathHelpCenterFAQ.js
File metadata and controls
263 lines (251 loc) · 10.4 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
import { useState } from 'react';
/**
* Fires when a user votes on an FAQ item.
* Replace the console.log with an API call when the endpoint is ready.
* @param {string} id - FAQ item identifier (e.g. "faq-1")
* @param {boolean} helpful - true = Yes, false = No
*/
function handleFAQFeedback(id, helpful) {
console.log('[FAQ feedback]', { id, helpful });
}
function FAQItem({ id, question, answer }) {
const [open, setOpen] = useState(false);
const [voted, setVoted] = useState(null); // null | 'yes' | 'no'
function vote(value) {
if (voted) return;
setVoted(value);
handleFAQFeedback(id, value === 'yes');
}
return (
<div className="faq-item">
<button
className="faq-question"
onClick={() => setOpen(!open)}
aria-expanded={open}
>
<span>{question}</span>
<span className="faq-chevron">{open ? '▲' : '▼'}</span>
</button>
{open && (
<div className="faq-answer">
<p>{answer}</p>
<div className="faq-feedback">
<span className="faq-feedback-label">Was this helpful?</span>
<button
className={`faq-feedback-btn${voted === 'yes' ? ' faq-feedback-btn--active' : ''}`}
onClick={() => vote('yes')}
disabled={!!voted}
aria-label="Yes, this was helpful"
>
👍 Yes
</button>
<button
className={`faq-feedback-btn${voted === 'no' ? ' faq-feedback-btn--active' : ''}`}
onClick={() => vote('no')}
disabled={!!voted}
aria-label="No, this was not helpful"
>
👎 No
</button>
{voted && (
<span className="faq-feedback-thanks">Thanks for your feedback!</span>
)}
</div>
</div>
)}
</div>
);
}
function FAQSection({ title, items }) {
return (
<section className="faq-section">
<h2 className="faq-section-title">{title}</h2>
{items.map((item) => (
<FAQItem key={item.id} {...item} />
))}
</section>
);
}
const FAQ_DATA = [
{
section: '🚀 Getting Started',
items: [
{
id: 'faq-1',
question: 'What is Nova Rewards?',
answer:
'Nova Rewards is a loyalty platform that lets you earn digital reward points every time you shop with participating merchants. Your points are stored securely and can be redeemed for discounts, vouchers, and other perks — all in one place.',
},
{
id: 'faq-2',
question: 'How do I create an account?',
answer:
'Click Sign Up on the homepage and fill in your name, email address, and a password (at least 8 characters). Once you submit, your account is created instantly and you can start earning points right away.',
},
{
id: 'faq-3',
question: 'Do I need to verify my identity (KYC)?',
answer:
'For basic earning and redemption, no identity verification is required. If you want to withdraw rewards above a certain threshold or access advanced features, we may ask you to complete a quick identity check. You\'ll be guided through it step by step inside the app.',
},
{
id: 'faq-4',
question: 'Is Nova Rewards free to use?',
answer:
'Yes. Creating an account and earning points costs nothing. Some premium redemption options may have a minimum point requirement, but there are no subscription fees.',
},
{
id: 'faq-5',
question: 'I forgot my password. How do I reset it?',
answer:
'On the login page, click Forgot Password and enter your email address. You\'ll receive a reset link within a few minutes. Check your spam folder if it doesn\'t arrive.',
},
],
},
{
section: '🎁 Points & Rewards',
items: [
{
id: 'faq-6',
question: 'How do I earn points?',
answer:
'Points are awarded automatically when a participating merchant sends you a reward after a qualifying action — such as making a purchase, completing a referral, or taking part in a campaign.',
},
{
id: 'faq-7',
question: 'How do I redeem my points?',
answer:
'Go to the Rewards page, browse the available items, and click Redeem next to the one you want. Your points will be deducted and the reward will be confirmed on screen. You\'ll also receive a confirmation email.',
},
{
id: 'faq-8',
question: 'Can my points expire?',
answer:
'Points do not expire under normal circumstances. If a merchant\'s campaign ends, any points tied specifically to that campaign may no longer be redeemable for campaign-specific perks. Your general point balance is always yours to keep.',
},
{
id: 'faq-9',
question: 'What are Drops, and how do I claim one?',
answer:
'Drops are limited-time bonus rewards released to eligible users. When a Drop is available for your account, a notification will appear on your dashboard. Click Claim to add the bonus points to your balance. Each Drop can only be claimed once.',
},
{
id: 'faq-10',
question: 'What is the referral bonus?',
answer:
'When you invite a friend using your personal referral link and they sign up and complete their first qualifying action, both you and your friend receive a bonus. Find your referral link on the Referral page in the sidebar.',
},
],
},
{
section: '💳 Wallet & Tokens',
items: [
{
id: 'faq-11',
question: 'What is a Stellar wallet, and do I need one?',
answer:
'Nova Rewards uses the Stellar network to record and transfer your reward tokens securely. Think of a Stellar wallet as a secure digital pocket that holds your tokens. We recommend the free Freighter browser extension as the easiest option.',
},
{
id: 'faq-12',
question: 'How do I connect my Stellar wallet?',
answer:
'Install the Freighter browser extension, create or import a wallet inside it, then click Connect Wallet on your Nova Rewards dashboard. Freighter will ask you to approve the connection — click Approve. Your wallet address will then appear on your dashboard.',
},
{
id: 'faq-13',
question: 'What is a "trustline" and why do I need to set one up?',
answer:
'Before your wallet can receive NOVA tokens, it needs to be told to accept them — this is called a trustline. It\'s a one-time setup. On your dashboard, click Add NOVA Trustline and approve the security confirmation in Freighter. You only need to do this once.',
},
{
id: 'faq-14',
question: 'What is staking, and how does it work?',
answer:
'Staking means locking a portion of your NOVA tokens to earn extra bonus tokens over time. Choose an amount to stake on your dashboard, confirm, and your tokens are locked. While staked, your balance grows based on the current annual reward rate. When you unstake, you receive your original tokens back plus any bonus earned.',
},
{
id: 'faq-15',
question: 'Can I unstake my tokens early?',
answer:
'Yes. You can unstake at any time. Your bonus is calculated up to the moment you unstake, so you\'ll still receive any bonus earned so far — you just won\'t earn further bonus after unstaking.',
},
{
id: 'faq-16',
question: 'Is my wallet safe?',
answer:
'Nova Rewards never stores your private wallet key — only you hold that through Freighter. All token transfers require your explicit approval via a security confirmation pop-up. Admin functions use multi-approval controls, and all smart contracts have been independently audited.',
},
],
},
{
section: '⚙️ Account Settings',
items: [
{
id: 'faq-17',
question: 'How do I update my profile information?',
answer:
'Go to Settings from the sidebar. You can update your display name, bio, and linked wallet address there. Changes are saved immediately.',
},
{
id: 'faq-18',
question: 'How do I change my password?',
answer:
'Password changes are handled on the Settings page under the Security section. You\'ll need to confirm your current password before making changes.',
},
{
id: 'faq-19',
question: 'How do I delete my account?',
answer:
'You can request account deletion from Settings → Account → Delete Account. Your personal information will be anonymised within 30 days. Your on-chain token balance is unaffected — tokens in your Stellar wallet remain yours.',
},
{
id: 'faq-20',
question: 'How do I contact support?',
answer:
'Use the Help button in the bottom-right corner of any page, or email us at support@novarewards.io. We aim to respond within one business day.',
},
],
},
];
export default function HelpCenterFAQ() {
const [search, setSearch] = useState('');
const filtered = search.trim()
? FAQ_DATA.map((section) => ({
...section,
items: section.items.filter(
(item) =>
item.question.toLowerCase().includes(search.toLowerCase()) ||
item.answer.toLowerCase().includes(search.toLowerCase())
),
})).filter((section) => section.items.length > 0)
: FAQ_DATA;
return (
<div className="faq-container">
<div className="faq-header">
<h1 className="faq-title">Help Center</h1>
<p className="faq-subtitle">
Find answers to common questions about Nova Rewards.
</p>
<input
className="faq-search"
type="search"
placeholder="Search questions…"
value={search}
onChange={(e) => setSearch(e.target.value)}
aria-label="Search FAQ"
/>
</div>
{filtered.length === 0 ? (
<p className="faq-no-results">
No results for “{search}”. Try different keywords or{' '}
<a href="mailto:support@novarewards.io">contact support</a>.
</p>
) : (
filtered.map((section) => (
<FAQSection key={section.section} title={section.section} items={section.items} />
))
)}
</div>
);
}