Skip to content

Commit

Permalink
remove user signpost
Browse files Browse the repository at this point in the history
  • Loading branch information
henzigo committed Nov 11, 2024
1 parent 98aa7bb commit 1fd7a57
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 218 deletions.
3 changes: 0 additions & 3 deletions storefront/components/Blocks/Skeleton/SkeletonManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { SkeletonPageComparison } from './SkeletonPageComparison';
import { SkeletonPageConfirmation } from './SkeletonPageConfirmation';
import { SkeletonPageContact } from './SkeletonPageContact';
import { SkeletonPageContactInformation } from './SkeletonPageContactInformation';
import { SkeletonPageCustomerAccount } from './SkeletonPageCustomerAccount';
import { SkeletonPageCustomerChangePassword } from './SkeletonPageCustomerChangePassword';
import { SkeletonPageCustomerComplaintDetail } from './SkeletonPageCustomerComplaintDetail';
import { SkeletonPageCustomerComplaintList } from './SkeletonPageCustomerComplaintList';
Expand Down Expand Up @@ -84,8 +83,6 @@ export const SkeletonManager: FC<SkeletonManagerProps> = ({
return <SkeletonPageContact />;
case 'contact-information':
return <SkeletonPageContactInformation />;
case 'account':
return <SkeletonPageCustomerAccount />;
case 'complaintNew':
return <SkeletonPageCustomerComplaintNew />;
case 'complaintDetail':
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerChangePassword: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={3} />
<SkeletonModuleBreadcrumbs count={2} />

<SkeletonModuleCustomerChangePassword />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerComplaintDetail: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={4} />
<SkeletonModuleBreadcrumbs count={3} />

<SkeletonModuleCustomerComplaintDetail />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerComplaintList: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={3} />
<SkeletonModuleBreadcrumbs count={2} />

<SkeletonModuleCustomerComplaintList />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerComplaintNew: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={4} />
<SkeletonModuleBreadcrumbs count={3} />

<SkeletonModuleCustomerComplaintNew />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerEditProfile: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={3} />
<SkeletonModuleBreadcrumbs count={2} />

<SkeletonModuleCustomerEditProfile />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerOrderDetail: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={4} />
<SkeletonModuleBreadcrumbs count={3} />

<SkeletonModuleCustomerOrderDetail />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerOrderList: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={3} />
<SkeletonModuleBreadcrumbs count={2} />

<SkeletonModuleCustomerOrderList />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Webline } from 'components/Layout/Webline/Webline';

export const SkeletonPageCustomerUsers: FC = () => (
<Webline>
<SkeletonModuleBreadcrumbs count={3} />
<SkeletonModuleBreadcrumbs count={2} />

<SkeletonModuleCustomerUsers />
</Webline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ExtendedNextLink } from 'components/Basic/ExtendedNextLink/ExtendedNext
import { ArrowIcon } from 'components/Basic/Icon/ArrowIcon';
import { ExitIcon } from 'components/Basic/Icon/ExitIcon';
import { Button } from 'components/Forms/Button/Button';
import { TIDs } from 'cypress/tids';
import { m } from 'framer-motion';
import useTranslation from 'next-translate/useTranslation';
import { useRouter } from 'next/router';
Expand All @@ -13,7 +14,7 @@ import { useUserMenuItems } from 'utils/user/useUserMenuItems';

const getMenuItemTwClass = (menuItemLink?: string, asPath?: string) =>
twJoin(
'border-b border-borderAccent last:border-none no-underline px-4 py-3 flex justify-between gap-4 text-sm',
'border-b border-borderAccent last:border-none no-underline px-4 py-3 flex gap-4 text-sm',
menuItemLink && asPath?.includes(menuItemLink)
? 'bg-backgroundAccentLess text-textAccent hover:text-textAccent'
: 'bg-backgroundMore text-text hover:text-textAccent',
Expand All @@ -30,7 +31,7 @@ export const UserNavigation: FC = () => {
<div className="flex h-fit min-w-[300px] flex-col overflow-hidden rounded-xl">
<button
className={twJoin(
'flex items-center justify-between gap-4 bg-backgroundMore px-6 py-3 no-underline last:border-none lg:hidden',
'flex items-center gap-4 bg-backgroundMore px-6 py-3 no-underline last:border-none lg:hidden',
isExpanded && 'border-b border-borderAccent',
)}
onClick={() => setIsExpanded((prev) => !prev)}
Expand Down Expand Up @@ -67,9 +68,10 @@ export const UserNavigation: FC = () => {
</ExtendedNextLink>
))}
<Button
tid={TIDs.customer_page_logout}
className={twJoin(
getMenuItemTwClass(),
'font-primary bg-transparent !px-4 text-sm font-normal leading-5 !text-text !outline-none hover:bg-transparent hover:text-textAccent hover:underline',
'font-primary justify-start bg-transparent !px-4 text-sm font-normal leading-5 !text-text !outline-none hover:bg-transparent hover:text-textAccent hover:underline',
)}
onClick={logoutHandler}
>
Expand Down
15 changes: 1 addition & 14 deletions storefront/components/Layout/CustomerLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,19 @@ import { UserNavigation } from 'components/Blocks/UserNavigation/UserNavigation'
import { Breadcrumbs } from 'components/Layout/Breadcrumbs/Breadcrumbs';
import { CommonLayout, CommonLayoutProps } from 'components/Layout/CommonLayout';
import { Webline } from 'components/Layout/Webline/Webline';
import { useDomainConfig } from 'components/providers/DomainConfigProvider';
import useTranslation from 'next-translate/useTranslation';
import { useIsUserLoggedIn } from 'utils/auth/useIsUserLoggedIn';
import { getInternationalizedStaticUrls } from 'utils/staticUrls/getInternationalizedStaticUrls';

type CustomerLayoutProps = {
pageHeading?: string;
} & CommonLayoutProps;

export const CustomerLayout: FC<CustomerLayoutProps> = ({ pageHeading, children, breadcrumbs, ...props }) => {
const isUserLoggedIn = useIsUserLoggedIn();
const { url } = useDomainConfig();
const { t } = useTranslation();
const [customerUrl] = getInternationalizedStaticUrls(['/customer'], url);

return (
<CommonLayout {...props}>
<Webline>
<Breadcrumbs
key="breadcrumb"
type={props.breadcrumbsType}
breadcrumbs={[
{ __typename: 'Link', name: t('Customer'), slug: customerUrl },
...(breadcrumbs ?? []),
]}
/>
<Breadcrumbs key="breadcrumb" breadcrumbs={breadcrumbs ?? []} type={props.breadcrumbsType} />
</Webline>
<Webline className="mt-8 flex flex-col gap-6 lg:mt-4 lg:flex-row vl:mt-12">
<UserNavigation />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ import { MenuIconicItemUserAuthenticatedContent } from './MenuIconicItemUserAuth
import { Drawer } from 'components/Basic/Drawer/Drawer';
import { UserIcon } from 'components/Basic/Icon/UserIcon';
import { Overlay } from 'components/Basic/Overlay/Overlay';
import { useDomainConfig } from 'components/providers/DomainConfigProvider';
import { TIDs } from 'cypress/tids';
import useTranslation from 'next-translate/useTranslation';
import { useState } from 'react';
import { desktopFirstSizes } from 'utils/mediaQueries';
import { getInternationalizedStaticUrls } from 'utils/staticUrls/getInternationalizedStaticUrls';
import { twMergeCustom } from 'utils/twMerge';
import { useGetWindowSize } from 'utils/ui/useGetWindowSize';
import { useDebounce } from 'utils/useDebounce';

export const MenuIconicItemUserAuthenticated: FC = () => {
const { t } = useTranslation();
const { url } = useDomainConfig();
const [customerUrl] = getInternationalizedStaticUrls(['/customer'], url);
const [isClicked, setIsClicked] = useState(false);
const [isHovered, setIsHovered] = useState(false);
const isHoveredDelayed = useDebounce(isHovered, 200);
Expand All @@ -33,7 +29,7 @@ export const MenuIconicItemUserAuthenticated: FC = () => {
onMouseLeave={() => isDesktop && setIsHovered(false)}
>
<MenuIconicItemLink
className="text-nowrap rounded-t transition-all cursor-pointer max-lg:hidden"
className="cursor-pointer text-nowrap rounded-t transition-all max-lg:hidden"
type="account"
>
<div className="relative">
Expand Down
107 changes: 0 additions & 107 deletions storefront/components/Pages/Customer/CustomerContent.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion storefront/cypress/e2e/authentication/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Login Tests', () => {
blackout: [{ tid: TIDs.banners_slider }, { tid: TIDs.simple_navigation_image }],
});

cy.visitAndWaitForStableAndInteractiveDOM(url.customer.index);
cy.visitAndWaitForStableAndInteractiveDOM(url.customer.orders);
logoutFromCustomerPage();
checkAndHideSuccessToast('Successfully logged out');
checkUrl(url.loginWithCustomerRedirect);
Expand Down
1 change: 0 additions & 1 deletion storefront/cypress/fixtures/demodata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export const url = {
login: '/login',
loginWithCustomerRedirect: '/login?r=customer',
customer: {
index: '/customer',
orders: '/customer/orders',
editProfile: '/customer/edit-profile',
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 0 additions & 45 deletions storefront/pages/customer.tsx

This file was deleted.

1 change: 0 additions & 1 deletion storefront/public/locales/cs/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"Creation date": "Datum objednávky",
"Current password": "Současné heslo",
"Currently, it is not possible to purchase any variant of this product.": "Aktuálně není možné koupit ani jednu variantu produktu.",
"Customer": "Zákazník",
"Customer information": "Informace o zákazníkovi",
"Customer is already registered.": "Zákazník je již registrován.",
"Customer users": "Uživatelé",
Expand Down
1 change: 0 additions & 1 deletion storefront/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"Creation date": "Creation date",
"Current password": "Current password",
"Currently, it is not possible to purchase any variant of this product.": "Currently, it is not possible to purchase any variant of this product.",
"Customer": "Customer",
"Customer information": "Customer information",
"Customer is already registered.": "Customer is already registered.",
"Customer users": "Users",
Expand Down
Loading

0 comments on commit 1fd7a57

Please sign in to comment.