hold action mobile + najva token updated

This commit is contained in:
hamid zarghami
2025-07-28 12:43:37 +03:30
parent 80114f6fc7
commit f67336eebe
5 changed files with 122 additions and 52 deletions
@@ -43,4 +43,10 @@ export const useSingleUpload = () => {
return useMutation({
mutationFn: (variables: FormData) => api.singleUpload(variables),
});
};
export const useUpdatePushToken = () => {
return useMutation({
mutationFn: (variables: UpdateProfileType) => api.updatePushToken(variables),
});
};
@@ -22,6 +22,11 @@ export const updateProfile = async (params: UpdateProfileType) => {
return data;
};
export const updatePushToken = async (params: UpdateProfileType) => {
const { data } = await axios.post(`/users/push-token`, params);
return data;
};
export const updateEmail = async (params: UpdateEmailType) => {
const { data } = await axios.patch(`/users/change-email`, params);
return data;
+19 -14
View File
@@ -3,7 +3,7 @@ import { FC, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Table from '../../components/Table';
import { ColumnType } from '../../components/types/TableTypes';
import { InfoCircle, Refresh2, Trash, ArchiveTick, Star1 } from 'iconsax-react';
import { InfoCircle, Refresh2, Trash, ArchiveTick, Star1, Sms } from 'iconsax-react';
import { RowActionItem } from '../../components/RowActionsDropdown';
import { useNavigate } from 'react-router-dom';
import { useGetInbox, useMarkAllRead, useSummarizeEmail } from './hooks/useEmailData';
@@ -86,12 +86,6 @@ const List: FC = () => {
className={`cursor-pointer min-w-[18px] ${isFetching ? 'animate-spin-reverse' : ''}`}
onClick={() => refetch()}
/>
<Button
label='علامت‌گذاری همه به عنوان خوانده شده'
className='h-8'
onClick={() => setShowModal(true)}
loading={isMarkingAllRead}
/>
</div>
);
@@ -103,23 +97,21 @@ const List: FC = () => {
onClick={() => handleMarkAsReadSelected()}
/>
<ArchiveTick
size={18}
color='black'
onClick={() => handleArchiveSelected()}
className="cursor-pointer"
className="cursor-pointer lg:size-[18px] size-[20px]"
/>
<InfoCircle size={18} color='black' className="cursor-pointer" />
<InfoCircle color='black' className="cursor-pointer lg:size-[18px] size-[20px]" />
<Star1
size={18}
color='black'
className="cursor-pointer"
className="cursor-pointer lg:size-[18px] size-[20px]"
onClick={() => handleFavoriteSelected()}
/>
<Trash
size={18}
color='#CD0000'
onClick={() => handleDeleteSelected()}
className="cursor-pointer"
className="cursor-pointer lg:size-[18px] size-[20px]"
/>
</>
);
@@ -236,6 +228,19 @@ const List: FC = () => {
searchField="search"
/>
<div className='flex justify-end mt-5 lg:mt-10 '>
<Button
onClick={() => setShowModal(true)}
loading={isMarkingAllRead}
className='w-fit'
>
<div className='flex items-center gap-2'>
<Sms size={18} color='white' />
<span>خواندن همه</span>
</div>
</Button>
</div>
<Table<InboxMessage>
columns={columns}
data={messages}