signture +
This commit is contained in:
+24
-91
@@ -1,91 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 27.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 961.6 222.5" style="enable-background:new 0 0 961.6 222.5;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#1D1D1B;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M246,180.4h-8.7v24.3h-3.6v-24.3H225v-2.9h21V180.4z"/>
|
||||
<path class="st0" d="M279.1,205c-2.7,0-5-0.9-6.7-2.7s-2.6-4.2-2.6-7.2v-0.6c0-2,0.4-3.8,1.1-5.4s1.8-2.8,3.2-3.7
|
||||
s2.9-1.3,4.5-1.3c2.6,0,4.7,0.9,6.1,2.6c1.5,1.7,2.2,4.2,2.2,7.4v1.4h-13.7c0,2,0.6,3.6,1.7,4.8s2.5,1.8,4.2,1.8
|
||||
c1.2,0,2.3-0.2,3.1-0.7s1.6-1.2,2.2-2l2.1,1.6C285,203.7,282.5,205,279.1,205z M278.7,186.9c-1.4,0-2.6,0.5-3.5,1.5
|
||||
s-1.5,2.4-1.8,4.3h10.1v-0.3c-0.1-1.8-0.6-3.1-1.4-4.1C281.3,187.4,280.1,186.9,278.7,186.9z"/>
|
||||
<path class="st0" d="M320.4,202.2c1.2,0,2.3-0.4,3.2-1.1c0.9-0.7,1.4-1.7,1.5-2.8h3.3c-0.1,1.2-0.5,2.3-1.2,3.3
|
||||
s-1.7,1.9-2.9,2.5c-1.2,0.6-2.5,0.9-3.9,0.9c-2.8,0-4.9-0.9-6.6-2.8c-1.6-1.8-2.4-4.3-2.4-7.5v-0.6c0-2,0.4-3.7,1.1-5.2
|
||||
s1.8-2.7,3.1-3.6c1.4-0.8,2.9-1.3,4.8-1.3c2.3,0,4.1,0.7,5.6,2c1.5,1.4,2.3,3.1,2.4,5.3h-3.3c-0.1-1.3-0.6-2.4-1.5-3.2
|
||||
s-2-1.3-3.3-1.3c-1.8,0-3.1,0.6-4.1,1.9s-1.4,3.1-1.4,5.5v0.7c0,2.3,0.5,4.1,1.4,5.4C317.2,201.6,318.6,202.2,320.4,202.2z"/>
|
||||
<path class="st0" d="M357,186.9c1.5-1.9,3.5-2.8,6-2.8c4.3,0,6.4,2.4,6.5,7.2v13.4H366v-13.4c0-1.5-0.3-2.5-1-3.2s-1.7-1-3.1-1
|
||||
c-1.1,0-2.1,0.3-3,0.9s-1.5,1.4-2,2.4v14.4h-3.4v-28.7h3.5V186.9z"/>
|
||||
<path class="st0" d="M399.1,184.5l0.1,2.5c1.5-1.9,3.6-2.9,6.1-2.9c4.3,0,6.4,2.4,6.5,7.2v13.4h-3.5v-13.4c0-1.5-0.3-2.5-1-3.2
|
||||
s-1.7-1-3.1-1c-1.1,0-2.1,0.3-3,0.9s-1.5,1.4-2,2.4v14.4h-3.5v-20.2h3.4V184.5z"/>
|
||||
<path class="st0" d="M437.3,194.4c0-2,0.4-3.8,1.2-5.3c0.8-1.6,1.9-2.8,3.2-3.7s3-1.3,4.8-1.3c2.8,0,5,1,6.7,2.9
|
||||
s2.5,4.4,2.5,7.6v0.2c0,2-0.4,3.7-1.1,5.3s-1.8,2.8-3.2,3.7c-1.4,0.9-3,1.3-4.8,1.3c-2.7,0-5-1-6.7-2.9s-2.5-4.4-2.5-7.6v-0.2
|
||||
H437.3z M440.8,194.8c0,2.2,0.5,4,1.6,5.4c1,1.4,2.4,2,4.2,2c1.8,0,3.1-0.7,4.2-2.1s1.6-3.3,1.6-5.8c0-2.2-0.5-4-1.6-5.4
|
||||
s-2.5-2.1-4.2-2.1s-3.1,0.7-4.1,2C441.3,190.3,440.8,192.3,440.8,194.8z"/>
|
||||
<path class="st0" d="M485.1,204.7h-3.5V176h3.5V204.7z"/>
|
||||
<path class="st0" d="M511,194.4c0-2,0.4-3.8,1.2-5.3c0.8-1.5,1.9-2.8,3.2-3.7c1.4-0.9,3-1.3,4.8-1.3c2.8,0,5,1,6.7,2.9
|
||||
s2.5,4.4,2.5,7.6v0.2c0,2-0.4,3.7-1.1,5.3s-1.8,2.8-3.2,3.7s-3,1.3-4.8,1.3c-2.7,0-5-1-6.7-2.9c-1.7-1.9-2.5-4.4-2.5-7.6v-0.2
|
||||
H511z M514.4,194.8c0,2.2,0.5,4,1.6,5.4c1,1.4,2.4,2,4.2,2s3.2-0.7,4.2-2.1c1-1.4,1.5-3.3,1.5-5.8c0-2.2-0.5-4-1.6-5.4
|
||||
s-2.5-2.1-4.2-2.1s-3.1,0.7-4.1,2C515,190.3,514.4,192.3,514.4,194.8z"/>
|
||||
<path class="st0" d="M554.1,194.4c0-3.2,0.7-5.7,2.2-7.5s3.4-2.8,5.8-2.8c2.5,0,4.4,0.9,5.8,2.6l0.2-2.2h3.2v19.7
|
||||
c0,2.6-0.8,4.7-2.3,6.2c-1.6,1.5-3.6,2.3-6.2,2.3c-1.5,0-2.9-0.3-4.3-0.9c-1.4-0.6-2.5-1.5-3.2-2.6l1.8-2.1
|
||||
c1.5,1.8,3.3,2.7,5.4,2.7c1.7,0,3-0.5,3.9-1.4s1.4-2.3,1.4-4v-1.7c-1.4,1.6-3.3,2.4-5.7,2.4s-4.3-1-5.7-2.9
|
||||
S554.1,197.7,554.1,194.4z M557.6,194.8c0,2.3,0.5,4.1,1.4,5.4c0.9,1.3,2.2,2,3.9,2c2.2,0,3.8-1,4.8-3V190
|
||||
c-1.1-1.9-2.6-2.9-4.8-2.9c-1.7,0-3,0.7-3.9,2C558.1,190.3,557.6,192.2,557.6,194.8z"/>
|
||||
<path class="st0" d="M604.3,199.6l4.7-15.1h3.7l-8.1,23.3c-1.3,3.4-3.3,5-6,5l-0.7-0.1l-1.3-0.2v-2.8l0.9,0.1
|
||||
c1.2,0,2.1-0.2,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1,0.4,1.9,1.1,2.5C859.2,201.7,860.2,202,861.3,202z"/>
|
||||
<path class="st0" d="M899.9,184.5l0.1,2.5c1.5-1.9,3.6-2.9,6.1-2.9c4.3,0,6.4,2.4,6.5,7.2v13.4h-3.5v-13.4c0-1.5-0.3-2.5-1-3.2
|
||||
s-1.7-1-3.1-1c-1.1,0-2.1,0.3-3,0.9s-1.5,1.4-2,2.4v14.4h-3.5v-20.2h3.4V184.5z"/>
|
||||
<path class="st0" d="M945.6,199.6l4.7-15.1h3.7l-8.1,23.3c-1.3,3.4-3.3,5-6,5l-0.7-0.1l-1.3-0.2v-2.8l0.9,0.1
|
||||
c1.2,0,2.1-0.2,2.7-0.7c0.7-0.5,1.2-1.3,1.6-2.6l0.8-2.1l-7.2-20h3.8L945.6,199.6z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st0" d="M221.6,148.7V44.1h29.5c9.1,0,17.1,2,24.1,6s12.4,9.7,16.2,17.2c3.8,7.4,5.7,15.9,5.8,25.6v6.7
|
||||
c0,9.9-1.9,18.5-5.7,25.9c-3.8,7.4-9.2,13.1-16.3,17.1c-7.1,4-15.3,6-24.7,6.1L221.6,148.7L221.6,148.7z M235.4,55.4v82h14.5
|
||||
c10.6,0,18.9-3.3,24.8-9.9c5.9-6.6,8.9-16,8.9-28.3v-6.1c0-11.9-2.8-21.1-8.4-27.7s-13.5-9.9-23.7-10L235.4,55.4L235.4,55.4z"/>
|
||||
<path class="st0" d="M627.1,148.7h-13.9l-52.7-80.6v80.6h-13.9V44.1h13.9l52.8,81v-81H627v104.6H627.1z"/>
|
||||
<path class="st0" d="M900.9,100.1l-12.8,13.3v35.3h-13.8V44.1h13.8v51.7l46.5-51.7h16.7l-41.2,46.2l44.4,58.4H938L900.9,100.1z"/>
|
||||
<polygon class="st0" points="423.2,61.1 455.1,148.7 469.2,148.7 429.2,44.1 417.1,44.1 377.2,148.7 391.4,148.7 "/>
|
||||
<polygon class="st0" points="750.6,61.1 782.6,148.7 796.7,148.7 756.7,44.1 744.6,44.1 704.7,148.7 718.9,148.7 "/>
|
||||
</g>
|
||||
<path class="st0" d="M132.1,140.4c0,0-26.1,25.2-48,46.5v28.9c-2.2,1.7,77.6-75.4,77.6-75.4L84.1,59v31L132.1,140.4z"/>
|
||||
<g>
|
||||
<polygon class="st0" points="83.7,157.5 6.5,75.1 7.5,74.2 84.7,156.6 "/>
|
||||
<polygon class="st0" points="83.7,149.8 13.6,75.2 14.6,74.3 84.6,148.9 "/>
|
||||
<polygon class="st0" points="83.7,142.1 20.7,75.4 21.7,74.4 84.6,141.1 "/>
|
||||
<polygon class="st0" points="83.6,134.3 27.8,75.5 28.7,74.6 84.6,133.4 "/>
|
||||
<polygon class="st0" points="83.6,126.6 34.9,75.6 35.8,74.7 84.6,125.7 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st0" points="8,75.5 7.1,74.5 83.7,0 84.6,0.9 "/>
|
||||
<polygon class="st0" points="15.2,75.5 14.3,74.6 83.6,7 84.5,7.9 "/>
|
||||
<polygon class="st0" points="22.4,75.6 21.4,74.7 83.6,14 84.5,14.9 "/>
|
||||
<polygon class="st0" points="29.5,75.6 28.6,74.7 83.5,21 84.4,22 "/>
|
||||
<polygon class="st0" points="36.7,75.7 35.7,74.8 83.5,28 84.4,29 "/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 224.37 39.19">
|
||||
<!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141) -->
|
||||
<defs>
|
||||
<style>
|
||||
.st0 {
|
||||
fill: #231f20;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<polygon class="st0" points="149.55 7.56 160.5 37.57 165.34 37.57 151.62 1.72 147.49 1.72 133.79 37.57 138.67 37.57 149.55 7.56"/>
|
||||
<path class="st0" d="M22.83,18.01l.1,19.39c2.24,0,8.63.01,11.79-.01.94,0,1.87-.06,2.76-.16,7.85-.91,14.3-7.82,15-16.07.45-5.23-1.13-10.19-4.44-13.97s-7.92-5.86-12.96-5.86h0c-3.41,0-9.15.01-12.09.02,2.27,2.36,5.2,5.38,8.13,8.41,2.98,3.07,5.95,6.14,8.21,8.49l.56.58-2.16,2.25c-.81.85-1.71,1.63-2.8,1.63-.79,0-1.55-.4-2.37-1.26l-10.4-10.87C17.98,6.21,14.23,2.3,13.3,1.33h-1.55v36.05h4.75l.05-25.25,6.3,5.87h-.02ZM32.46,5.95l1.7-.17c4.75-.43,9.4,1.99,11.59,6.09l.29.54-3.55,3.68-10.04-10.15h0ZM26.18,21.52l4.14,4.32c2.81,2.91,7.12,1.52,9.91-1.36,1.26-1.3,3.22-3.35,4.69-4.89,1.05-1.1,1.85-1.94,1.99-2.07l1.21-1.2.11,1.74c.24,3.78-1.04,7.55-3.51,10.36-2.48,2.81-5.84,4.4-9.47,4.46-.98.02-1.97.02-2.95.02h-6.12v-11.38h0Z"/>
|
||||
<path class="st0" d="M91.07,1.35l11.49,29.3h.15L114.21,1.35h6.24v36.06h-4.88v-14.27l.5-14.66-.12-.02-11.69,28.96h-3.25l-11.64-28.88-.12.02.47,14.59v14.27h-4.88V1.36h6.24,0Z"/>
|
||||
<path class="st0" d="M73.79,24.08h-12.14v-3.81h12.14v3.81Z"/>
|
||||
<path class="st0" d="M184.59,37.41h-4.91V1.35h4.91v36.06Z"/>
|
||||
<path class="st0" d="M206.13,33.57h17.07v3.84h-21.95V1.35h4.88v32.23h0Z"/>
|
||||
<path class="st0" d="M7.35,37.41H2.26v-1.67c0-.55.11-.97.34-1.25s.57-.42,1.01-.42c.24,0,.45.07.63.2.18.14.32.32.43.55.08-.28.22-.49.44-.65s.47-.24.77-.24c.46,0,.82.15,1.08.44s.39.72.39,1.26v1.77h0ZM4.43,36.74v-1.01c0-.29-.07-.53-.22-.7-.15-.18-.35-.26-.6-.26-.28,0-.48.08-.61.24-.13.16-.19.41-.19.75v.99h1.62ZM4.97,36.74h1.83v-1.11c0-.31-.08-.56-.24-.74s-.39-.27-.67-.27c-.61,0-.92.33-.92,1v1.12h0Z"/>
|
||||
<path class="st0" d="M4.81,31.14l-2.56-1.33v-.76l3.19,1.76h1.9v.67h-1.9l-3.19,1.76v-.77l2.56-1.32h0Z"/>
|
||||
<path class="st0" d="M7.23,25.95H2.12v-1.44c0-.44.1-.84.29-1.18.2-.34.48-.61.84-.79.36-.19.78-.28,1.25-.28h.33c.48,0,.9.09,1.27.28s.64.45.84.8c.19.34.29.75.3,1.2v1.41h0ZM2.67,25.27h4.01v-.71c0-.52-.16-.92-.48-1.21-.32-.29-.78-.43-1.38-.43h-.3c-.58,0-1.03.14-1.35.41s-.48.66-.49,1.16v.79h-.01Z"/>
|
||||
<path class="st0" d="M7.23,11.86v.68l-3.94,2.57h3.94v.68H2.12v-.68l3.95-2.58h-3.95v-.67h5.11Z"/>
|
||||
<path class="st0" d="M4.85,3.89l.65.62h1.73v.67H2.12v-.67h2.53l-2.53-2.27v-.81l2.26,2.01,2.85-2.17v.81l-2.37,1.81h-.01Z"/>
|
||||
<polygon class="st0" points="2.95 19.13 7.23 17.57 7.23 16.89 2.12 18.84 2.12 19.43 7.23 21.38 7.23 20.68 2.95 19.13"/>
|
||||
<polygon class="st0" points="2.95 8.57 7.23 7.01 7.23 6.32 2.12 8.27 2.12 8.86 7.23 10.81 7.23 10.12 2.95 8.57"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.8 KiB |
+5
-1
@@ -131,7 +131,11 @@
|
||||
"description_sign": "توضیحات امضا",
|
||||
"select_section": "لطفا یک بخش انتخاب کنید",
|
||||
"title1": "عنوان",
|
||||
"quota": "فضا/ استفاده شده "
|
||||
"quota": "فضا/ استفاده شده ",
|
||||
"name_sign": "نام امضا"
|
||||
},
|
||||
"app": {
|
||||
"menu": "منو"
|
||||
},
|
||||
"attachment_select": "اضافه کردن فایل ضمیمه",
|
||||
"domain": {
|
||||
|
||||
@@ -1,11 +1,70 @@
|
||||
import Input from '@/components/Input'
|
||||
import Textarea from '@/components/Textarea'
|
||||
import UploadBox from '@/components/UploadBox'
|
||||
import { FC } from 'react'
|
||||
import Button from '@/components/Button'
|
||||
import { FC, useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useSignatureData, useCreateSignature, useUpdateSignature } from './hooks/useSignatureData'
|
||||
import { SignatureData } from './types/Types'
|
||||
|
||||
const Signture: FC = () => {
|
||||
|
||||
const { t } = useTranslation()
|
||||
const { data: signatureData, isLoading } = useSignatureData()
|
||||
const createSignatureMutation = useCreateSignature()
|
||||
const updateSignatureMutation = useUpdateSignature()
|
||||
|
||||
const [formData, setFormData] = useState<SignatureData>({
|
||||
name: '',
|
||||
textContent: ''
|
||||
})
|
||||
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (signatureData?.data?.signature) {
|
||||
setFormData({
|
||||
name: signatureData.data.signature.name || '',
|
||||
textContent: signatureData.data.signature.textContent || ''
|
||||
})
|
||||
}
|
||||
}, [signatureData])
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.name.trim() || !formData.textContent.trim()) {
|
||||
return
|
||||
}
|
||||
|
||||
setIsSubmitting(true)
|
||||
|
||||
try {
|
||||
if (signatureData?.data?.signature?.id) {
|
||||
await updateSignatureMutation.mutateAsync(formData)
|
||||
} else {
|
||||
await createSignatureMutation.mutateAsync(formData)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error saving signature:', error)
|
||||
} finally {
|
||||
setIsSubmitting(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleInputChange = (field: keyof SignatureData, value: string) => {
|
||||
setFormData(prev => ({
|
||||
...prev,
|
||||
[field]: value
|
||||
}))
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className='bg-white rounded-4xl p-8 mt-9'>
|
||||
<div className='text-center py-8'>
|
||||
در حال بارگذاری...
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='bg-white rounded-4xl p-8 mt-9'>
|
||||
<div className='mt-9'>
|
||||
@@ -20,14 +79,31 @@ const Signture: FC = () => {
|
||||
</div>
|
||||
|
||||
<div className='flex-1 mt-4 xl:mt-0'>
|
||||
<UploadBox
|
||||
label={t('setting.upload_sign')}
|
||||
<Input
|
||||
label={t('setting.name_sign')}
|
||||
value={formData.name}
|
||||
onChange={(e) => handleInputChange('name', e.target.value)}
|
||||
placeholder="نام امضا را وارد کنید"
|
||||
/>
|
||||
<div className='xl:mt-8 mt-5'>
|
||||
<Textarea
|
||||
label={t('setting.description_sign')}
|
||||
value={formData.textContent}
|
||||
onChange={(e) => handleInputChange('textContent', e.target.value)}
|
||||
placeholder="محتوای امضا را وارد کنید"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className='mt-6 flex justify-end'>
|
||||
<Button
|
||||
onClick={handleSubmit}
|
||||
disabled={isSubmitting || !formData.name.trim() || !formData.textContent.trim()}
|
||||
loading={isSubmitting}
|
||||
className='px-8 w-auto'
|
||||
>
|
||||
{signatureData?.data?.signature?.id ? 'بهروزرسانی امضا' : 'ایجاد امضا'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import {
|
||||
createSignature,
|
||||
getSignature,
|
||||
updateSignature,
|
||||
} from "../service/Service";
|
||||
import type { SignatureData } from "../types/Types";
|
||||
|
||||
export const useSignatureData = () => {
|
||||
return useQuery({
|
||||
queryKey: ["signature-data"],
|
||||
queryFn: getSignature,
|
||||
retry: false,
|
||||
});
|
||||
};
|
||||
|
||||
export const useCreateSignature = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (data: SignatureData) => createSignature(data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["signature-data"] });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const useUpdateSignature = () => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (data: SignatureData) => updateSignature(data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["signature-data"] });
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import axios from "@/config/axios";
|
||||
import { SignatureData, SignatureResponse } from "../types/Types";
|
||||
|
||||
export const getSignature = async (): Promise<SignatureResponse> => {
|
||||
const { data } = await axios.get("/email-signatures");
|
||||
return data;
|
||||
};
|
||||
|
||||
export const createSignature = async (
|
||||
params: SignatureData
|
||||
): Promise<SignatureResponse> => {
|
||||
const { data } = await axios.post("/email-signatures", params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateSignature = async (
|
||||
params: SignatureData
|
||||
): Promise<SignatureResponse> => {
|
||||
const { data } = await axios.patch("/email-signatures", params);
|
||||
return data;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
export interface SignatureData {
|
||||
name: string;
|
||||
textContent: string;
|
||||
}
|
||||
|
||||
export interface SignatureItem {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
deletedAt: string | null;
|
||||
business: string;
|
||||
name: string;
|
||||
textContent: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export interface SignatureResponse {
|
||||
statusCode: number;
|
||||
success: boolean;
|
||||
data: {
|
||||
signature: SignatureItem;
|
||||
};
|
||||
}
|
||||
@@ -35,11 +35,11 @@ const SideBar: FC = () => {
|
||||
</div>
|
||||
|
||||
<div className='flex-1 flex flex-col h-full overflow-y-auto no-scrollbar min-h-0'>
|
||||
{/* <div className='mt-8 md:mt-10 px-8 md:px-12 text-[#C3C7DD] text-sm font-bold'>
|
||||
{t('setting.title')}
|
||||
</div> */}
|
||||
<div className='mt-8 md:mt-10 px-8 md:px-12 text-[#C3C7DD] text-sm font-bold'>
|
||||
{t('app.menu')}
|
||||
</div>
|
||||
|
||||
<div className='text-xs text-[#8C90A3] mt-14'>
|
||||
<div className='text-xs text-[#8C90A3] mt-4'>
|
||||
<SideBarItem
|
||||
icon={<Setting3 variant={isActive(Paths.settingMailServer) ? 'Bold' : 'Outline'} color={isActive(Paths.settingMailServer) ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={t('setting.mail_server')}
|
||||
|
||||
Reference in New Issue
Block a user