profile page compleated
This commit is contained in:
@@ -65,16 +65,10 @@ export const Sidebar: React.FC<SidebarProps> = ({
|
|||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
{/* Brand */}
|
{/* Brand */}
|
||||||
<div className="flex items-center justify-between px-5 py-4 border-b border-slate-100">
|
<div className="lg:hidden flex items-center justify-end px-5 py-4 border-b border-slate-100">
|
||||||
<div className="flex items-center gap-2.5">
|
|
||||||
<div className="w-7 h-7 rounded-lg bg-blue-500 flex items-center justify-center">
|
|
||||||
<span className="text-white text-xs font-bold">P</span>
|
|
||||||
</div>
|
|
||||||
<span className="font-semibold text-slate-800 text-sm">Plagat</span>
|
|
||||||
</div>
|
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
className="lg:hidden p-1.5 rounded-lg text-slate-400 hover:text-slate-600 hover:bg-slate-100 transition-colors"
|
className=" p-1.5 rounded-lg text-slate-400 hover:text-slate-600 hover:bg-slate-100 transition-colors"
|
||||||
aria-label="Yopish"
|
aria-label="Yopish"
|
||||||
>
|
>
|
||||||
<X size={15} />
|
<X size={15} />
|
||||||
|
|||||||
@@ -2,19 +2,14 @@ import React from 'react';
|
|||||||
import { CtaCards } from './CtaCards';
|
import { CtaCards } from './CtaCards';
|
||||||
import { StatsCards } from './StatsCards';
|
import { StatsCards } from './StatsCards';
|
||||||
import { ModulesSection } from './ModulesSection';
|
import { ModulesSection } from './ModulesSection';
|
||||||
import type { CabinetSection, CabinetStats } from '../../lib/types';
|
import type { CabinetStats } from '../../lib/types';
|
||||||
|
|
||||||
interface DashboardProps {
|
interface DashboardProps {
|
||||||
stats: CabinetStats;
|
stats: CabinetStats;
|
||||||
onNavigate: (section: CabinetSection) => void;
|
|
||||||
userName: string;
|
userName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Dashboard: React.FC<DashboardProps> = ({
|
export const Dashboard: React.FC<DashboardProps> = ({ stats, userName }) => (
|
||||||
stats,
|
|
||||||
onNavigate,
|
|
||||||
userName,
|
|
||||||
}) => (
|
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-xl font-bold text-slate-900">
|
<h2 className="text-xl font-bold text-slate-900">
|
||||||
@@ -31,7 +26,7 @@ export const Dashboard: React.FC<DashboardProps> = ({
|
|||||||
<h3 className="text-xs font-semibold text-slate-400 uppercase tracking-widest mb-3">
|
<h3 className="text-xs font-semibold text-slate-400 uppercase tracking-widest mb-3">
|
||||||
Tezkor harakatlar
|
Tezkor harakatlar
|
||||||
</h3>
|
</h3>
|
||||||
<CtaCards onNavigate={onNavigate} />
|
<CtaCards />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border-t border-slate-100 pt-6">
|
<div className="border-t border-slate-100 pt-6">
|
||||||
|
|||||||
@@ -48,22 +48,10 @@ const ProfileSection = dynamic(
|
|||||||
|
|
||||||
// ─── Section switcher ──────────────────────────────────────────────────────────
|
// ─── Section switcher ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
function SectionContent({
|
function SectionContent({ section }: { section: CabinetSection }) {
|
||||||
section,
|
|
||||||
onNavigate,
|
|
||||||
}: {
|
|
||||||
section: CabinetSection;
|
|
||||||
onNavigate: (s: CabinetSection) => void;
|
|
||||||
}) {
|
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case 'dashboard':
|
case 'dashboard':
|
||||||
return (
|
return <Dashboard stats={MOCK_STATS} userName={MOCK_USER.name} />;
|
||||||
<Dashboard
|
|
||||||
stats={MOCK_STATS}
|
|
||||||
onNavigate={onNavigate}
|
|
||||||
userName={MOCK_USER.name}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'plagiat':
|
case 'plagiat':
|
||||||
return <PlagiatTable data={MOCK_PLAGIAT} />;
|
return <PlagiatTable data={MOCK_PLAGIAT} />;
|
||||||
case 'si':
|
case 'si':
|
||||||
@@ -107,7 +95,7 @@ export const CabinetLayout: React.FC = () => {
|
|||||||
<main className="flex-1 p-4 md:p-6 lg:p-8 max-w-6xl mx-auto w-full">
|
<main className="flex-1 p-4 md:p-6 lg:p-8 max-w-6xl mx-auto w-full">
|
||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
<motion.div key={activeSection} {...FADE}>
|
<motion.div key={activeSection} {...FADE}>
|
||||||
<SectionContent section={activeSection} onNavigate={navigate} />
|
<SectionContent section={activeSection} />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Reference in New Issue
Block a user