-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #614 from us3r-network/F-reconstructProfile-bufan
fav page
- Loading branch information
Showing
6 changed files
with
146 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Outlet } from 'react-router-dom'; | ||
import FavMenu from './FavMenu'; | ||
import FavMobileHeader from './FavMobileHeader'; | ||
|
||
export default function FavLayout() { | ||
return ( | ||
<> | ||
{/* Desktop */} | ||
<div className="w-full h-full flex max-sm:hidden"> | ||
<div className="bg-[#1B1E23] w-[280px] h-full"> | ||
<FavMenu /> | ||
</div> | ||
<div className="flex-1 h-full overflow-auto" id="profile-warper"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
{/* Mobile */} | ||
<div className="w-full h-full flex-col sm:hidden"> | ||
<FavMobileHeader /> | ||
<div className="flex-1 h-full overflow-auto" id="profile-warper"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { ComponentPropsWithRef } from 'react'; | ||
import { useLocation, useParams } from 'react-router-dom'; | ||
import { cn } from '@/lib/utils'; | ||
import LoginButtonV2 from '@/components/layout/LoginButtonV2'; | ||
import NavLinkItem from '@/components/layout/NavLinkItem'; | ||
|
||
export default function FavMenu({ | ||
className, | ||
...props | ||
}: ComponentPropsWithRef<'div'>) { | ||
const { user } = useParams(); | ||
const { pathname } = useLocation(); | ||
const pathSuffix = user ? `/${user}` : ''; | ||
return ( | ||
<div | ||
className={cn( | ||
` | ||
w-full h-full flex flex-col`, | ||
className | ||
)} | ||
{...props} | ||
> | ||
<div className="flex-1 w-full p-[20px] box-border overflow-auto"> | ||
<h1 className="text-[#FFF] text-[24px] font-medium leading-[20px] mb-[20px]"> | ||
{user || 'My'} Favorites | ||
</h1> | ||
<div className="flex-1 w-full flex flex-col gap-[5px]"> | ||
<NavLinkItem | ||
href={`/fav/posts${pathSuffix}`} | ||
active={pathname === `/fav/posts${pathSuffix}`} | ||
> | ||
Posts | ||
</NavLinkItem> | ||
<NavLinkItem | ||
href={`/fav/links${pathSuffix}`} | ||
active={pathname === `/fav/links${pathSuffix}`} | ||
> | ||
Links | ||
</NavLinkItem> | ||
{/* <NavLinkItem | ||
href={`/fav/frame${pathSuffix}`} | ||
active={pathname === `/fav/frame${pathSuffix}`} | ||
> | ||
Frame | ||
</NavLinkItem> | ||
<NavLinkItem | ||
href={`/fav/apps${pathSuffix}`} | ||
active={pathname === `/fav/apps${pathSuffix}`} | ||
> | ||
Apps | ||
</NavLinkItem> */} | ||
</div> | ||
</div> | ||
<LoginButtonV2 /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* @Author: shixuewen [email protected] | ||
* @Date: 2022-12-29 18:44:14 | ||
* @LastEditors: shixuewen [email protected] | ||
* @LastEditTime: 2023-02-28 23:32:58 | ||
* @Description: file description | ||
*/ | ||
import { ComponentPropsWithRef } from 'react'; | ||
import { MobileHeaderWrapper } from '@/components/layout/mobile/MobileHeaderCommon'; | ||
|
||
export default function FavMobileHeader(props: ComponentPropsWithRef<'div'>) { | ||
return <MobileHeaderWrapper {...props}>My Favorites</MobileHeaderWrapper>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters