Skip to content

Commit c74ce7e

Browse files
committed
fix: Improve pricing page UI and expand payment gateway area
1 parent e65eabc commit c74ce7e

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

frontend/views/pricing_view.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def render_pricing_page():
7575
with col1:
7676
st.markdown("""
7777
<div style="background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 16px; padding: 2rem; height: 100%; text-align: center;">
78-
<h3 style="margin-top: 0;">Clinic Basic</h3>
79-
<div style="font-size: 2.5rem; font-weight: 700; margin: 1rem 0;">Free</div>
78+
<h3 style="margin-top: 0; color: #F8FAFC; font-weight: 600;">Clinic Basic</h3>
79+
<div style="font-size: 2.5rem; font-weight: 700; margin: 1rem 0; color: #E2E8F0;">Free</div>
8080
<p style="color: #94A3B8; font-size: 0.9rem;">For independent practitioners</p>
81-
<div style="margin: 2rem 0; text-align: left; font-size: 0.9rem;">
81+
<div style="margin: 2rem 0; text-align: left; font-size: 0.9rem; color: #CBD5E1;">
8282
<div style="margin-bottom: 0.5rem;">✅ Single Doctor Account</div>
8383
<div style="margin-bottom: 0.5rem;">✅ 100 Patient Records</div>
8484
<div style="margin-bottom: 0.5rem;">✅ Basic Disease Screening</div>
@@ -91,16 +91,15 @@ def render_pricing_page():
9191
# --- DIAGNOSTIC CENTER TIER (Pro) ---
9292
with col2:
9393
# Split card into Top (Content) and Bottom (Button Container) to embed Streamlit widget
94-
# NOTE: WE MUST NOT INDENT HTML CONTENT INSIDE st.markdown TO AVOID CODE BLOCKS
9594
st.markdown("""
9695
<div style="background: linear-gradient(180deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05)); border: 2px solid #3B82F6; border-bottom: none; border-radius: 16px 16px 0 0; padding: 2rem; text-align: center; position: relative;">
9796
<div style="position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #3B82F6; color: white; padding: 2px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: 600;">RECOMMENDED</div>
98-
<h3 style="margin-top: 0; color: #60A5FA;">Diagnostic Center</h3>
99-
<div style="font-size: 2.5rem; font-weight: 700; margin: 1rem 0;">
97+
<h3 style="margin-top: 0; color: #60A5FA; font-weight: 600;">Diagnostic Center</h3>
98+
<div style="font-size: 2.5rem; font-weight: 700; margin: 1rem 0; color: #E2E8F0;">
10099
₹2,499<span style="font-size: 1rem; color: #94A3B8; font-weight: 400;">/mo</span>
101100
</div>
102101
<p style="color: #94A3B8; font-size: 0.9rem;">For mid-sized labs & clinics</p>
103-
<div style="margin: 2rem 0; text-align: left; font-size: 0.9rem;">
102+
<div style="margin: 2rem 0; text-align: left; font-size: 0.9rem; color: #CBD5E1;">
104103
<div style="margin-bottom: 0.5rem;">✅ <b>Unlimited</b> Patient Records</div>
105104
<div style="margin-bottom: 0.5rem;">✅ <b>Multi-User</b> Admin Access</div>
106105
<div style="margin-bottom: 0.5rem;">✅ White-label Lab Reports</div>
@@ -115,7 +114,8 @@ def render_pricing_page():
115114
<div style="background: linear-gradient(180deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.02)); border: 2px solid #3B82F6; border-top: none; border-radius: 0 0 16px 16px; padding: 0 2rem 2rem 2rem; text-align: center;">
116115
""", unsafe_allow_html=True)
117116

118-
if st.button("Upgrade Facility", key="upgrade_pro", type="primary", width="stretch"):
117+
# Use simple True/False for width to avoid deprecation confusion, or useContainerWidth if supported
118+
if st.button("Upgrade Facility", key="upgrade_pro", type="primary", use_container_width=True):
119119
with st.spinner("Initializing Clinical License..."):
120120
# Create Order (2499 INR = 249900 paise)
121121
resp = api.create_payment_order(249900, "diagnostic_tier")
@@ -146,14 +146,24 @@ def render_pricing_page():
146146
}},
147147
"theme": {{
148148
"color": "#3B82F6"
149+
}},
150+
"modal": {{
151+
"ondismiss": function() {{
152+
console.log('Checkout form closed');
153+
}}
149154
}}
150155
}};
151156
var rzp1 = new Razorpay(options);
152157
rzp1.open();
158+
// Try to auto-focus if possible, though sandboxed
153159
</script>
154-
<span style="color: #64748B; font-size: 0.8rem;">Opening Secure Payment Gateway...</span>
160+
<div style="color: #64748B; font-size: 0.9rem; padding: 20px; text-align: center;">
161+
<p>Secure Payment Gateway Initialized.</p>
162+
<p>If the popup didn't appear, ensure popups are allowed.</p>
163+
</div>
155164
"""
156-
components.html(html_code, height=100)
165+
# Increased HEIGHT to allow the embedded form to show if it doesn't pop out
166+
components.html(html_code, height=600, scrolling=True)
157167
else:
158168
st.error("Could not initiate payment. Please try again.")
159169

@@ -163,8 +173,8 @@ def render_pricing_page():
163173
with col3:
164174
st.markdown("""
165175
<div style="background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 16px; padding: 2rem; height: 100%; text-align: center;">
166-
<h3 style="margin-top: 0;">Hospital Network</h3>
167-
<div style="font-size: 2.5rem; font-weight: 700; margin: 1rem 0;">Custom</div>
176+
<h3 style="margin-top: 0; color: #F8FAFC; font-weight: 600;">Hospital Network</h3>
177+
<div style="font-size: 2.5rem; font-weight: 700; margin: 1rem 0; color: #E2E8F0;">Custom</div>
168178
<p style="color: #94A3B8; font-size: 0.9rem;">For large healthcare chains</p>
169179
<div style="margin: 2rem 0; text-align: left; font-size: 0.9rem;">
170180
<div style="margin-bottom: 0.5rem;">✅ Full HL7 / FHIR Integration</div>

0 commit comments

Comments
 (0)