diff --git a/src/components/layout/AdminLayout.tsx b/src/components/layout/AdminLayout.tsx index 849b89a..d384890 100644 --- a/src/components/layout/AdminLayout.tsx +++ b/src/components/layout/AdminLayout.tsx @@ -4,6 +4,8 @@ import type { ReactNode } from "react"; import { useNavigate, useLocation } from "react-router-dom"; import winsooLogo from "../../assets/images/winsoo.svg"; import { getSidebarMenuItems } from "../../constants/navigation"; +import { colors } from "../../design/tokens/colors"; +import { spacing } from "../../design/tokens/spacing"; const { Header, Content, Sider } = Layout; const { Title } = Typography; @@ -46,8 +48,8 @@ const AdminLayout = ({ children }: AdminLayoutProps) => { style={{ height: 64, padding: "0 16px", - borderBottom: "1px solid #ECF2F8", - background: "#233E5F", + borderBottom: `1px solid ${colors.primaryLight}`, + background: colors.primary, display: "flex", alignItems: "center", justifyContent: "flex-start", @@ -67,8 +69,8 @@ const AdminLayout = ({ children }: AdminLayoutProps) => { style={{ borderInlineEnd: 0, paddingTop: 12, - background: "#ffffff", - color: "#000000", + background: colors.background, + color: colors.text, }} theme="light" className="sidebar-menu" @@ -84,7 +86,7 @@ const AdminLayout = ({ children }: AdminLayoutProps) => { open={mobileOpen} onClose={() => setMobileOpen(false)} width={260} - bodyStyle={{ padding: 0, background: "#ffffff" }} + bodyStyle={{ padding: 0, background: colors.background }} closeIcon={null} > {sidebarContent} @@ -98,13 +100,13 @@ const AdminLayout = ({ children }: AdminLayoutProps) => {
{isMobile ? ( @@ -118,7 +120,7 @@ const AdminLayout = ({ children }: AdminLayoutProps) => { alignItems: "center", justifyContent: "center", cursor: "pointer", - color: "#ffffff", + color: colors.background, }} onClick={() => setMobileOpen(true)} role="button" @@ -132,7 +134,7 @@ const AdminLayout = ({ children }: AdminLayoutProps) => { ☰ ) : null} - + <Title level={4} style={{ margin: 0, color: colors.background, flex: 1, textAlign: "center" }}> پنل ادمین وینسو
@@ -140,11 +142,11 @@ const AdminLayout = ({ children }: AdminLayoutProps) => {
{children} diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 9e7838a..ce324b1 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -1,6 +1,8 @@ import { Menu } from 'antd'; import { useNavigate, useLocation } from 'react-router-dom'; import { getSidebarMenuItems } from '../../constants/navigation'; +import { colors } from '../../design/tokens/colors'; +import { spacing } from '../../design/tokens/spacing'; const Sidebar = () => { const navigate = useNavigate(); @@ -12,7 +14,7 @@ const Sidebar = () => { selectedKeys={[location.pathname]} items={getSidebarMenuItems()} onClick={({ key }) => navigate(key)} - style={{ height: '100%', borderInlineEnd: 0, paddingTop: 12, background: '#ffffff', color: '#000000' }} + style={{ height: '100%', borderInlineEnd: 0, paddingTop: spacing.sm, background: colors.background, color: colors.text }} /> ); }; diff --git a/src/design/theme/antdTheme.ts b/src/design/theme/antdTheme.ts new file mode 100644 index 0000000..0cc29a9 --- /dev/null +++ b/src/design/theme/antdTheme.ts @@ -0,0 +1,14 @@ +import type { ThemeConfig } from 'antd'; +import { colors } from '../tokens/colors'; +import { typography } from '../tokens/typography'; + +export const antdTheme: ThemeConfig = { + token: { + colorPrimary: colors.primary, + colorText: colors.text, + colorTextSecondary: colors.textSecondary, + colorBgContainer: colors.background, + borderRadius: 12, + fontFamily: typography.fontFamily, + }, +}; diff --git a/src/design/tokens/colors.ts b/src/design/tokens/colors.ts new file mode 100644 index 0000000..09884cf --- /dev/null +++ b/src/design/tokens/colors.ts @@ -0,0 +1,8 @@ +export const colors = { + primary: '#233E5F', + primaryLight: '#ECF2F8', + accent: '#F0642D', + background: '#FFFFFF', + text: '#000000', + textSecondary: '#B3B3B3', +} as const; diff --git a/src/design/tokens/index.ts b/src/design/tokens/index.ts new file mode 100644 index 0000000..2b370ce --- /dev/null +++ b/src/design/tokens/index.ts @@ -0,0 +1,3 @@ +export { colors } from './colors'; +export { spacing } from './spacing'; +export { typography } from './typography'; diff --git a/src/design/tokens/spacing.ts b/src/design/tokens/spacing.ts new file mode 100644 index 0000000..a29c55a --- /dev/null +++ b/src/design/tokens/spacing.ts @@ -0,0 +1,7 @@ +export const spacing = { + xs: 4, + sm: 8, + md: 16, + lg: 24, + xl: 32, +} as const; diff --git a/src/design/tokens/typography.ts b/src/design/tokens/typography.ts new file mode 100644 index 0000000..9c906c1 --- /dev/null +++ b/src/design/tokens/typography.ts @@ -0,0 +1,7 @@ +export const typography = { + fontFamily: 'IRANSans, sans-serif', + fontSize: 14, + fontWeightRegular: 400, + fontWeightBold: 700, + lineHeight: 1.5, +} as const; diff --git a/src/main.tsx b/src/main.tsx index 2f453d3..d60713a 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -7,26 +7,13 @@ import 'antd/dist/reset.css'; import faIR from 'antd/locale/fa_IR'; import { store } from './app/store'; import { router } from './routes/router'; +import { antdTheme } from './design/theme/antdTheme'; import './index.css'; createRoot(document.getElementById('root')!).render( - + diff --git a/src/pages/Billboards/Billboards.tsx b/src/pages/Billboards/Billboards.tsx index 9c03a26..1cea852 100644 --- a/src/pages/Billboards/Billboards.tsx +++ b/src/pages/Billboards/Billboards.tsx @@ -1,4 +1,6 @@ import { Card, Typography } from 'antd'; +import { colors } from '../../design/tokens/colors'; +import { spacing } from '../../design/tokens/spacing'; const { Title, Paragraph } = Typography; @@ -6,7 +8,7 @@ const Billboards = () => { return ( بیلبوردها - + مدیریت جدول بیلبوردها به‌زودی اضافه خواهد شد. diff --git a/src/pages/Home/Home.tsx b/src/pages/Home/Home.tsx index a6efb1a..b28c644 100644 --- a/src/pages/Home/Home.tsx +++ b/src/pages/Home/Home.tsx @@ -1,4 +1,6 @@ import { Card, Typography } from 'antd'; +import { colors } from '../../design/tokens/colors'; +import { spacing } from '../../design/tokens/spacing'; const { Title, Paragraph } = Typography; @@ -6,7 +8,7 @@ const Home = () => { return ( خوش آمدید - + به پنل ادمین وینسو خوش آمدید. diff --git a/src/pages/Login/Login.tsx b/src/pages/Login/Login.tsx index 6b93419..af16cc0 100644 --- a/src/pages/Login/Login.tsx +++ b/src/pages/Login/Login.tsx @@ -1,6 +1,8 @@ import { Button, Card, Form, Input, Typography, message } from 'antd'; import { useNavigate } from 'react-router-dom'; import { authService } from '../../features/auth/authService'; +import { colors } from '../../design/tokens/colors'; +import { spacing } from '../../design/tokens/spacing'; const { Title, Paragraph } = Typography; @@ -24,12 +26,12 @@ const Login = () => { }; return ( -
- - + <div style={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', background: colors.primaryLight, direction: 'rtl' }}> + <Card style={{ width: 420, boxShadow: '0 12px 32px rgba(35, 62, 95, 0.12)', border: `1px solid ${colors.primaryLight}` }}> + <Title level={3} style={{ marginBottom: spacing.sm, color: colors.primary }}> ورود به پنل ادمین - + برای ادامه شماره موبایل خود را وارد کنید. diff --git a/src/pages/Profile/Profile.tsx b/src/pages/Profile/Profile.tsx index cae582c..1cdf44a 100644 --- a/src/pages/Profile/Profile.tsx +++ b/src/pages/Profile/Profile.tsx @@ -1,4 +1,6 @@ import { Card, Typography } from 'antd'; +import { colors } from '../../design/tokens/colors'; +import { spacing } from '../../design/tokens/spacing'; const { Title, Paragraph } = Typography; @@ -6,7 +8,7 @@ const Profile = () => { return ( پروفایل کاربر - + جدول اطلاعات کاربر به‌زودی اضافه خواهد شد. diff --git a/src/pages/VerifyOtp/VerifyOtp.tsx b/src/pages/VerifyOtp/VerifyOtp.tsx index e498c08..23aa1e5 100644 --- a/src/pages/VerifyOtp/VerifyOtp.tsx +++ b/src/pages/VerifyOtp/VerifyOtp.tsx @@ -4,6 +4,8 @@ import { useNavigate } from 'react-router-dom'; import { useAppDispatch } from '../../utils/hooks'; import { loginSuccess } from '../../features/auth/authSlice'; import { authService } from '../../features/auth/authService'; +import { colors } from '../../design/tokens/colors'; +import { spacing } from '../../design/tokens/spacing'; const { Title, Paragraph } = Typography; @@ -37,12 +39,12 @@ const VerifyOtp = () => { }; return ( -
- - + <div style={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', background: colors.primaryLight, direction: 'rtl' }}> + <Card style={{ width: 420, boxShadow: '0 12px 32px rgba(35, 62, 95, 0.12)', border: `1px solid ${colors.primaryLight}` }}> + <Title level={3} style={{ marginBottom: spacing.sm, color: colors.primary }}> تایید کد یکبار مصرف - + کد تایید: 77501