Skip to content

Commit

Permalink
Merge pull request #485 from newfold-labs/fix/exit-to-wordpress-missi…
Browse files Browse the repository at this point in the history
…ng-in-sitegen

Reappear the disappeared Exit button.
  • Loading branch information
arunshenoy99 authored Feb 23, 2024
2 parents b2cfef6 + 27d3955 commit 5e57426
Showing 1 changed file with 21 additions and 4 deletions.
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

0 comments on commit 5e57426

Please sign in to comment.