diff --git a/src/App.tsx b/src/App.tsx index 948d9fe..4e5b958 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import { ThemeProvider } from "./components/ThemeProvider" import { LanguageProvider } from "./components/LanguageProvider" import { Toaster } from "./components/ui/toaster" import { Navbar } from "./components/Navbar" +import { Sidebar } from './components/Sidebar'; import { WorkspaceProvider } from "./context/WorkspaceContext" import Auth from "./pages/Auth" import Profile from "./pages/Profile" @@ -15,14 +16,19 @@ import Clients from "./pages/Clients" const MainLayout = () => { return ( -
- -
- -
+
+ + +
+ + +
+ +
+
- ) -} + ); +}; const RootRedirect = () => { const isAuthenticated = !!localStorage.getItem("accessToken") diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 39efda8..1f3cda8 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -111,7 +111,7 @@ export function Navbar() { > - Qlockify + {t.title || "Qlockify"}
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx new file mode 100644 index 0000000..f8da475 --- /dev/null +++ b/src/components/Sidebar.tsx @@ -0,0 +1,87 @@ +import { useState } from 'react'; +import { NavLink } from 'react-router-dom'; +import { + Users, + LayoutDashboard, + PanelLeftClose, + PanelLeftOpen, + PanelRightClose, + PanelRightOpen +} from 'lucide-react'; +import { useTranslation } from '../hooks/useTranslation'; + +export const Sidebar = () => { + const [isCollapsed, setIsCollapsed] = useState(false); + + const { t, lang } = useTranslation(); + const isRtl = lang === 'fa'; + + const ToggleIcon = isRtl + ? (isCollapsed ? PanelRightOpen : PanelRightClose) + : (isCollapsed ? PanelLeftOpen : PanelLeftClose); + + const navItems = [ + { + path: '/workspaces', + icon: LayoutDashboard, + label: t.sidebar?.workspaces || 'Workspaces' + }, + { + path: '/clients', + icon: Users, + label: t.sidebar?.clients || 'Clients' + }, + ]; + + return ( + + ); +}; diff --git a/src/locales/en.ts b/src/locales/en.ts index f5b549a..d0a3ff3 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1,6 +1,15 @@ export const en = { + title: "Qlockify", + logout: "Logout", + logoutToast: "Successfully logged out!", + confirmLogoutTitle: "Confirm Logout", + confirmLogoutMessage: "Are you sure you want to log out of your account?", + cancel: "Cancel", + lightMode: "Light Mode", + darkMode: "Dark Mode", + login: { - welcome: "Welcome to Qlockify", + welcome: (title: string = "Qlockifiy") => `Welcome to ${title}`, enterPassword: "Enter your password", verifyNumber: "Verify your number", enterMobileDesc: "Enter your mobile number to continue", @@ -29,11 +38,13 @@ export const en = { invalidOtp: "Invalid OTP code" } }, - loginTerms: { + + loginTerms: { prefix: "By logging in, you agree to our ", link: "Terms of Service and Privacy Policy", suffix: "" }, + terms: { back: "Back", title: "Terms of Service and Privacy Policy", @@ -71,6 +82,7 @@ export const en = { }, }, }, + profile: { title: "User Profile", firstName: "First Name", @@ -95,13 +107,6 @@ export const en = { error: "Something went wrong!" } }, - logout: "Logout", - logoutToast: "Successfully logged out!", - confirmLogoutTitle: "Confirm Logout", - confirmLogoutMessage: "Are you sure you want to log out of your account?", - cancel: "Cancel", - lightMode: "Light Mode", - darkMode: "Dark Mode", workspace: { title: "Workspace Management", @@ -222,4 +227,11 @@ export const en = { page: "Page", next: "Next", }, + + sidebar: { + workspaces: 'Workspaces', + clients: 'Clients', + expand: 'Expand', + collapse: 'Collapse', + }, } diff --git a/src/locales/fa.ts b/src/locales/fa.ts index e1734c2..8d30234 100644 --- a/src/locales/fa.ts +++ b/src/locales/fa.ts @@ -1,6 +1,15 @@ export const fa = { + title: "Qlockify", + logout: "خروج", + logoutToast: "با موفقیت خارج شدید!", + confirmLogoutTitle: "تایید خروج", + confirmLogoutMessage: "آیا مطمئن هستید که می‌خواهید از حساب خود خارج شوید؟", + cancel: "لغو", + lightMode: "حالت روشن", + darkMode: "حالت تاریک", + login: { - welcome: "به Qlockify خوش آمدید", + welcome: (title: string = "Qlockifiy") => `به ${title} خوش آمدید`, enterPassword: "رمز عبور خود را وارد کنید", verifyNumber: "تایید شماره موبایل", enterMobileDesc: "برای ادامه، شماره موبایل خود را وارد کنید", @@ -29,11 +38,13 @@ export const fa = { invalidOtp: "کد تایید نامعتبر است" } }, + loginTerms: { prefix: "با ورود به سیستم، شما با ", link: "شرایط خدمات و حریم خصوصی", suffix: " ما موافقت می‌کنید." }, + terms: { back: "بازگشت", title: "شرایط خدمات و حریم خصوصی", @@ -71,6 +82,7 @@ export const fa = { }, }, }, + profile: { title: "پروفایل کاربر", firstName: "نام", @@ -96,13 +108,6 @@ export const fa = { error: "خطایی رخ داد!" } }, - logout: "خروج", - logoutToast: "با موفقیت خارج شدید!", - confirmLogoutTitle: "تایید خروج", - confirmLogoutMessage: "آیا مطمئن هستید که می‌خواهید از حساب خود خارج شوید؟", - cancel: "لغو", - lightMode: "حالت روشن", - darkMode: "حالت تاریک", workspace: { title: "مدیریت ورک‌اسپیس‌ها", @@ -156,7 +161,7 @@ export const fa = { orderByUpdatedDesc: "آخرین ویرایش", orderByCreatedDesc: "جدیدترین", orderByCreatedAsc: "قدیمی‌ترین", - orderByName: "نام (الف تا ی)", + orderByName: "نام (الفبایی)", deleteSuccess: "فضای کاری با موفقیت حذف شد", deleteTitle: "حذف فضای کاری", deleteWarning: "برای تأیید حذف، لطفاً نام فضای کاری را وارد کنید:", @@ -223,4 +228,11 @@ export const fa = { page: "صفحه", next: "بعدی", }, + + sidebar: { + workspaces: 'ورک‌اسپیس‌ها', + clients: 'مشتریان', + expand: 'باز کردن', + collapse: 'جمع کردن', + }, } diff --git a/src/pages/Auth.tsx b/src/pages/Auth.tsx index b8abc6d..333c6a3 100644 --- a/src/pages/Auth.tsx +++ b/src/pages/Auth.tsx @@ -89,7 +89,7 @@ export default function Auth() {
- Qlockify + {t.title || "Qlockify"}
@@ -106,7 +106,7 @@ export default function Auth() {

- {step === "mobile" && t.login.welcome} + {step === "mobile" && t.login.welcome(t.title)} {step === "password" && t.login.enterPassword} {step === "otp" && t.login.verifyNumber}