Spaces:
Paused
Paused
CBV01 commited on
Commit ยท
6c2d0ad
1
Parent(s): 6b2f36c
feat: redesign payment & monetization modals with expanded centered layout, whatsapp link, and mailto
Browse files- backend/database.py +6 -5
- backend/main.py +3 -3
- frontend/src/components/MonetizationOverlay.tsx +0 -0
- frontend/src/components/Sidebar.tsx +10 -10
backend/database.py
CHANGED
|
@@ -414,13 +414,14 @@ def init_db():
|
|
| 414 |
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
| 415 |
verified_at DATETIME
|
| 416 |
)""")
|
| 417 |
-
except:
|
| 418 |
pass
|
|
|
|
| 419 |
try:
|
| 420 |
-
conn.execute("INSERT OR
|
| 421 |
-
conn.execute("INSERT OR
|
| 422 |
-
conn.execute("INSERT OR
|
| 423 |
-
except:
|
| 424 |
pass
|
| 425 |
|
| 426 |
# Fast path: check if database schema and seed data already exist to avoid 50+ sequential network round-trips
|
|
|
|
| 414 |
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
| 415 |
verified_at DATETIME
|
| 416 |
)""")
|
| 417 |
+
except Exception:
|
| 418 |
pass
|
| 419 |
+
|
| 420 |
try:
|
| 421 |
+
conn.execute("INSERT OR REPLACE INTO system_settings (key, value) VALUES ('whatsapp_number', 'https://wa.link/p0uv2l')")
|
| 422 |
+
conn.execute("INSERT OR REPLACE INTO system_settings (key, value) VALUES ('support_email', 'arkilostudios@gmail.com')")
|
| 423 |
+
conn.execute("INSERT OR REPLACE INTO system_settings (key, value) VALUES ('telegram_support', 'arkitel_support')")
|
| 424 |
+
except Exception:
|
| 425 |
pass
|
| 426 |
|
| 427 |
# Fast path: check if database schema and seed data already exist to avoid 50+ sequential network round-trips
|
backend/main.py
CHANGED
|
@@ -3379,7 +3379,7 @@ def send_plan_activation_email(to_email: str, username: str, plan_name: str, exp
|
|
| 3379 |
smtp_port = int(os.getenv("SMTP_PORT", "587"))
|
| 3380 |
smtp_user = os.getenv("SMTP_USER", "")
|
| 3381 |
smtp_pass = os.getenv("SMTP_PASS", "")
|
| 3382 |
-
smtp_from = os.getenv("SMTP_FROM", f"ArkiTel Automation <{smtp_user or '
|
| 3383 |
|
| 3384 |
subject = f"๐ Payment Verified: Your ArkiTel {plan_name.title()} Plan is Active!"
|
| 3385 |
|
|
@@ -3860,8 +3860,8 @@ async def get_system_settings():
|
|
| 3860 |
rows = conn.execute("SELECT key, value FROM system_settings").fetchall()
|
| 3861 |
settings = {r["key"]: r["value"] for r in rows}
|
| 3862 |
return {
|
| 3863 |
-
"whatsapp_number": settings.get("whatsapp_number", "
|
| 3864 |
-
"support_email": settings.get("support_email", "
|
| 3865 |
"telegram_support": settings.get("telegram_support", "arkitel_support")
|
| 3866 |
}
|
| 3867 |
finally:
|
|
|
|
| 3379 |
smtp_port = int(os.getenv("SMTP_PORT", "587"))
|
| 3380 |
smtp_user = os.getenv("SMTP_USER", "")
|
| 3381 |
smtp_pass = os.getenv("SMTP_PASS", "")
|
| 3382 |
+
smtp_from = os.getenv("SMTP_FROM", f"ArkiTel Automation <{smtp_user or 'arkilostudios@gmail.com'}>")
|
| 3383 |
|
| 3384 |
subject = f"๐ Payment Verified: Your ArkiTel {plan_name.title()} Plan is Active!"
|
| 3385 |
|
|
|
|
| 3860 |
rows = conn.execute("SELECT key, value FROM system_settings").fetchall()
|
| 3861 |
settings = {r["key"]: r["value"] for r in rows}
|
| 3862 |
return {
|
| 3863 |
+
"whatsapp_number": settings.get("whatsapp_number", "https://wa.link/p0uv2l"),
|
| 3864 |
+
"support_email": settings.get("support_email", "arkilostudios@gmail.com"),
|
| 3865 |
"telegram_support": settings.get("telegram_support", "arkitel_support")
|
| 3866 |
}
|
| 3867 |
finally:
|
frontend/src/components/MonetizationOverlay.tsx
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/src/components/Sidebar.tsx
CHANGED
|
@@ -41,8 +41,8 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
|
|
| 41 |
const [isDragging, setIsDragging] = useState(false);
|
| 42 |
const [showSupportModal, setShowSupportModal] = useState(false);
|
| 43 |
const [supportConfig, setSupportConfig] = useState({
|
| 44 |
-
whatsapp_number: '
|
| 45 |
-
support_email: '
|
| 46 |
telegram_support: 'arkitel_support'
|
| 47 |
});
|
| 48 |
const pathname = usePathname();
|
|
@@ -464,13 +464,13 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
|
|
| 464 |
|
| 465 |
{/* Support Modal */}
|
| 466 |
{showSupportModal && (
|
| 467 |
-
<div className="fixed inset-0 z-[70] flex items-center justify-center p-4">
|
| 468 |
<div
|
| 469 |
-
className="
|
| 470 |
onClick={() => setShowSupportModal(false)}
|
| 471 |
/>
|
| 472 |
-
<div className="relative w-full max-w-[
|
| 473 |
-
<div className="flex items-center justify-between pb-4 border-b border-white/
|
| 474 |
<div className="flex items-center gap-2.5">
|
| 475 |
<div className="w-9 h-9 rounded-xl bg-indigo-500/15 border border-indigo-500/30 flex items-center justify-center text-indigo-400">
|
| 476 |
<HelpCircle size={20} />
|
|
@@ -491,7 +491,7 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
|
|
| 491 |
<div className="space-y-3">
|
| 492 |
{/* Email Mailto Link */}
|
| 493 |
<a
|
| 494 |
-
href={`mailto:${supportConfig.support_email}?subject=ArkiTel%20Support%20Request%20-%20${encodeURIComponent(user?.username || '')}`}
|
| 495 |
className="flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.03] border border-white/5 hover:border-indigo-500/30 hover:bg-white/[0.05] transition-all group cursor-pointer"
|
| 496 |
>
|
| 497 |
<div className="flex items-center gap-3">
|
|
@@ -500,7 +500,7 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
|
|
| 500 |
</div>
|
| 501 |
<div>
|
| 502 |
<div className="text-xs font-bold text-white group-hover:text-indigo-400 transition-colors">Email Support</div>
|
| 503 |
-
<div className="text-[10px] text-foreground/40 font-mono">{supportConfig.support_email}</div>
|
| 504 |
</div>
|
| 505 |
</div>
|
| 506 |
<ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" />
|
|
@@ -508,7 +508,7 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
|
|
| 508 |
|
| 509 |
{/* WhatsApp Direct Link */}
|
| 510 |
<a
|
| 511 |
-
href={
|
| 512 |
target="_blank"
|
| 513 |
rel="noopener noreferrer"
|
| 514 |
className="flex items-center justify-between p-3.5 rounded-2xl bg-[#25D366]/5 border border-[#25D366]/20 hover:bg-[#25D366]/10 transition-all group cursor-pointer"
|
|
@@ -519,7 +519,7 @@ export function Sidebar({ children }: { children: React.ReactNode }) {
|
|
| 519 |
</div>
|
| 520 |
<div>
|
| 521 |
<div className="text-xs font-bold text-white group-hover:text-[#25D366] transition-colors">WhatsApp Live DM</div>
|
| 522 |
-
<div className="text-[10px] text-foreground/40 font-mono">
|
| 523 |
</div>
|
| 524 |
</div>
|
| 525 |
<ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" />
|
|
|
|
| 41 |
const [isDragging, setIsDragging] = useState(false);
|
| 42 |
const [showSupportModal, setShowSupportModal] = useState(false);
|
| 43 |
const [supportConfig, setSupportConfig] = useState({
|
| 44 |
+
whatsapp_number: 'https://wa.link/p0uv2l',
|
| 45 |
+
support_email: 'arkilostudios@gmail.com',
|
| 46 |
telegram_support: 'arkitel_support'
|
| 47 |
});
|
| 48 |
const pathname = usePathname();
|
|
|
|
| 464 |
|
| 465 |
{/* Support Modal */}
|
| 466 |
{showSupportModal && (
|
| 467 |
+
<div className="fixed inset-0 z-[70] flex items-center justify-center p-4 overflow-y-auto">
|
| 468 |
<div
|
| 469 |
+
className="fixed inset-0 bg-[#05060b]/85 backdrop-blur-xl"
|
| 470 |
onClick={() => setShowSupportModal(false)}
|
| 471 |
/>
|
| 472 |
+
<div className="relative my-auto w-full max-w-[480px] bg-gradient-to-b from-[#101322] to-[#0a0c14] border border-white/10 rounded-[30px] p-6 sm:p-7 shadow-[0_0_60px_rgba(99,102,241,0.2)] animate-in fade-in zoom-in-95 duration-200">
|
| 473 |
+
<div className="flex items-center justify-between pb-4 border-b border-white/10 mb-4">
|
| 474 |
<div className="flex items-center gap-2.5">
|
| 475 |
<div className="w-9 h-9 rounded-xl bg-indigo-500/15 border border-indigo-500/30 flex items-center justify-center text-indigo-400">
|
| 476 |
<HelpCircle size={20} />
|
|
|
|
| 491 |
<div className="space-y-3">
|
| 492 |
{/* Email Mailto Link */}
|
| 493 |
<a
|
| 494 |
+
href={`mailto:${supportConfig.support_email || 'arkilostudios@gmail.com'}?subject=ArkiTel%20Support%20Request%20-%20${encodeURIComponent(user?.username || '')}`}
|
| 495 |
className="flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.03] border border-white/5 hover:border-indigo-500/30 hover:bg-white/[0.05] transition-all group cursor-pointer"
|
| 496 |
>
|
| 497 |
<div className="flex items-center gap-3">
|
|
|
|
| 500 |
</div>
|
| 501 |
<div>
|
| 502 |
<div className="text-xs font-bold text-white group-hover:text-indigo-400 transition-colors">Email Support</div>
|
| 503 |
+
<div className="text-[10px] text-foreground/40 font-mono">{supportConfig.support_email || 'arkilostudios@gmail.com'}</div>
|
| 504 |
</div>
|
| 505 |
</div>
|
| 506 |
<ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" />
|
|
|
|
| 508 |
|
| 509 |
{/* WhatsApp Direct Link */}
|
| 510 |
<a
|
| 511 |
+
href={supportConfig.whatsapp_number.startsWith('http') ? supportConfig.whatsapp_number : 'https://wa.link/p0uv2l'}
|
| 512 |
target="_blank"
|
| 513 |
rel="noopener noreferrer"
|
| 514 |
className="flex items-center justify-between p-3.5 rounded-2xl bg-[#25D366]/5 border border-[#25D366]/20 hover:bg-[#25D366]/10 transition-all group cursor-pointer"
|
|
|
|
| 519 |
</div>
|
| 520 |
<div>
|
| 521 |
<div className="text-xs font-bold text-white group-hover:text-[#25D366] transition-colors">WhatsApp Live DM</div>
|
| 522 |
+
<div className="text-[10px] text-foreground/40 font-mono">Chat on WhatsApp Desk</div>
|
| 523 |
</div>
|
| 524 |
</div>
|
| 525 |
<ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" />
|