Skip to content

Commit

Permalink
Merge pull request #599 from us3r-network/F-reconstructProfile-bufan
Browse files Browse the repository at this point in the history
using route login gate at notificaiton page
  • Loading branch information
sin-bufan authored Mar 11, 2024
2 parents a3b8fe0 + ceb8659 commit d91ec63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
25 changes: 9 additions & 16 deletions apps/u3/src/container/notification/NotificationLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
import { Outlet } from 'react-router-dom';
import NotificationMenu from './NotificationMenu';
import useLogin from '@/hooks/shared/useLogin';
import NoLogin from '@/components/layout/NoLogin';

export default function NotificationLayout() {
const { isLogin } = useLogin();
if (isLogin) {
return (
<div className="w-full h-full flex">
<div className="w-[280px] h-full max-sm:hidden">
<NotificationMenu />
</div>
<div className="flex-1 h-full overflow-auto">
<Outlet />
</div>
return (
<div className="w-full h-full flex">
<div className="w-[280px] h-full max-sm:hidden">
<NotificationMenu />
</div>
);
}

return <NoLogin />;
<div className="flex-1 h-full overflow-auto">
<Outlet />
</div>
</div>
);
}
4 changes: 3 additions & 1 deletion apps/u3/src/container/profile/ProfileLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useDid from '@/hooks/profile/useDid';
import ProfileInfoCard from '@/components/profile/info/ProfileInfoCard';
import Loading from '@/components/common/loading/Loading';
import ProfileMenu from './ProfileMenu';
import ProfileMobileHeader from './ProfileMobileHeader';

export type ProfileOutletContext = {
did: string;
Expand Down Expand Up @@ -108,7 +109,8 @@ export default function ProfileLayout() {
</div>
{/* Mobile */}
<div className="w-full h-full flex-col sm:hidden">
<div className="overflow-auto">
<ProfileMobileHeader />
<div className="bg-[#1B1E23] overflow-auto">
<ProfileInfoCard isSelf={isSelf} identity={identity || session?.id} />
</div>
<div className="flex-1 h-full overflow-auto" id="profile-warper">
Expand Down
1 change: 1 addition & 0 deletions apps/u3/src/route/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export const routes: CutomRouteObject[] = [
path: '/notification',
element: loadContainerElement('notification/NotificationLayout'),
key: RouteKey.notification,
permissions: [RoutePermission.login],
title: 'Notifications',
children: [
{
Expand Down

0 comments on commit d91ec63

Please sign in to comment.