mobile
This commit is contained in:
parent
329a71931b
commit
fa9080cdfb
@ -121,7 +121,8 @@ export default function AffiliateManagementPage() {
|
|||||||
<PageTransitionEffect>
|
<PageTransitionEffect>
|
||||||
<div className="min-h-screen flex flex-col bg-gradient-to-tr from-blue-50 via-white to-blue-100">
|
<div className="min-h-screen flex flex-col bg-gradient-to-tr from-blue-50 via-white to-blue-100">
|
||||||
<Header />
|
<Header />
|
||||||
<main className="flex-1 py-8 px-4 sm:px-6 lg:px-8">
|
{/* tighter padding on mobile */}
|
||||||
|
<main className="flex-1 py-6 md:py-8 px-4 sm:px-6 lg:px-8">
|
||||||
<div className="max-w-7xl mx-auto">
|
<div className="max-w-7xl mx-auto">
|
||||||
{/* Error State */}
|
{/* Error State */}
|
||||||
{error && (
|
{error && (
|
||||||
@ -139,15 +140,19 @@ export default function AffiliateManagementPage() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<header className="bg-white/90 backdrop-blur border-b border-blue-100 py-10 px-8 rounded-2xl shadow-lg mb-8">
|
<header className="bg-white/90 backdrop-blur border-b border-blue-100 py-6 md:py-10 px-4 md:px-8 rounded-2xl shadow-lg mb-6 md:mb-8">
|
||||||
<div className="flex items-center justify-between mb-6">
|
<div className="flex flex-col md:flex-row md:items-center md:justify-between gap-4 md:gap-6 mb-4 md:mb-6">
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<h1 className="text-4xl font-extrabold text-blue-900 tracking-tight">Affiliate Management</h1>
|
<h1 className="text-2xl md:text-4xl font-extrabold text-blue-900 tracking-tight">
|
||||||
<p className="text-lg text-blue-700 mt-2">Manage your affiliate partners and tracking links</p>
|
Affiliate Management
|
||||||
|
</h1>
|
||||||
|
<p className="text-sm md:text-lg text-blue-700 mt-1 md:mt-2">
|
||||||
|
Manage your affiliate partners and tracking links
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowCreateModal(true)}
|
onClick={() => setShowCreateModal(true)}
|
||||||
className="inline-flex items-center gap-2 rounded-lg bg-blue-900 hover:bg-blue-800 text-blue-50 px-5 py-3 text-sm font-semibold shadow transition"
|
className="w-full md:w-auto inline-flex items-center justify-center gap-2 rounded-lg bg-blue-900 hover:bg-blue-800 text-blue-50 px-5 py-3 text-sm font-semibold shadow transition"
|
||||||
>
|
>
|
||||||
<PlusIcon className="h-5 w-5" />
|
<PlusIcon className="h-5 w-5" />
|
||||||
Add Affiliate
|
Add Affiliate
|
||||||
@ -155,7 +160,7 @@ export default function AffiliateManagementPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Search and Filter */}
|
{/* Search and Filter */}
|
||||||
<div className="flex flex-col sm:flex-row gap-4">
|
<div className="flex flex-col sm:flex-row gap-3 md:gap-4">
|
||||||
<div className="flex-1 relative">
|
<div className="flex-1 relative">
|
||||||
<MagnifyingGlassIcon className="absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400" />
|
<MagnifyingGlassIcon className="absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400" />
|
||||||
<input
|
<input
|
||||||
@ -169,7 +174,7 @@ export default function AffiliateManagementPage() {
|
|||||||
<select
|
<select
|
||||||
value={categoryFilter}
|
value={categoryFilter}
|
||||||
onChange={e => setCategoryFilter(e.target.value)}
|
onChange={e => setCategoryFilter(e.target.value)}
|
||||||
className="px-4 py-2.5 rounded-lg border border-gray-300 bg-white text-gray-900 focus:ring-2 focus:ring-blue-900 focus:border-transparent"
|
className="w-full sm:w-auto px-4 py-2.5 rounded-lg border border-gray-300 bg-white text-gray-900 focus:ring-2 focus:ring-blue-900 focus:border-transparent"
|
||||||
>
|
>
|
||||||
{categories.map(cat => (
|
{categories.map(cat => (
|
||||||
<option key={cat} value={cat}>
|
<option key={cat} value={cat}>
|
||||||
@ -181,7 +186,7 @@ export default function AffiliateManagementPage() {
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Stats */}
|
{/* Stats */}
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-3 gap-6 mb-8">
|
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4 md:gap-6 mb-6 md:mb-8">
|
||||||
<div className="bg-white rounded-2xl border border-gray-100 shadow-lg p-6">
|
<div className="bg-white rounded-2xl border border-gray-100 shadow-lg p-6">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="rounded-lg bg-blue-50 p-3">
|
<div className="rounded-lg bg-blue-50 p-3">
|
||||||
@ -222,7 +227,7 @@ export default function AffiliateManagementPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Affiliates Grid */}
|
{/* Affiliates Grid */}
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6">
|
||||||
{loading && (
|
{loading && (
|
||||||
<div className="col-span-full text-center py-12">
|
<div className="col-span-full text-center py-12">
|
||||||
<div className="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-blue-600 border-r-transparent"></div>
|
<div className="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-blue-600 border-r-transparent"></div>
|
||||||
@ -544,15 +549,15 @@ function CreateAffiliateModal({ onClose, onCreate }: { onClose: () => void; onCr
|
|||||||
onCropComplete={handleCropComplete}
|
onCropComplete={handleCropComplete}
|
||||||
/>
|
/>
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
||||||
<div className="relative w-full max-w-2xl mx-4 bg-white rounded-2xl shadow-2xl max-h-[90vh] overflow-y-auto">
|
<div className="relative w-full max-w-2xl mx-0 sm:mx-4 bg-white rounded-none sm:rounded-2xl shadow-2xl max-h-[100vh] sm:max-h-[90vh] overflow-y-auto">
|
||||||
<div className="sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between rounded-t-2xl">
|
<div className="sticky top-0 bg-white border-b border-gray-200 px-4 sm:px-6 py-3 sm:py-4 flex items-center justify-between rounded-none sm:rounded-t-2xl">
|
||||||
<h2 className="text-2xl font-bold text-blue-900">Add New Affiliate</h2>
|
<h2 className="text-xl sm:text-2xl font-bold text-blue-900">Add New Affiliate</h2>
|
||||||
<button onClick={onClose} className="text-gray-500 hover:text-gray-700 transition">
|
<button onClick={onClose} className="text-gray-500 hover:text-gray-700 transition">
|
||||||
<XMarkIcon className="h-6 w-6" />
|
<XMarkIcon className="h-6 w-6" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
<form onSubmit={handleSubmit} className="p-4 sm:p-6 space-y-5 sm:space-y-6">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-blue-900 mb-2">Partner Name *</label>
|
<label className="block text-sm font-medium text-blue-900 mb-2">Partner Name *</label>
|
||||||
<input
|
<input
|
||||||
@ -808,15 +813,15 @@ function EditAffiliateModal({ affiliate, onClose, onUpdate }: {
|
|||||||
onCropComplete={handleCropComplete}
|
onCropComplete={handleCropComplete}
|
||||||
/>
|
/>
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
||||||
<div className="relative w-full max-w-2xl mx-4 bg-white rounded-2xl shadow-2xl max-h-[90vh] overflow-y-auto">
|
<div className="relative w-full max-w-2xl mx-0 sm:mx-4 bg-white rounded-none sm:rounded-2xl shadow-2xl max-h-[100vh] sm:max-h-[90vh] overflow-y-auto">
|
||||||
<div className="sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between rounded-t-2xl">
|
<div className="sticky top-0 bg-white border-b border-gray-200 px-4 sm:px-6 py-3 sm:py-4 flex items-center justify-between rounded-none sm:rounded-t-2xl">
|
||||||
<h2 className="text-2xl font-bold text-blue-900">Edit Affiliate</h2>
|
<h2 className="text-xl sm:text-2xl font-bold text-blue-900">Edit Affiliate</h2>
|
||||||
<button onClick={onClose} className="text-gray-500 hover:text-gray-700 transition">
|
<button onClick={onClose} className="text-gray-500 hover:text-gray-700 transition">
|
||||||
<XMarkIcon className="h-6 w-6" />
|
<XMarkIcon className="h-6 w-6" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
<form onSubmit={handleSubmit} className="p-4 sm:p-6 space-y-5 sm:space-y-6">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-blue-900 mb-2">Partner Name *</label>
|
<label className="block text-sm font-medium text-blue-900 mb-2">Partner Name *</label>
|
||||||
<input
|
<input
|
||||||
@ -969,7 +974,7 @@ function DeleteConfirmModal({ affiliateName, onClose, onConfirm, isDeleting }: {
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm">
|
||||||
<div className="relative w-full max-w-md mx-4 bg-white rounded-2xl shadow-2xl p-6">
|
<div className="relative w-full max-w-md mx-0 sm:mx-4 bg-white rounded-none sm:rounded-2xl shadow-2xl p-4 sm:p-6">
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-red-100">
|
<div className="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-red-100">
|
||||||
<TrashIcon className="h-6 w-6 text-red-600" />
|
<TrashIcon className="h-6 w-6 text-red-600" />
|
||||||
@ -980,7 +985,7 @@ function DeleteConfirmModal({ affiliateName, onClose, onConfirm, isDeleting }: {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex flex-col sm:flex-row items-stretch sm:items-center gap-3">
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
disabled={isDeleting}
|
disabled={isDeleting}
|
||||||
|
|||||||
@ -48,14 +48,16 @@ export default function ContractManagementPage() {
|
|||||||
return (
|
return (
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<div className="bg-gradient-to-tr from-blue-50 via-white to-blue-100 min-h-screen">
|
<div className="bg-gradient-to-tr from-blue-50 via-white to-blue-100 min-h-screen">
|
||||||
<div className="flex flex-col md:flex-row max-w-7xl mx-auto px-2 sm:px-6 lg:px-8 py-8 gap-8">
|
{/* tighter horizontal padding on mobile */}
|
||||||
{/* Sidebar Navigation */}
|
<div className="flex flex-col md:flex-row max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 md:py-8 gap-6 md:gap-8">
|
||||||
<nav className="md:w-56 w-full flex md:flex-col flex-row gap-2 md:gap-4">
|
{/* Sidebar Navigation (mobile = horizontal scroll tabs, desktop = vertical) */}
|
||||||
|
<nav className="md:w-56 w-full md:self-start md:sticky md:top-6">
|
||||||
|
<div className="flex md:flex-col flex-row gap-2 md:gap-3 overflow-x-auto md:overflow-visible -mx-4 px-4 md:mx-0 md:px-0 pb-2 md:pb-0">
|
||||||
{NAV.map((item) => (
|
{NAV.map((item) => (
|
||||||
<button
|
<button
|
||||||
key={item.key}
|
key={item.key}
|
||||||
onClick={() => setSection(item.key)}
|
onClick={() => setSection(item.key)}
|
||||||
className={`flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition
|
className={`flex flex-shrink-0 items-center gap-2 px-4 py-2 rounded-lg font-medium transition whitespace-nowrap text-sm md:text-base
|
||||||
${section === item.key
|
${section === item.key
|
||||||
? 'bg-blue-900 text-blue-50 shadow'
|
? 'bg-blue-900 text-blue-50 shadow'
|
||||||
: 'bg-white text-blue-900 hover:bg-blue-50 hover:text-blue-900 border border-blue-200'}`}
|
: 'bg-white text-blue-900 hover:bg-blue-50 hover:text-blue-900 border border-blue-200'}`}
|
||||||
@ -64,20 +66,22 @@ export default function ContractManagementPage() {
|
|||||||
<span>{item.label}</span>
|
<span>{item.label}</span>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{/* Main Content */}
|
{/* Main Content */}
|
||||||
<main className="flex-1 space-y-8">
|
<main className="flex-1 space-y-6 md:space-y-8">
|
||||||
<header className="sticky top-0 z-10 bg-white/90 backdrop-blur border-b border-blue-100 py-10 px-8 rounded-2xl shadow-lg flex flex-col gap-4 mb-4">
|
{/* sticky only on md+; smaller padding/title on mobile */}
|
||||||
<h1 className="text-4xl font-extrabold text-blue-900 tracking-tight">Contract Management</h1>
|
<header className="md:sticky md:top-0 z-10 bg-white/90 backdrop-blur border-b border-blue-100 py-5 px-4 md:py-10 md:px-8 rounded-2xl shadow-lg flex flex-col gap-3 md:gap-4 mb-2 md:mb-4">
|
||||||
<p className="text-lg text-blue-700">
|
<h1 className="text-2xl md:text-4xl font-extrabold text-blue-900 tracking-tight">Contract Management</h1>
|
||||||
|
<p className="text-sm md:text-lg text-blue-700">
|
||||||
Manage contract templates, company stamp, and create new templates.
|
Manage contract templates, company stamp, and create new templates.
|
||||||
</p>
|
</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Section Panels */}
|
{/* Section Panels (compact padding on mobile) */}
|
||||||
{section === 'stamp' && (
|
{section === 'stamp' && (
|
||||||
<section className="rounded-2xl bg-white shadow-lg border border-gray-100 p-6">
|
<section className="rounded-2xl bg-white shadow-lg border border-gray-100 p-4 md:p-6">
|
||||||
<h2 className="text-xl font-semibold text-blue-900 mb-4 flex items-center gap-2">
|
<h2 className="text-xl font-semibold text-blue-900 mb-4 flex items-center gap-2">
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor"><circle cx="12" cy="12" r="10"/><path d="M12 8v4l3 3"/></svg>
|
<svg className="w-6 h-6" fill="none" stroke="currentColor"><circle cx="12" cy="12" r="10"/><path d="M12 8v4l3 3"/></svg>
|
||||||
Company Stamp
|
Company Stamp
|
||||||
@ -86,7 +90,7 @@ export default function ContractManagementPage() {
|
|||||||
</section>
|
</section>
|
||||||
)}
|
)}
|
||||||
{section === 'templates' && (
|
{section === 'templates' && (
|
||||||
<section className="rounded-2xl bg-white shadow-lg border border-gray-100 p-6">
|
<section className="rounded-2xl bg-white shadow-lg border border-gray-100 p-4 md:p-6">
|
||||||
<h2 className="text-xl font-semibold text-blue-900 mb-4 flex items-center gap-2">
|
<h2 className="text-xl font-semibold text-blue-900 mb-4 flex items-center gap-2">
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor"><path d="M4 6h16M4 12h16M4 18h16"/></svg>
|
<svg className="w-6 h-6" fill="none" stroke="currentColor"><path d="M4 6h16M4 12h16M4 18h16"/></svg>
|
||||||
Templates
|
Templates
|
||||||
@ -101,7 +105,7 @@ export default function ContractManagementPage() {
|
|||||||
</section>
|
</section>
|
||||||
)}
|
)}
|
||||||
{section === 'editor' && (
|
{section === 'editor' && (
|
||||||
<section className="rounded-2xl bg-white shadow-lg border border-gray-100 p-6">
|
<section className="rounded-2xl bg-white shadow-lg border border-gray-100 p-4 md:p-6">
|
||||||
<h2 className="text-xl font-semibold text-blue-900 mb-4 flex items-center gap-2">
|
<h2 className="text-xl font-semibold text-blue-900 mb-4 flex items-center gap-2">
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 113 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
|
<svg className="w-6 h-6" fill="none" stroke="currentColor"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 113 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
|
||||||
Create Template
|
Create Template
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user