Skip to content

Commit

Permalink
Merge pull request #625 from us3r-network/F-reconstructProfile-bufan
Browse files Browse the repository at this point in the history
fix mobile header style
  • Loading branch information
sin-bufan committed Mar 15, 2024
2 parents 46642f8 + 59ba7c3 commit be9e3fd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 31 deletions.
6 changes: 5 additions & 1 deletion apps/u3/src/container/fav/FavMobileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
import { ComponentPropsWithRef } from 'react';
import { MobileHeaderWrapper } from '@/components/layout/mobile/MobileHeaderCommon';
import LoginButtonV2Mobile from '@/components/layout/LoginButtonV2Mobile';
import SearchIconBtn from '@/components/layout/SearchIconBtn';

export default function FavMobileHeader(props: ComponentPropsWithRef<'div'>) {
return (
<MobileHeaderWrapper {...props}>
<div className="text-[#FFF] text-[16px] font-medium">My Favorites</div>
<LoginButtonV2Mobile />
<div className="flex items-center gap-[20px]">
<SearchIconBtn />
<LoginButtonV2Mobile />
</div>
</MobileHeaderWrapper>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
import { ComponentPropsWithRef } from 'react';
import { MobileHeaderWrapper } from '@/components/layout/mobile/MobileHeaderCommon';
import LoginButtonV2Mobile from '@/components/layout/LoginButtonV2Mobile';
import SearchIconBtn from '@/components/layout/SearchIconBtn';

export default function FavMobileHeader(props: ComponentPropsWithRef<'div'>) {
return (
<MobileHeaderWrapper {...props}>
<div className="text-[#FFF] text-[16px] font-medium">Notifications</div>
<LoginButtonV2Mobile />
<div className="flex items-center gap-[20px]">
<SearchIconBtn />
<LoginButtonV2Mobile />
</div>
</MobileHeaderWrapper>
);
}
2 changes: 1 addition & 1 deletion apps/u3/src/container/profile/ProfileLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function ProfileLayout() {
{/* Desktop */}
<div className="w-full h-full flex max-sm:hidden">
<div className="bg-[#1B1E23] w-[280px] h-full">
<ProfileMenu isSelf={isSelf} />
<ProfileMenu />
</div>
<div className="flex-1 h-full overflow-auto" id="profile-warper">
<Outlet
Expand Down
15 changes: 1 addition & 14 deletions apps/u3/src/container/profile/ProfileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ import { useLocation, useParams } from 'react-router-dom';
import { cn } from '@/lib/utils';
import NavLinkItem from '@/components/layout/NavLinkItem';

interface ProfileMenuProps extends ComponentPropsWithRef<'div'> {
isSelf: boolean;
}

export default function ProfileMenu({
isSelf,
className,
...props
}: ProfileMenuProps) {
}: ComponentPropsWithRef<'div'>) {
const { user } = useParams();
const { pathname } = useLocation();
const pathSuffix = user ? `/${user}` : '';
Expand Down Expand Up @@ -47,14 +42,6 @@ export default function ProfileMenu({
>
Activity
</NavLinkItem>
{isSelf && (
<NavLinkItem
href={`/u/fav${pathSuffix}`}
active={pathname === `/u/fav${pathSuffix}`}
>
Favorites
</NavLinkItem>
)}
{/* <NavLinkItem
href={`/u/asset${pathSuffix}`}
active={pathname === `/u/asset${pathSuffix}`}
Expand Down
21 changes: 7 additions & 14 deletions apps/u3/src/container/profile/ProfileMobileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,23 @@
* @Description: file description
*/
import { ComponentPropsWithRef } from 'react';
import { useLocation, useParams } from 'react-router-dom';
import {
MobileHeaderBackBtn,
MobileHeaderWrapper,
} from '@/components/layout/mobile/MobileHeaderCommon';
import LoginButtonV2Mobile from '@/components/layout/LoginButtonV2Mobile';
import SearchIconBtn from '@/components/layout/SearchIconBtn';

export default function ProfileMobileHeader(
props: ComponentPropsWithRef<'div'>
) {
const { pathname } = useLocation();
const { user } = useParams();
// const isPostsPath = pathname === '/u';
// const isContactsPath = pathname === '/u/contacts';
// const isActivityPath = pathname === '/u/activity';
const isFavPath = pathname === '/u/fav';

return (
<MobileHeaderWrapper {...props}>
{(() => {
if (isFavPath) {
return <MobileHeaderBackBtn title="My Favorites" />;
}
return <MobileHeaderBackBtn title={user || 'My Profile'} />;
})()}
<MobileHeaderBackBtn title="My Profile" />;
<div className="flex items-center gap-[20px]">
<SearchIconBtn />
<LoginButtonV2Mobile />
</div>
</MobileHeaderWrapper>
);
}

0 comments on commit be9e3fd

Please sign in to comment.