perf: modified billboard page
This commit is contained in:
parent
7a663d2de7
commit
fdf1a57761
3 changed files with 30 additions and 10 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
import { Breadcrumb } from 'antd';
|
import { Breadcrumb } from 'antd';
|
||||||
import { Home } from 'lucide';
|
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import LucideIcon from '@/components/ui/LucideIcon';
|
|
||||||
import { sidebarItems } from '@/constants/navigation';
|
import { sidebarItems } from '@/constants/navigation';
|
||||||
import { spacing } from '@/design/tokens/spacing';
|
import { spacing } from '@/design/tokens/spacing';
|
||||||
|
|
||||||
|
|
@ -18,7 +16,6 @@ const PageBreadcrumb = () => {
|
||||||
|
|
||||||
const homeLabel = (
|
const homeLabel = (
|
||||||
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 4 }}>
|
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 4 }}>
|
||||||
<LucideIcon icon={Home} size={14} />
|
|
||||||
داشبورد
|
داشبورد
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,12 @@ interface LucideIconProps extends SVGProps<SVGSVGElement> {
|
||||||
|
|
||||||
const toReactPropName = (name: string) => name.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
const toReactPropName = (name: string) => name.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
||||||
|
|
||||||
const LucideIcon = ({ icon, ...props }: LucideIconProps): ReactElement => {
|
const LucideIcon = ({ icon, size, ...props }: LucideIconProps): ReactElement => {
|
||||||
const svgProps = {
|
const svgProps = {
|
||||||
...props,
|
...props,
|
||||||
xmlns: 'http://www.w3.org/2000/svg',
|
xmlns: 'http://www.w3.org/2000/svg',
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
fill: 'none',
|
fill: 'none',
|
||||||
stroke: 'currentColor',
|
stroke: 'currentColor',
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { App, Button, Card, Empty, Image, Spin, Tag, Tooltip, Typography } from 'antd';
|
import { App, Button, Card, Empty, Image, Spin, Tag, Tooltip, Typography } from 'antd';
|
||||||
import { ArrowRight, FileText } from 'lucide';
|
import { ArrowRight, FileText, Tag as TagIcon } from 'lucide';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Link, useNavigate, useParams } from 'react-router-dom';
|
import { Link, useNavigate, useParams } from 'react-router-dom';
|
||||||
import LucideIcon from '@/components/ui/LucideIcon';
|
import LucideIcon from '@/components/ui/LucideIcon';
|
||||||
|
|
@ -238,14 +238,35 @@ const AdDetail = () => {
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description + tags */}
|
{/* Description */}
|
||||||
<Card title="توضیحات" variant="outlined" style={sectionCardStyle}>
|
<Card title="توضیحات" variant="outlined" style={sectionCardStyle}>
|
||||||
<Paragraph style={{ color: colors.text, whiteSpace: 'pre-wrap', marginBottom: spacing.md }}>
|
<Paragraph style={{ color: colors.text, whiteSpace: 'pre-wrap', margin: 0 }}>
|
||||||
{ad.description ?? <EmptyValue />}
|
{ad.description ?? <EmptyValue />}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
|
</Card>
|
||||||
{ad.tags.length ? ad.tags.map((tag) => <Tag key={tag}>{tag}</Tag>) : <EmptyValue />}
|
|
||||||
</div>
|
{/* Tags */}
|
||||||
|
<Card
|
||||||
|
title={
|
||||||
|
<span style={{ display: 'inline-flex', alignItems: 'center', gap: spacing.xs }}>
|
||||||
|
<LucideIcon icon={TagIcon} size={14} color={colors.textSecondary} />
|
||||||
|
برچسبها
|
||||||
|
</span>
|
||||||
|
}
|
||||||
|
variant="outlined"
|
||||||
|
style={sectionCardStyle}
|
||||||
|
>
|
||||||
|
{ad.tags.length ? (
|
||||||
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: spacing.xs }}>
|
||||||
|
{ad.tags.map((tag) => (
|
||||||
|
<Tag key={tag} color={colors.primaryLight} style={{ color: colors.primary, fontSize: 13 }}>
|
||||||
|
{tag}
|
||||||
|
</Tag>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<EmptyValue />
|
||||||
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Media */}
|
{/* Media */}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue