310 Commits

Author SHA1 Message Date
pezkuwichain 645e703600 fix: auto-read citizen number from NFT role card instead of wallet address
Replaces the buggy useEffect that derived citizen number from wallet
address (and re-triggered whenever user cleared the field) with a clean
sync from DashboardContext's NFT-derived citizenNumber. Field is read-only
when NFT data is present, preventing the refill loop entirely.
2026-04-22 01:23:09 +03:00
pezkuwichain 672682558f chore: migrate git dependencies to Gitea mirror (git.pezkuwichain.io) 2026-04-21 18:52:54 +03:00
pezkuwichain 95bf48f240 feat: show citizen ID in role card, show Welati in KYC status card 2026-04-21 05:22:19 +03:00
pezkuwichain e895a6611c fix: restore Pez-DEX button alongside new KRD Exchange button
Finance section now has both:
- Exchange: PezkuwiExchange.png logo → opens exchange.pezkuwichain.io (new tab)
- Pez-DEX: internal /dex route (auth required)
2026-04-14 18:08:36 +03:00
pezkuwichain ddc251fda3 feat: add Exchange button in finance card linking to exchange.pezkuwichain.io
- Use PezkuwiExchange.png logo instead of emoji for exchange app icon
- External link opens exchange.pezkuwichain.io in new tab (noopener)
- No auth required (exchange is publicly accessible)
- Added imgIcon and href fields to AppItem interface
2026-04-14 17:50:57 +03:00
pezkuwichain 3f5ccdc5e0 feat: replace sun emoji with Kurdistan sun SVG on identity card and passport
Co-Authored-By: Kurdistan Tech Ministry <noreply@pezkuwichain.io>
2026-04-09 16:09:19 +03:00
pezkuwichain 892c78324f feat: add University, Certificates (Perwerde), Research education pages
- UniversityPage (/education/university): static course catalog, 6 courses, level badges, enroll redirects to Perwerde
- CertificatesPage (/education/certificates): blockchain-connected Perwerde platform, 3 tabs (Kurs/Tev li/Qediya), real api.query.perwerde + api.tx.perwerde.enroll, score tracker
- ResearchPage (/education/research): 5 academic papers, expandable abstracts, status badges, submit CTA
- Wire routes in App.tsx, remove comingSoon from all 3 in MobileHomeLayout
- Add university.*, certificates.*, research.* i18n keys to en.ts
2026-04-09 08:51:21 +03:00
pezkuwichain c56e021a6b feat: add KurdMedia, Help pages + fix Docs + wire routes + i18n (6 langs)
- Add KurdMediaPage (/social/kurdmedia): DKS media channels + social platform links
- Add HelpPage (/help): coming soon with planned features + WhatsKURD shortcut
- Rewrite Docs.tsx (/docs): clean documentation overview with section cards + docs.pezkuwichain.io button
- Wire new routes in App.tsx: /social/kurdmedia, /help
- Update MobileHomeLayout: kurdMedia → /social/kurdmedia, help → /help (fix crash)
- Add i18n keys to all 6 locales: kurdMedia.*, help.*, docs.section.*, messaging.palletNotReady
2026-04-09 08:19:45 +03:00
pezkuwichain eaccf65beb feat: activate whatsKURD button — mobile-styled encrypted messaging page
- Add WhatsKURDPage with mobile header, reusing useMessaging hook,
  KeySetup, InboxMessage, ComposeDialog components
- Route /social/whatskurd wired in App.tsx
- Remove comingSoon from whatsKURD in MobileHomeLayout
2026-04-09 08:03:12 +03:00
pezkuwichain b965b4a507 feat: add i18n support (6 langs) to governance and finance pages
- Add assembly/justice/polls/bank/taxZekat translation keys to all 6
  locale files: en, kmr (Kurmanji), ckb (Sorani), tr, ar, fa
- Wire useTranslation() into AssemblyPage, JusticePage, PollsPage,
  BankPage, TaxZekatPage — all hardcoded bilingual strings replaced
