Skip to content

Commit

Permalink
feat(logout): add edit appnavigation
Browse files Browse the repository at this point in the history
  • Loading branch information
TanNguyen17112003 committed Dec 4, 2023
1 parent d7f1e10 commit 6eb933a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/components/common/AppNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export const AppNavigation: Component<{ mainMenu: RouteMenu; subMenu: RouteMenu
() => listFiles?.reduce((totalSize, file) => totalSize + file.fileSize, 0),
[listFiles]
);
const handleLogout = () => {
logout.mutateAsync();
};
return (
<div className='w-full max-h-[768px] py-3 shadow-md lg:sticky my-3 lg:my-0'>
<div className='flex items-center justify-between px-6 lg:px-9'>
Expand Down Expand Up @@ -62,7 +59,9 @@ export const AppNavigation: Component<{ mainMenu: RouteMenu; subMenu: RouteMenu
)}
<img className='w-7 h-7 lg:w-10 lg:h-10' src={coin} alt='coin'></img>
<PowerIcon
onClick={handleLogout}
onClick={() => {
logout.mutateAsync();
}}
className='w-10 h-10 hidden lg:block lg:opacity-40 lg:ml-6 lg:cursor-pointer'
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/services/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export const apiClient = createClient<paths>({

export async function invoke<T = unknown>(call: Promise<FetchResponse<T>>) {
const { data, error } = await call;
if (data) return data;
if (data !== undefined) return data;
throw (error as ResponseError).message;
}

0 comments on commit 6eb933a

Please sign in to comment.