Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mobile header style #625

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -4,15 +4,10 @@ import { cn } from '@/lib/utils';
import LoginButtonV2 from '@/components/layout/LoginButtonV2';
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 @@ -48,14 +43,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>
);
}