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

Reappear the disappeared Exit button. #485

Merged
merged 1 commit into from
Feb 23, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
import { memo } from '@wordpress/element';
import { Fill } from '@wordpress/components';
import { useLocation } from 'react-router-dom';

import HeaderEnd from './HeaderEnd';
import { HEADER_END, HEADER_SITEBUILD } from '../../../../../constants';
import ExitToWordPress from '../../../ExitToWordPress';
import {
HEADER_START,
HEADER_END,
HEADER_SITEBUILD,
} from '../../../../../constants';
import { stepWelcome } from '../../../../steps/GetStarted/Welcome/step';

/**
* Interface header rendered into header render prop in <InterfaceSkeleton />.
*
* @return {WPComponent} Header
*/
const SiteBuildHeader = () => {
const location = useLocation();
const isGettingStarted = stepWelcome.path === location?.pathname;

return (
<Fill name={ `${ HEADER_SITEBUILD }/${ HEADER_END }` }>
<HeaderEnd />
</Fill>
<>
<Fill name={ `${ HEADER_SITEBUILD }/${ HEADER_START }` }>
{ isGettingStarted ? (
<ExitToWordPress origin="header-first-step" />
) : null }
</Fill>
<Fill name={ `${ HEADER_SITEBUILD }/${ HEADER_END }` }>
<HeaderEnd />
</Fill>
</>
);
};

Expand Down
Loading