- TaxZekat success message now uses i18n key with amount interpolation
2026-04-09 07:41:03 +03:00
pezkuwichain f22ad439e4 fix: escape apostrophe in JusticePage for eslint 2026-04-09 04:20:37 +03:00
pezkuwichain c5f369776c feat: add governance pages (Assembly, Justice, Polls) to web
- Add AssemblyPage with members tab (7 members) and sessions tab
- Add JusticePage with dispute cases, expandable cards, status stats
- Add PollsPage with interactive voting and results progress bars
- Wire routes /governance/assembly, /governance/justice, /governance/polls in App.tsx
- Activate assembly, justice, polls buttons in MobileHomeLayout (remove comingSoon)
2026-04-09 04:02:40 +03:00
pezkuwichain 3b9b7c2643 feat: add Bank and TaxZekat pages, activate finance buttons on web 2026-04-09 03:52:21 +03:00
pezkuwichain 51ccac54fe fix: replace iframe with direct redirect to bereketli.pezkiwi.app/app
Token exchange still happens, but instead of embedding in iframe,
user is redirected to Bereketli with auth tokens in URL.
2026-04-08 16:26:06 +03:00
pezkuwichain 6eb0ba99ab fix: iframe height fills available space between header and tab bar 2026-04-08 06:50:49 +03:00
pezkuwichain 55b45584ed fix: pass embed param to bereketli iframe 2026-04-08 05:59:27 +03:00
pezkuwichain e465108ef5 fix: add logout button to member since card on mobile 2026-04-08 05:46:48 +03:00
pezkuwichain 841fcdbf54 feat: integrate Bereketli via iframe with Supabase token bridge
B2B button now opens Bereketli (bereketli.pezkiwi.app) embedded in an
iframe. PWAP exchanges the user's Supabase JWT for a Bereketli JWT
via the existing /v1/auth/exchange endpoint, then passes tokens to
the iframe via postMessage. User never sees a login screen.

- New /bereketli route (ProtectedRoute)
- Token caching in localStorage (10 min TTL)
- Camera + geolocation permissions on iframe
- Desktop and mobile layouts supported
- Re-auth on token expiry via postMessage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 02:23:27 +03:00
pezkuwichain d475861dd6 fix: i18n all hard-coded strings in mobile layout
Section titles (FINANCE, GOVERNANCE, SOCIAL, EDUCATION) and all app
names are now translated via i18n keys instead of hard-coded English.
Added translations for all 6 languages (en, tr, kmr, ckb, ar, fa).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 00:56:00 +03:00
pezkuwichain 8bae697885 fix: remove unused variables in Identity.tsx to pass linter
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:51:29 +03:00
pezkuwichain e39a1f192a feat: add mobile layout with native app UX, identity page with ID card & passport
Mobile users (<768px) now see a native app-style home page with:
- Green gradient header with avatar, greeting, language/wallet/notification
- Horizontal scrollable score cards (auth-aware: login prompt for guests)
- App grid sections (Finance, Governance, Social, Education) with 4-col layout
- Bottom tab bar (Home / Citizen / Referral)
- MobileShell wrapper for consistent mobile navigation across pages

BeCitizen page redesigned for mobile with full-viewport hero screen,
scroll-to-reveal content, and compact benefits/process cards.

New Identity page (/identity) with realistic Kurdistan Republic ID card
and passport design. Users can fill personal info, upload photo from
camera/gallery, and save to device (localStorage only).

