setting
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
import { FC, useState } from 'react'
|
import { FC, Fragment, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Tabs from '../../components/Tabs'
|
import Tabs from '../../components/Tabs'
|
||||||
import { KeySquare, Notification1 } from 'iconsax-react'
|
import { KeySquare, Notification1 } from 'iconsax-react'
|
||||||
import { useGetSettings } from './hooks/useSettingData'
|
import { useGetSettings } from './hooks/useSettingData'
|
||||||
import PageLoading from '../../components/PageLoading'
|
import PageLoading from '../../components/PageLoading'
|
||||||
import Email from './components/Email'
|
|
||||||
import Sms from './components/Sms'
|
import Sms from './components/Sms'
|
||||||
import ChangePassword from './components/ChangePassword'
|
import ChangePassword from './components/ChangePassword'
|
||||||
import { Helmet } from 'react-helmet-async'
|
import { Helmet } from 'react-helmet-async'
|
||||||
@@ -61,32 +60,37 @@ const Setting: FC = () => {
|
|||||||
:
|
:
|
||||||
getSettings.data?.data?.settings?.map((item: any) => {
|
getSettings.data?.data?.settings?.map((item: any) => {
|
||||||
return (
|
return (
|
||||||
<div key={item.id} className='flex-1 min-w-[40%] border border-border px-4 rounded-2xl min-h-14 items-center flex justify-between'>
|
<Fragment key={item.id}>
|
||||||
<div className='xl:text-[13px] text-xs'>
|
{
|
||||||
{item?.notifSetting.title_fa}
|
item.settings?.map((item: any) => {
|
||||||
</div>
|
return (
|
||||||
<div className='flex xl:gap-4 gap-2'>
|
<div key={item.id} className='flex-1 min-w-[40%] border border-border px-4 rounded-2xl min-h-14 items-center flex justify-between'>
|
||||||
<div className='flex gap-2 text-xs items-center text-description'>
|
<div className='xl:text-[13px] text-xs'>
|
||||||
<div>
|
{item?.description}
|
||||||
{t('setting.email')}
|
</div>
|
||||||
</div>
|
<div className='flex xl:gap-4 gap-2'>
|
||||||
<Email id={item.id} email={item.email} />
|
{/* <div className='flex gap-2 text-xs items-center text-description'>
|
||||||
</div>
|
<div>
|
||||||
<div className='flex gap-2 text-xs items-center text-description'>
|
{t('setting.email')}
|
||||||
<div>
|
</div>
|
||||||
{t('setting.sms')}
|
<Email id={item.id} email={item.email} />
|
||||||
</div>
|
</div> */}
|
||||||
<Sms
|
<div className='flex gap-2 text-xs items-center text-description'>
|
||||||
sms={item.sms}
|
<Sms
|
||||||
id={item.id}
|
sms={item.isActive}
|
||||||
/>
|
id={item.id}
|
||||||
</div>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</Fragment>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
<div className='flex-1 px-4'></div>
|
<div className='flex-1 px-4 min-w-[40%]'></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const getSettings = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const updateSettings = async (params: UpdateSettingType) => {
|
export const updateSettings = async (params: UpdateSettingType) => {
|
||||||
await axios.patch(`/settings/${params.id}/update`, params);
|
await axios.patch(`/settings/${params.id}/toggle`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const changePassword = async (params: ChangePasswordType) => {
|
export const changePassword = async (params: ChangePasswordType) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user