Skip to content

Commit

Permalink
fix showing toast Unauthorized n singin page
Browse files Browse the repository at this point in the history
  • Loading branch information
SaidM96 committed Dec 9, 2024
1 parent e645a44 commit 3394b7f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
8 changes: 6 additions & 2 deletions apps/desk/src/renderer/src/assets/globals.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down Expand Up @@ -87,4 +87,8 @@ body {

.font-roboto {
font-family: "Roboto", sans-serif;
}
}

.font-nunito {
font-family: "Nunito Sans", sans-serif;
}
2 changes: 1 addition & 1 deletion apps/desk/src/renderer/src/components/SelectLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function SelectLanguage(): JSX.Element {
onClick={() => setIsOpen((curr) => !curr)}
className="flex items-center cursor-pointer gap-2 text-gray-600 hover:text-gray-800"
>
<span className="text-sm">{lng.name}</span>
<span className="text-sm font-nunito">{lng.name}</span>
<HiOutlineChevronDown className="text-xs text-gray-500" />
</PopoverTrigger>

Expand Down
1 change: 1 addition & 0 deletions apps/desk/src/renderer/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';

export default function Sidebar() {
const [active, setActive] = useState('home');

const { t } = useTranslation();

const { isAccountActivated, userRole, userProfile } = useAppSelector(
Expand Down
1 change: 0 additions & 1 deletion apps/desk/src/renderer/src/components/custom-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export function CustomTable<TData, TValue>({

if (component === 'add' || component === 'edit') {
return <> {EditAndAddRowComponent} </>;
// return <p className='text-xl text-gray-900'>isjgbsjdb</p>
}

return (
Expand Down
8 changes: 6 additions & 2 deletions apps/desk/src/renderer/src/components/navbar/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ export default function ProfilePopover() {

return (
<Popover>
<PopoverTrigger className="flex items-center cursor-pointer gap-2">
<PopoverTrigger className="flex items-center cursor-pointer gap-2 ">
<FaUserCircle className="w-8 h-8 text-gray-700 rounded-full border-4 border-blue-200/80" />
<p className="text-xs font-normal font-poppins text-[#1F384C] hover:text-gray-800">
{user.userType === 'SOLUTION_OWNER'
? `Sygafor ${user.role}`
: `Organization ${user.role}`}
</p>
<HiOutlineChevronDown className="text-sm text-gray-500" />
</PopoverTrigger>

Expand Down Expand Up @@ -53,4 +58,3 @@ export default function ProfilePopover() {
</Popover>
);
}

5 changes: 0 additions & 5 deletions apps/desk/src/renderer/src/providers/react-query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from '@tanstack/react-query';
import { AxiosError } from 'axios';
import { Dispatch } from 'react';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

// Define a reusable function for handling Unauthorized errors
function handleAxiosError(
Expand All @@ -24,9 +23,6 @@ function handleAxiosError(
if (data && data.statusCode === 401 && data.error === 'Unauthorized') {
dispatch(resetAuth());
localStorage.clear();
toast.error('Unauthorized', {
position: 'top-center',
});
}

// Handle Permissions
Expand Down Expand Up @@ -63,7 +59,6 @@ export const ReactQueryProvider = ({ children }) => {
return (
<QueryClientProvider client={queryClient}>
{children}
{/* <ReactQueryDevtools initialIsOpen={true} /> */}
</QueryClientProvider>
);
};

0 comments on commit 3394b7f

Please sign in to comment.