From 962564304295d6c28ea5bfdc9ebcb9f37746a5af Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 5 Nov 2026 11:44:28 +0530 Subject: [PATCH 1/4] fix(store): display storefront and subscriptions navigation tabs on mobile --- src/App.tsx | 4 + src/components/auth/ProfileDrawer.tsx | 19 ++- src/components/layout/StoreHeader.tsx | 179 +++++++++++++++----------- 3 files changed, 125 insertions(+), 77 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6007e6a..523d108 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1190,6 +1190,10 @@ export default function App() { setShowProfileDrawer(false); switchTab('storefront'); }} + onViewSubscriptions={() => { + setShowProfileDrawer(false); + switchTab('subscriptions'); + }} curriculumModules={curriculumModules} onDownloadInvoice={handleDownloadCheckoutInvoice} /> diff --git a/src/components/auth/ProfileDrawer.tsx b/src/components/auth/ProfileDrawer.tsx index 3937cfb..f852025 100644 --- a/src/components/auth/ProfileDrawer.tsx +++ b/src/components/auth/ProfileDrawer.tsx @@ -36,6 +36,7 @@ interface ProfileDrawerProps { onChangePassword: (e: React.FormEvent) => Promise; onLogout: () => void; onBrowseStorefront: () => void; + onViewSubscriptions?: () => void; curriculumModules: ModuleItem[]; onDownloadInvoice?: (paymentId: string, directUrl?: string) => void; } @@ -69,6 +70,7 @@ export const ProfileDrawer: React.FC = ({ onChangePassword, onLogout, onBrowseStorefront, + onViewSubscriptions, curriculumModules, onDownloadInvoice, }) => { @@ -314,9 +316,20 @@ export const ProfileDrawer: React.FC = ({ {/* Subscriptions Nested Details */}
-

- Ongoing subscriptions -

+
+

+ Ongoing subscriptions +

+ {onViewSubscriptions && ( + + )} +
{!loggedInUser.active_subscriptions || loggedInUser.active_subscriptions.length === 0 ? (
diff --git a/src/components/layout/StoreHeader.tsx b/src/components/layout/StoreHeader.tsx index 94a0026..d5c2547 100644 --- a/src/components/layout/StoreHeader.tsx +++ b/src/components/layout/StoreHeader.tsx @@ -18,85 +18,116 @@ export const StoreHeader: React.FC = ({ onOpenAuth, }) => { return ( -
-
-
onSwitchTab('storefront')} - className="flex items-center gap-3 cursor-pointer group" - > -
- -
-
-

- ACUPEDIA -

-

TCM PLATFORM

+
+
+
+
onSwitchTab('storefront')} + className="flex items-center gap-3 cursor-pointer group" + > +
+ +
+
+

+ ACUPEDIA +

+

TCM PLATFORM

+
+ + {/* Desktop Navigation Tabs */} +
- {/* Navigation Tabs */} - +
+ {loggedInUser ? ( + + ) : ( +
+ + +
+ )} +
-
- {loggedInUser ? ( - - ) : ( -
- - -
- )} -
+ {/* Mobile Navigation Tabs */} +
); }; From 9dffbbfa9b5320606825ffb448c0a6759aca71f6 Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 5 Nov 2026 14:44:04 +0530 Subject: [PATCH 2/4] fix(catalog): update locked pass toggle link hover color to dark brown --- src/components/catalog/CatalogSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/catalog/CatalogSection.tsx b/src/components/catalog/CatalogSection.tsx index 377122c..100f62b 100644 --- a/src/components/catalog/CatalogSection.tsx +++ b/src/components/catalog/CatalogSection.tsx @@ -549,7 +549,7 @@ export const CatalogSection: React.FC = ({ From 2445fefcfea8d1216cea4ffd0e752c1f177c15bc Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 5 Nov 2026 15:14:54 +0530 Subject: [PATCH 3/4] fix(auth): enforce RFC-compliant email validation across login, registration and password recovery --- src/App.tsx | 26 +++++++------------------- src/utils/validation.ts | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 6007e6a..8666dc0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,7 +6,7 @@ import { getCountryRuleByName } from './constants/countries'; import type { ModuleItem, Currency, UserProfile, VerificationResult, PublicPlan } from './types'; import { API_BASE } from './services/api'; import { loadRazorpayScript } from './services/razorpay'; -import { cleanPhoneInput, validatePhoneNumber, validatePassword } from './utils/validation'; +import { cleanPhoneInput, validatePhoneNumber, validatePassword, validateEmail } from './utils/validation'; // Modular Subcomponents import { StoreHeader } from './components/layout/StoreHeader'; @@ -408,15 +408,9 @@ export default function App() { const trimmedEmail = authEmail.trim(); - if (!trimmedEmail) { - setAuthError('Email address is required.'); - setAuthLoading(false); - return; - } - - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; - if (!emailRegex.test(trimmedEmail)) { - setAuthError('Please enter a valid email address.'); + const emailErr = validateEmail(trimmedEmail); + if (emailErr) { + setAuthError(emailErr); setAuthLoading(false); return; } @@ -552,15 +546,9 @@ export default function App() { setResetSuccessMessage(null); const trimmedEmail = authEmail.trim(); - if (!trimmedEmail) { - setAuthError('Email address is required.'); - setAuthLoading(false); - return; - } - - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; - if (!emailRegex.test(trimmedEmail)) { - setAuthError('Please enter a valid email address.'); + const emailErr = validateEmail(trimmedEmail); + if (emailErr) { + setAuthError(emailErr); setAuthLoading(false); return; } diff --git a/src/utils/validation.ts b/src/utils/validation.ts index bcfa008..9f9bb44 100644 --- a/src/utils/validation.ts +++ b/src/utils/validation.ts @@ -179,3 +179,24 @@ export const validatePassword = (password: string, fieldName = 'Password'): stri return null; }; +/** + * RFC 5322 & RFC 1035 compliant email validation regex. + * Disallows invalid domain characters (e.g. + in domain like +gmail+.com, consecutive dots, leading/trailing hyphens) + * while properly accepting plus-addressing in local-part (e.g. sanskar+sarak@gmail.com). + */ +export const EMAIL_REGEX = /^[a-zA-Z0-9_%+-]+(?:\.[a-zA-Z0-9_%+-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?)*\.[a-zA-Z]{2,}$/; + +export const validateEmail = (email?: string | null): string | null => { + if (!email || !email.trim()) { + return 'Email address is required.'; + } + if (!EMAIL_REGEX.test(email.trim())) { + return 'Please enter a valid email address.'; + } + return null; +}; + +export const isValidEmail = (email?: string | null): boolean => { + return validateEmail(email) === null; +}; + From 9f08b0a6a5e0f60be3d589a9cff2222149deadeb Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 5 Nov 2026 15:29:53 +0530 Subject: [PATCH 4/4] fix(auth): clear mobile number field automatically when country changes during registration --- src/components/auth/AuthModal.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/auth/AuthModal.tsx b/src/components/auth/AuthModal.tsx index ec92ce0..1d71255 100644 --- a/src/components/auth/AuthModal.tsx +++ b/src/components/auth/AuthModal.tsx @@ -294,11 +294,13 @@ export const AuthModal: React.FC = ({ value={authDialCode} onChange={(e) => { const newCode = e.target.value; - setAuthDialCode(newCode); - const rule = getCountryRuleByDialCode(newCode); - if (rule && rule.country !== 'Other') { - setAuthCountry(rule.country); - setAuthPhone(cleanPhoneInput(authPhone, rule.maxLength, false)); + if (newCode !== authDialCode) { + setAuthDialCode(newCode); + const rule = getCountryRuleByDialCode(newCode); + if (rule && rule.country !== 'Other') { + setAuthCountry(rule.country); + } + setAuthPhone(''); } }} className="w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2.5 text-xs sm:text-sm font-semibold text-white focus:outline-none focus:border-indigo-500 appearance-none pr-6" @@ -341,11 +343,13 @@ export const AuthModal: React.FC = ({ value={authCountry} onChange={(e) => { const newCountry = e.target.value; - setAuthCountry(newCountry); - const rule = getCountryRuleByName(newCountry); - if (rule) { - setAuthDialCode(rule.code); - setAuthPhone(cleanPhoneInput(authPhone, rule.maxLength, false)); + if (newCountry !== authCountry) { + setAuthCountry(newCountry); + const rule = getCountryRuleByName(newCountry); + if (rule) { + setAuthDialCode(rule.code); + } + setAuthPhone(''); } }} className="w-full bg-slate-950 border border-slate-800 rounded-xl px-4 py-2.5 text-sm font-semibold text-white focus:outline-none focus:border-indigo-500 appearance-none"