fix warnings from components

This commit is contained in:
HAM!DREZA
2025-01-21 16:36:43 +03:30
parent a930bf3324
commit fbf6a768bf
10 changed files with 219 additions and 111 deletions
+4 -12
View File
@@ -9,7 +9,7 @@ import SwitchComponent from '../../components/Switch'
import DatePickerComponent from '../../components/DatePicker'
import Select from '../../components/Select'
import Input from '../../components/Input'
const TicketList: FC = () => {
const AddList: FC = () => {
const { t } = useTranslation('global')
return (
<div className='mt-4 min-h-[500px]'>
@@ -31,12 +31,8 @@ const TicketList: FC = () => {
</Button>
</Link>
</div>
<div className='mt-4'>
<div className='flex justify-between items-center'>
<div className='flex flex-col xl:flex-row justify-between items-center xl:items-end'>
<div className='flex items-center gap-4'>
<div className='w-[200px]'>
<DatePickerComponent
@@ -60,8 +56,7 @@ const TicketList: FC = () => {
</div>
</div>
<div className='xl:w-[300px] w-full'>
<div className='mt-6 xl:mt-0 max-w-[420px] xl:w-[300px] w-full'>
<Input
variant='search'
placeholder={t('ads.search')}
@@ -72,9 +67,6 @@ const TicketList: FC = () => {
</div>
</div>
<div className='relative overflow-x-auto rounded-3xl mt-9 w-full'>
<table className='w-full text-sm '>
<thead className='thead'>
@@ -132,4 +124,4 @@ const TicketList: FC = () => {
)
}
export default TicketList
export default AddList
+4 -4
View File
@@ -6,7 +6,7 @@ import SwitchComponent from '../../components/Switch'
import { TickCircle, TickSquare, Link2 } from 'iconsax-react'
import DatePickerComponent from '../../components/DatePicker'
import ImageUploader from './components/ImageUploader'
const CreateTicket: FC = () => {
const CreateAd: FC = () => {
const { t } = useTranslation('global')
return (
<div className='mt-4'>
@@ -25,7 +25,7 @@ const CreateTicket: FC = () => {
</div>
</Button>
</div>
<div className='flex gap-6 xl:mt-8 mt-4'>
<div className='flex flex-col-reverse xl:flex-row gap-6 xl:mt-8 mt-4'>
<div className='flex-1 min-h-[calc(100vh-201px)] bg-white py-8 xl:px-10 px-4 rounded-3xl'>
<div className='mt-6'>
<Input
@@ -55,7 +55,7 @@ const CreateTicket: FC = () => {
<Link2 size={20} color='blue' className='absolute left-4 bottom-[10px]' />
</div>
</div>
<div className='min-h-[calc(100vh-201px)] bg-white w-sidebar xl:block hidden py-10 px-5 h-fit rounded-3xl'>
<div className='min-h-[calc(100vh-201px)] bg-white w-full xl:w-sidebar py-10 px-5 h-fit rounded-3xl'>
<div className='text-sm flex items-center justify-between'>
<p>
وضعیت تبلیغ
@@ -105,4 +105,4 @@ const CreateTicket: FC = () => {
)
}
export default CreateTicket
export default CreateAd
+36 -36
View File
@@ -7,43 +7,43 @@ import { useDropzone } from 'react-dropzone'
const ImageUploader: FC = () => {
const { t } = useTranslation('global')
const [file, setFile] = useState<File>()
const onDrop = useCallback((acceptedFiles: File[]) => {
setFile(acceptedFiles[0])
}, [])
const { getRootProps, getInputProps } = useDropzone({ onDrop })
return(
<>
<p className='mt-6 text-sm'>{t('ads.upload_picture')}</p>
<div
{...getRootProps()}
className='py-12 border border-dashed border-[#8C90A3] rounded-lg mt-2 flex items-center justify-center'>
<div className='flex flex-col items-center space-y-4'>
<Image size={45} color='#8C90A3' variant="Bold" className='border-[3px] border-[#8C90A3] rounded-md'
/>
<p className='text-sm text-[#8C90A3]'>
{
file ?
file.name
:
t('ads.to_upload_message')
const { t } = useTranslation('global')
const [file, setFile] = useState<File>()
const onDrop = useCallback((acceptedFiles: File[]) => {
setFile(acceptedFiles[0])
}, [])
const { getRootProps, getInputProps } = useDropzone({ onDrop })
}
</p>
<div className='flex gap-1'>
<DocumentUpload
size={20}
color='black'
/>
<button className='text-sm'>
<input {...getInputProps()} />
{t('ads.upload')}</button>
return (
<>
<p className='mt-6 text-sm'>{t('ads.upload_picture')}</p>
<div
{...getRootProps()}
className='py-12 border border-dashed border-[#8C90A3] rounded-lg mt-2 flex items-center justify-center'>
<div className='flex flex-col items-center space-y-4'>
<Image size={45} color='#8C90A3' variant="Bold" className='border-[3px] border-[#8C90A3] rounded-md'
/>
<p className='text-sm text-[#8C90A3]'>
{
file ?
file.name
:
t('ads.to_upload_message')
}
</p>
<div className='flex gap-1'>
<DocumentUpload
size={20}
color='black'
/>
<button className='text-sm'>
<input {...getInputProps()} />
{t('ads.upload')}</button>
</div>
</div>
</div>
</div>
</div>
</>
)
</>
)
}
export default ImageUploader