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 Tabs from '../../components/Tabs'
|
||||
import { KeySquare, Notification1 } from 'iconsax-react'
|
||||
import { useGetSettings } from './hooks/useSettingData'
|
||||
import PageLoading from '../../components/PageLoading'
|
||||
import Email from './components/Email'
|
||||
import Sms from './components/Sms'
|
||||
import ChangePassword from './components/ChangePassword'
|
||||
import { Helmet } from 'react-helmet-async'
|
||||
@@ -60,24 +59,25 @@ const Setting: FC = () => {
|
||||
</div>
|
||||
:
|
||||
getSettings.data?.data?.settings?.map((item: any) => {
|
||||
return (
|
||||
<Fragment key={item.id}>
|
||||
{
|
||||
item.settings?.map((item: any) => {
|
||||
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'>
|
||||
<div className='xl:text-[13px] text-xs'>
|
||||
{item?.notifSetting.title_fa}
|
||||
{item?.description}
|
||||
</div>
|
||||
<div className='flex xl:gap-4 gap-2'>
|
||||
<div className='flex gap-2 text-xs items-center text-description'>
|
||||
{/* <div className='flex gap-2 text-xs items-center text-description'>
|
||||
<div>
|
||||
{t('setting.email')}
|
||||
</div>
|
||||
<Email id={item.id} email={item.email} />
|
||||
</div>
|
||||
</div> */}
|
||||
<div className='flex gap-2 text-xs items-center text-description'>
|
||||
<div>
|
||||
{t('setting.sms')}
|
||||
</div>
|
||||
<Sms
|
||||
sms={item.sms}
|
||||
sms={item.isActive}
|
||||
id={item.id}
|
||||
/>
|
||||
</div>
|
||||
@@ -86,7 +86,11 @@ const Setting: FC = () => {
|
||||
)
|
||||
})
|
||||
}
|
||||
<div className='flex-1 px-4'></div>
|
||||
</Fragment>
|
||||
)
|
||||
})
|
||||
}
|
||||
<div className='flex-1 px-4 min-w-[40%]'></div>
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
|
||||
@@ -7,7 +7,7 @@ export const getSettings = async () => {
|
||||
};
|
||||
|
||||
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) => {
|
||||
|
||||
Reference in New Issue
Block a user