Desktop layout completely untouched. i18n keys added for all 6 languages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 23:39:21 +03:00
pezkuwichain 5f104fed31 feat: hide chain spec cards on mobile, keep mainnet details visible
Mobile users only see the Mainnet detail card (WebSocket endpoint,
Chain ID, explorer button, services grid). The individual chain
cards (Staging, Testnet, Beta, etc.) and subdomains box are hidden
on mobile and visible on md+ screens.
2026-03-15 05:43:12 +03:00
pezkuwichain 97c77c5c71 feat: hide Google sign-in in embedded WebView (DApps browser)
Google blocks OAuth in WebViews (disallowed_useragent policy).
Detect WebView and hide the Google button, users in DApps browser
use email/password instead. Google sign-in still works in real
browsers (Chrome, Safari, etc).
2026-03-15 05:30:17 +03:00
pezkuwichain c439c7cf44 feat: add Google OAuth sign-in button to login page
Users can now sign in with their Google account via Supabase OAuth.
Google button appears above wallet connect in the "Or continue with" section.
2026-03-15 05:16:12 +03:00
pezkuwichain d6cfa855c0 feat: mobile layout - hide Learn More button, show Mainnet card after hero
Mobile users now see ChainSpecs (Mainnet card) right below the hero
section instead of scrolling far down. "Learn More" button hidden on
mobile since Mainnet card replaces its function.
2026-03-15 04:50:31 +03:00
pezkuwichain 8d4c51f847 fix: refresh inbox after key unlock + query previous era for message visibility
- Call refreshInbox() immediately after setupKey/unlockKey so messages
  decrypt instantly instead of waiting for 12s polling interval
- Query both current and previous era to prevent message loss at era
  boundaries
- Add toJSON fallback for robust field parsing in getInbox
- Improve debug logging with era, address, and field diagnostics
2026-03-04 16:03:21 +03:00
pezkuwichain 146e3b7127 debug: show first bytes of each field for hex comparison 2026-03-04 04:53:42 +03:00
pezkuwichain ce1391666c fix: verify derived key matches on-chain key during unlock 2026-03-04 04:37:07 +03:00
pezkuwichain 3ba1ac31b8 debug: show field lengths and try multiple field name patterns 2026-03-04 04:23:30 +03:00
pezkuwichain 12618885a0 fix: add eslint-disable for debug log 2026-03-04 03:59:36 +03:00
pezkuwichain 1412d9b1d5 debug: show decrypt errors on screen for troubleshooting 2026-03-04 03:57:23 +03:00
pezkuwichain 1f51f08c06 fix(web): use separate args for StorageDoubleMap inbox/sendCount queries
messaging.inbox and messaging.sendCount are StorageDoubleMaps keyed by
(era, address). Passing [era, address] as a single array produced empty
results; split into two arguments so the API constructs the correct
storage key.
2026-03-04 03:32:41 +03:00
pezkuwichain 568fd069cf fix(web): guard messaging against missing pallet + add back-to-home
- Check isPalletAvailable() BEFORE requesting wallet signature
- All chain queries return safe defaults if pallet not in runtime
- Show orange banner when messaging pallet needs runtime upgrade
- Add floating back-to-home button on messaging page
2026-03-03 08:40:41 +03:00
pezkuwichain a9cb2972b9 feat(web): add PEZMessage on-chain E2E encrypted messaging UI
- x25519 ECDH + XChaCha20-Poly1305 encryption via @noble libs
- Key derivation from wallet signRaw, private key held in memory only
- Messaging pallet integration (registerEncryptionKey, sendMessage, inbox)
- Inbox polling every 12s, auto-decrypt when key unlocked
- ComposeDialog with recipient key validation and 512-byte limit
- Settings moved from grid to nav bar gear icon, PEZMessage takes its slot
- i18n translations for all 6 languages (en, tr, kmr, ckb, ar, fa)
2026-03-03 08:29:16 +03:00
pezkuwichain 419e75f38e fix: update referral share text with localized invitation message
Share text now includes friendly invitation + wallet address for
manual paste. Hardcoded English text replaced with i18n keys.
2026-02-28 02:35:25 +03:00
pezkuwichain c64c4bf00f fix: wait 12s before auto-verify to allow block inclusion
TX was not yet included in a block when verify fired immediately
after signing, causing first attempt to always fail. Block time on
Asset Hub is ~12s, so delay the verify call accordingly.
2026-02-26 15:55:49 +03:00
pezkuwichain aa7cc78de8 fix: auto-verify deposit after TX sign, remove manual verify step
The manual "Verify Deposit" step required users to click a button after
signing. Hash was already captured automatically, making the manual step
redundant and risky (modal close = hash lost). Now verification starts
immediately after TX is signed, with spinner UI and retry on failure.
2026-02-26 15:30:30 +03:00
pezkuwichain 3e310fb980 fix: improve CitizensIssues mobile UI — two-line tab labels, responsive header 2026-02-25 05:58:58 +03:00
pezkuwichain 60bdf84816 fix: improve mobile UI across all pages for 360px screens
- AppLayout: tighter button grid, smaller icons/fonts, centered dropdowns, narrower mobile menu
- HeroSection: smaller stats padding/gap, compact CTA buttons
- GovernmentEntrance: responsive title/tabs/vote layout, smaller action buttons
- Citizens: smaller portal title and announcement header
- GovernanceInterface: 2-col tab grid on mobile
2026-02-25 04:39:05 +03:00
pezkuwichain 05280cbd45 fix: move Start Citizenship button to top bar and Ready to Join card above benefits grid 2026-02-24 23:56:07 +03:00
pezkuwichain cccf5dec21 fix: improve DEX page mobile UI — smaller back button, taller chart, compact swap card
- Back to Home button: smaller padding/font on mobile, pinned to corner
- PriceChart: increase height to 280px, stack header vertically on mobile
- TokenSwap: reduce padding/gaps/fonts on mobile, fix double-colon in balance text
2026-02-24 23:48:17 +03:00
pezkuwichain 8232cdb0e1 fix: extract actual error from process-withdraw edge function response
Supabase JS client wraps non-2xx responses as generic FunctionsHttpError
("Edge Function returned a non-2xx status code"), hiding the real error.
Now reads the response body to show the actual error message.

