profile page compleated

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-04-06 18:04:56 +05:00
parent db0fad7e00
commit d17b30d6ea
3 changed files with 8 additions and 31 deletions

View File

@@ -65,16 +65,10 @@ export const Sidebar: React.FC<SidebarProps> = ({
`}
>
{/* Brand */}
<div className="flex items-center justify-between 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>
<div className="lg:hidden flex items-center justify-end px-5 py-4 border-b border-slate-100">
<button
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"
>
<X size={15} />

View File

@@ -2,19 +2,14 @@ import React from 'react';
import { CtaCards } from './CtaCards';
import { StatsCards } from './StatsCards';
import { ModulesSection } from './ModulesSection';
import type { CabinetSection, CabinetStats } from '../../lib/types';
import type { CabinetStats } from '../../lib/types';
interface DashboardProps {
stats: CabinetStats;
onNavigate: (section: CabinetSection) => void;
userName: string;
}
export const Dashboard: React.FC<DashboardProps> = ({
stats,
onNavigate,
userName,
}) => (
export const Dashboard: React.FC<DashboardProps> = ({ stats, userName }) => (
<div className="space-y-6">
<div>
<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">
Tezkor harakatlar
</h3>
<CtaCards onNavigate={onNavigate} />
<CtaCards />
</div>
<div className="border-t border-slate-100 pt-6">

View File

@@ -48,22 +48,10 @@ const ProfileSection = dynamic(
// ─── Section switcher ──────────────────────────────────────────────────────────
function SectionContent({
section,
onNavigate,
}: {
section: CabinetSection;
onNavigate: (s: CabinetSection) => void;
}) {
function SectionContent({ section }: { section: CabinetSection }) {
switch (section) {
case 'dashboard':
return (
<Dashboard
stats={MOCK_STATS}
onNavigate={onNavigate}
userName={MOCK_USER.name}
/>
);
return <Dashboard stats={MOCK_STATS} userName={MOCK_USER.name} />;
case 'plagiat':
return <PlagiatTable data={MOCK_PLAGIAT} />;
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">
<AnimatePresence mode="wait">
<motion.div key={activeSection} {...FADE}>
<SectionContent section={activeSection} onNavigate={navigate} />
<SectionContent section={activeSection} />
</motion.div>
</AnimatePresence>
</main>