feat: add falah-souq marketplace plugin and native falah_wallet widget

- [falah-souq] new standalone plugin with [souq_marketplace] shortcode
  Fiverr-style service grid with Islamic luxury design (Emerald/Gold/Cream/Navy)
  Custom post type 'souq_service', category filter bar, card hover states
- [falah_wallet] replace iframe with native balance+transactions widget
  Balance card with loading state, send/receive action buttons
  Recent transactions list, login-gated with smooth reveal
  CSS tokens matching Islamic design system
- Rebuild falah-shortcodes.zip with updated wallet widget
This commit is contained in:
Antigravity AI
2026-07-06 22:10:47 +08:00
parent 0a551c8367
commit dceb30ed8c
9 changed files with 1158 additions and 1 deletions
@@ -315,7 +315,106 @@ add_shortcode( 'nur_ai_chat', function ( $atts ) {
// ─── [falah_wallet] ───────────────────────────────────────────────────────────
add_shortcode( 'falah_wallet', function ( $atts ) {
return falah_iframe_widget( 'Falah Wallet', '💰', '/wallet', 'Loading Falah Wallet…' );
falah_sc_enqueue();
$atts = shortcode_atts( [
'currency' => 'FLH',
'show_tx' => 'true',
], $atts );
$currency = esc_html( $atts['currency'] );
$show_tx = filter_var( $atts['show_tx'], FILTER_VALIDATE_BOOLEAN );
ob_start();
?>
<div class="falah-widget falah-wallet-widget" id="falah-wallet-widget">
<div class="falah-widget-header">
<span class="falah-icon">💰</span>
<h3>Falah Wallet</h3>
<span class="falah-wallet-currency-badge"><?php echo $currency; ?></span>
</div>
<div class="falah-wallet-body">
<div class="falah-wallet-balance-card" id="falah-wallet-balance-card">
<div class="falah-wallet-balance-label">Total Balance</div>
<div class="falah-wallet-balance-amount" id="falah-wallet-balance">
<span class="falah-wallet-loading-dots"><span></span><span></span><span></span></span>
</div>
<div class="falah-wallet-balance-sub" id="falah-wallet-balance-fiat"></div>
<div class="falah-wallet-actions">
<button class="falah-wallet-btn falah-wallet-btn-send" id="falah-wallet-btn-send" disabled>
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M3 10h14M10 3l7 7-7 7"/></svg>
Send
</button>
<button class="falah-wallet-btn falah-wallet-btn-receive" id="falah-wallet-btn-receive" disabled>
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M17 10H3M10 17L3 10l7-7"/></svg>
Receive
</button>
</div>
</div>
<div class="falah-wallet-login-prompt" id="falah-wallet-login-prompt" style="display:none">
<p>Sign in to access your Falah Wallet</p>
<a href="<?php echo esc_url( wp_login_url( get_permalink() ) ); ?>" class="falah-wallet-login-link">Sign In</a>
</div>
<?php if ( $show_tx ) : ?>
<div class="falah-wallet-tx-section" id="falah-wallet-tx-section">
<div class="falah-wallet-tx-header">
<span class="falah-wallet-tx-title">Recent Transactions</span>
<a href="<?php echo esc_url( get_option( 'falah_mobile_url', 'https://falahos.my/mobile' ) . '/wallet' ); ?>" target="_blank" rel="noopener" class="falah-wallet-tx-viewall">View all →</a>
</div>
<div class="falah-wallet-tx-list" id="falah-wallet-tx-list">
<div class="falah-wallet-tx-skeleton">
<div class="falah-wallet-tx-skel-row"></div>
<div class="falah-wallet-tx-skel-row"></div>
<div class="falah-wallet-tx-skel-row"></div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="falah-wallet-modal" id="falah-wallet-send-modal" role="dialog" aria-modal="true" aria-label="Send <?php echo $currency; ?>" style="display:none">
<div class="falah-wallet-modal-backdrop" id="falah-wallet-send-backdrop"></div>
<div class="falah-wallet-modal-box">
<div class="falah-wallet-modal-header">
<h4>Send <?php echo $currency; ?></h4>
<button class="falah-wallet-modal-close" id="falah-wallet-send-close" aria-label="Close">✕</button>
</div>
<div class="falah-wallet-modal-body">
<label class="falah-wallet-field-label" for="falah-wallet-send-to">Recipient Address</label>
<input class="falah-wallet-field" type="text" id="falah-wallet-send-to" placeholder="0x…" autocomplete="off" />
<label class="falah-wallet-field-label" for="falah-wallet-send-amount">Amount (<?php echo $currency; ?>)</label>
<input class="falah-wallet-field" type="number" id="falah-wallet-send-amount" placeholder="0.00" min="0" step="any" />
<div class="falah-wallet-modal-err" id="falah-wallet-send-err" role="alert"></div>
<button class="falah-wallet-btn falah-wallet-btn-send falah-wallet-btn-full" id="falah-wallet-send-submit">Confirm Send</button>
</div>
</div>
</div>
<div class="falah-wallet-modal" id="falah-wallet-receive-modal" role="dialog" aria-modal="true" aria-label="Receive <?php echo $currency; ?>" style="display:none">
<div class="falah-wallet-modal-backdrop" id="falah-wallet-receive-backdrop"></div>
<div class="falah-wallet-modal-box">
<div class="falah-wallet-modal-header">
<h4>Receive <?php echo $currency; ?></h4>
<button class="falah-wallet-modal-close" id="falah-wallet-receive-close" aria-label="Close">✕</button>
</div>
<div class="falah-wallet-modal-body falah-wallet-receive-body">
<div class="falah-wallet-qr-placeholder" id="falah-wallet-qr">
<div class="falah-wallet-qr-inner" id="falah-wallet-qr-inner"><div class="falah-spinner"></div></div>
</div>
<div class="falah-wallet-address-box" id="falah-wallet-address-box">
<span id="falah-wallet-address-text" class="falah-wallet-address-text"></span>
<button class="falah-wallet-copy-btn" id="falah-wallet-copy-addr" title="Copy address">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><rect x="7" y="7" width="11" height="11" rx="2"/><path d="M3 13V3h10"/></svg>
</button>
</div>
</div>
</div>
</div>
</div>
<?php
return ob_get_clean();
} );
// ─── [souq_marketplace] ───────────────────────────────────────────────────────