Also adds migration to drop auth.users FK on p2p_withdrawal_limits
(already absent in production, added for migration completeness).
2026-02-24 23:01:50 +03:00
pezkuwichain 53854abba9 fix: remove unused getApprovedChainId and stale eslint-disable 2026-02-24 22:24:44 +03:00
pezkuwichain 6c1865cf55 fix: require all chains in WC session and use correct chainId
Three fixes for WC signing:

1. Changed optionalNamespaces to requiredNamespaces so wallet MUST
   approve all Pezkuwi chains (relay, asset hub, people) or reject.

2. Restored payload-based chainId in signPayload — wallet validates
   that WC chainId matches the transaction payload's genesisHash
   and rejects mismatches with "Wrong chain id passed by dApp".

3. Added session validation on restore — old sessions missing
   required chains are discarded, forcing a fresh session with
   all chains included.
2026-02-24 22:20:37 +03:00
pezkuwichain e6c8f2a537 fix: add missing useEffect dependencies in P2P components 2026-02-24 22:16:32 +03:00
pezkuwichain 5dc4298974 fix: send plain SS58 address in WC signPayload instead of CAIP-10 2026-02-24 22:10:46 +03:00
pezkuwichain c79966c192 fix: expose actual WC error message instead of generic fallback 2026-02-24 22:01:49 +03:00
pezkuwichain 1bedda8006 fix: use session-approved chainId for WC signing requests
WC SignClient validates that the request chainId is in the session's
approved namespaces. When the DApp browser creates a session, it may
only approve the relay chain. Signing requests for Asset Hub or People
Chain then fail with "Missing or invalid chainId".

Fix: always use a chainId from the session's approved chains for the
WC request. The wallet determines the actual signing chain from the
transaction payload's genesisHash, not from the WC request chainId.
2026-02-24 20:36:56 +03:00
pezkuwichain 8b906f0b84 fix: hardcode chain genesis hashes in WC session to fix signing
WC session was missing Asset Hub and People Chain because their APIs
weren't connected yet at session creation time. Also fix catch blocks
in ExistingCitizenAuth that referenced undefined err variable.
2026-02-24 20:00:20 +03:00
pezkuwichain aac6c6581c fix: rewrite ID card to flow layout for mobile readability 2026-02-24 10:42:14 +03:00