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

(PC-33707)[PRO] feat: Footer on all onboarding pages. #15809

Merged
merged 1 commit into from
Jan 10, 2025
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: 4 additions & 2 deletions pro/src/app/App/layout/Layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ $connect-as-header-height: rem.torem(52px);
}

&-sticky-onboarding {
max-width: size.$main-content-width;
margin: 0 auto size.$action-bar-sticky-height auto;
padding: size.$main-content-padding;
padding: 0;
}
}

Expand Down Expand Up @@ -139,6 +138,9 @@ $connect-as-header-height: rem.torem(52px);
&-sticky-onboarding {
display: flex;
justify-content: center;
max-width: size.$main-content-width;
padding: size.$main-content-padding size.$main-content-padding 0;
margin: 0 auto;
}
}

Expand Down
17 changes: 11 additions & 6 deletions pro/src/app/App/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Layout = ({
children,
mainHeading,
layout = 'basic',
showFooter = layout !== 'funnel' && layout !== 'sticky-onboarding',
showFooter = layout !== 'funnel',
}: LayoutProps) => {
const currentUser = useSelector(selectCurrentUser)
const [lateralPanelOpen, setLateralPanelOpen] = useState(false)
Expand All @@ -61,10 +61,12 @@ export const Layout = ({
const mainHeadingWrapper = mainHeading && (
<div className={styles['main-heading-wrapper']}>
<h1 className={styles['main-heading-title']}>{mainHeading}</h1>
{isConnected && <BackToNavLink
isMobileScreen={isMobileScreen}
className={styles['main-heading-back-to-nav-link']}
/>}
{isConnected && (
<BackToNavLink
isMobileScreen={isMobileScreen}
className={styles['main-heading-back-to-nav-link']}
/>
)}
</div>
)

Expand Down Expand Up @@ -97,6 +99,7 @@ export const Layout = ({
)}
{(layout === 'basic' ||
layout === 'sticky-actions' ||
layout === 'onboarding' ||
layout === 'sticky-onboarding') && (
<Header
lateralPanelOpen={lateralPanelOpen}
Expand All @@ -107,7 +110,9 @@ export const Layout = ({
})
}}
ref={openButtonRef}
disableHomeLink={layout === 'sticky-onboarding'}
disableHomeLink={
layout === 'sticky-onboarding' || layout === 'onboarding'
}
/>
)}
<div
Expand Down
4 changes: 4 additions & 0 deletions pro/src/components/Footer/Footer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
height: size.$footer-height;
}

&-layout-sticky-onboarding {
margin-bottom: 0;
}

@media (min-width: size.$tablet) {
min-height: size.$footer-height;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const OnboardingOfferIndividual = (): JSX.Element => {
}

return (
<OnboardingLayout verticallyCentered showFooter={false}>
<OnboardingLayout verticallyCentered>
<h1 className={styles['offers-title']}>Offre à destination des jeunes</h1>
<h2 className={styles['offers-subtitle']}>
Comment souhaitez-vous créer votre 1ère offre ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const OnboardingOfferIndividualAutomatic = ({
const navigate = useNavigate()

return (
<OnboardingLayout showFooter={false}>
<OnboardingLayout>
<div className={cn(className)}>
<h1 className={styles['title']}>
Connecter mon logiciel de gestion des stocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from './OnboardingOffersTypeChoice.module.scss'

export const OnboardingOffersTypeChoice = () => {
return (
<OnboardingLayout verticallyCentered>
<OnboardingLayout verticallyCentered stickyActionsAndFooter={false}>
<div className={styles['onboarding-offer-container']}>
<div className={styles['onboarding-offer-header']}>
<h1 className={styles['onboarding-offer-header-title']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ import cn from 'classnames'
import { type ReactNode } from 'react'

import { Layout } from 'app/App/layout/Layout'
import { Header } from 'components/Header/Header'

import styles from './OnboardingLayout.module.scss'

interface OnboardingLayoutProps {
className?: string
showFooter?: boolean
verticallyCentered?: boolean
children: ReactNode
stickyActionsAndFooter?: boolean
}

export const OnboardingLayout = ({
className,
showFooter = true,
children,
verticallyCentered = false,
stickyActionsAndFooter = true,
}: OnboardingLayoutProps): JSX.Element => {
return (
<Layout layout="onboarding" showFooter={showFooter}>
<Header disableHomeLink={true} />
<Layout
layout={stickyActionsAndFooter ? 'sticky-onboarding' : 'onboarding'}
>
<div
className={cn(
styles[`onboarding-layout`],
Expand Down
Loading