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

Press2 1233 new modern layout component #338

Closed
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
56108ad
PRESS2-1233 | creating structure from newfold-skeleton
Oct 17, 2023
fcf7faa
PRESS2-1233 | updated progress bar
Oct 17, 2023
4b60a35
PRESS2-1233 | added toggle
Oct 18, 2023
c491ebb
PRESS2-1233 | added a step
Oct 18, 2023
7203e70
PRESS2-1233
Oct 18, 2023
f5c16db
PRESS2-1233
Oct 18, 2023
b13edd5
PRESS2-1233 fixed linting issues
Oct 20, 2023
11ad03a
PRESS2-1233 | fixed PR comments
Oct 23, 2023
0c4f25a
PRESS2-1233 | fixed linting changes
Oct 23, 2023
00be88d
PRESS2-1233 | fixed style lint
Oct 23, 2023
1271c05
Merge branch 'trunk' of https://github.com/newfold-labs/wp-module-onb…
Oct 25, 2023
92c2b3f
PRESS-1233 | added sitegen to directory
Oct 25, 2023
04cb644
PRESS2-1233 | fixed comments
Oct 25, 2023
f1d893e
PRESS2-1233 | fixed styling
Oct 25, 2023
ecb1d0d
PRESS2-1233 | linting issues
Oct 25, 2023
c41ea1f
PRESS2-1233 | WIP adding styles and static iamges
Oct 26, 2023
e8b8fde
PRESS2-1233 | fixed changes
Oct 26, 2023
2a4acaf
PRESS2-1233 | added theme provider for theme toggle
Oct 27, 2023
8c29637
PRESS2-1233 | fixed linting issues
Oct 27, 2023
af5371e
PRESS2-1233 | fixed indentation
Oct 27, 2023
d4bcb7c
PRESS2-1233 | fixed indentation
Oct 27, 2023
87004bc
PRESS2-1233 | deleted image from static
Oct 27, 2023
042dce7
PRESS2-1233 | added common components
Oct 30, 2023
167d9bb
PRESS2-1233 | fixed linting
Oct 30, 2023
475867f
PRESS2-1233 | fixed linting
Oct 30, 2023
f2b58b1
PRESS2-1233 | toggle in footer
Oct 30, 2023
3730377
PRESS2-1233 | added shared directory for common components
Oct 31, 2023
cc073eb
PRESS2-1233 | fixed linting
Oct 31, 2023
7c1b21b
PRESS2-1233 | fixed linting
Oct 31, 2023
84b4737
changes for design studio
Nov 7, 2023
14eb9e7
Merge branch 'enhance/ai-onboarding' of https://github.com/newfold-la…
Nov 8, 2023
3e5b0e0
PRESS2-1233 | merged changes
Nov 9, 2023
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
2 changes: 2 additions & 0 deletions src/OnboardingSPA/chapters/demographic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { stepExperience } from '../steps/GetStarted/GetStartedExperience/step';
import { stepPrimarySetup } from '../steps/GetStarted/SiteTypeSetup/PrimarySite/step';
import { stepSecondarySetup } from '../steps/GetStarted/SiteTypeSetup/SecondarySite/step';
import { stepTopPriority } from '../steps/TopPriority/step';
import { stepSiteGenGetStarted } from '../steps/SiteGenGetStarted/step';
import { Chapter } from '../data/models/Chapter';
import { Step } from '../data/models/Step';
import ChapterInterstitialLoader from '../components/Loaders/Chapter/Interstitial';
Expand All @@ -22,6 +23,7 @@ const steps = [
stepSecondarySetup,
stepBasicInfo,
stepTopPriority,
stepSiteGenGetStarted,
];

export const demographic = new Chapter( {
Expand Down
21 changes: 21 additions & 0 deletions src/OnboardingSPA/components/AdminBarSiteGen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { __ } from '@wordpress/i18n';
import { Icon, wordpress } from '@wordpress/icons';

const AdminBarSiteGen = () => {
return (
<div className="nfd-sitegen-admin-bar">
<div className="nfd-admin-bar-wplogo">
<Icon icon={ wordpress } />
<span>{ __( 'WordPress', 'wp-module-onboarding' ) }</span>
</div>
<div className="nfd-sitegen-admin-bar-profile">
<span className="nfd-admin-bar-greeting">
Howdy, Maya Jiménez
ajayadav09 marked this conversation as resolved.
Show resolved Hide resolved
</span>
<div className="nfd-admin-bar-avatar"></div>
</div>
</div>
);
};

export default AdminBarSiteGen;
47 changes: 47 additions & 0 deletions src/OnboardingSPA/components/AdminBarSiteGen/stylesheet.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
$light-grey : #a0a5aa;

.nfd-interface-interface-skeleton__adminbar {

.nfd-sitegen-admin-bar {
padding: 5px;
background-color: #23282d; // Dark grayish background
display: flex;
justify-content: space-between;
align-items: center;

.nfd-admin-bar-wplogo {
color: var(--nfd-onboarding-white);
font-size: 16px;
display: flex;
align-items: center;

svg {
color: $light-grey;
fill: $light-grey;
}

span {
margin-left: 15px;
}
}

.nfd-sitegen-admin-bar-profile {
display: flex;
align-items: center;

.nfd-admin-bar-greeting {
color: $light-grey;
font-size: 16px;
margin-right: 5px;
}

.nfd-admin-bar-avatar {
height: 20px;
width: 20px;
display: inline-block;
background-image: var(--adminbar-avatar-img);
background-size: contain;
}
}
}
}
48 changes: 48 additions & 0 deletions src/OnboardingSPA/components/AppSiteGen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Content from '../Content';
import HeaderSiteGen from '../HeaderSiteGen';
import ToggleDarkMode from '../ToggleDarkMode';
import AdminBarSiteGen from '../AdminBarSiteGen';
import ProgressBarSiteGen from '../ProgressBarSiteGen';
import classNames from 'classnames';
import { useLocation } from 'react-router-dom';

// eslint-disable-next-line import/no-extraneous-dependencies
import { kebabCase } from 'lodash';
import { useViewportMatch } from '@wordpress/compose';
import { SlotFillProvider } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import { FullscreenMode } from '@wordpress/interface';
import SiteGenInterfaceSkeleton from '../SiteGenInterfaceSkeleton';

const AppSiteGen = () => {
const location = useLocation();
const isLargeViewport = useViewportMatch( 'medium' );
const pathname = kebabCase( location.pathname );

return (
<Fragment>
<FullscreenMode isActive={ true } />
<SlotFillProvider>
<SiteGenInterfaceSkeleton
className={ classNames(
'nfd-onboarding-skeleton',
ajayadav09 marked this conversation as resolved.
Show resolved Hide resolved
'nfd-sitegen-skeleton',
`brand-sitegen`,
`path-${ pathname }`,
{ 'is-large-viewport': isLargeViewport },
{ 'is-small-viewport': ! isLargeViewport }
) }
adminbar={ <AdminBarSiteGen /> }
progressbar={
<ProgressBarSiteGen current={ 20 } total={ 100 } />
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do the percent calc inside the component itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this is just for representation. we will need to pass the necessary data (current value and total value) as props to the component. Then, we can perform the calculation within the component itself

header={ <HeaderSiteGen /> }
content={ <Content /> }
darkModeToggle={ <ToggleDarkMode /> }
/>
</SlotFillProvider>
</Fragment>
);
};

export default AppSiteGen;
22 changes: 22 additions & 0 deletions src/OnboardingSPA/components/HeaderSiteGen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { memo } from '@wordpress/element';
import { Button } from '@wordpress/components';
import { Icon, chevronLeft } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';

const HeaderSiteGen = () => {
return (
<div className="nfd-sitegen-header">
<div className="nfd-sitegen-header__step-navigation">
<Button
className="navigation-buttons navigation-buttons_back"
variant="secondary"
>
<Icon icon={ chevronLeft } />
{ __( 'Back', 'wp-module-onboarding' ) }
</Button>
</div>
</div>
);
};

export default memo( HeaderSiteGen );
81 changes: 81 additions & 0 deletions src/OnboardingSPA/components/HeaderSiteGen/stylesheet.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.nfd-sitegen-header {
align-items: center;
background-color: var(--nfd-onboarding-header-base);
color: var(--nfd-onboarding-header-contrast);

h2,
h3,
h4 {
color: var(--nfd-onboarding-header-contrast);
}
display: flex;
height: 60px;
box-sizing: border-box;
width: 100%;
justify-content: space-between;

padding-right: $grid-unit-20;

body.is-fullscreen-mode & {
padding-left: 25px;
transition: padding-left 20ms linear;
transition-delay: 80ms;

@include reduce-motion("transition");
}

&__start,
&__end {
display: flex;
}

&__start {
align-items: center;
margin-left: $grid-unit-20;
}

&__center {
display: flex;
align-items: center;
height: 100%;
flex-grow: 1;
justify-content: center;
min-width: 5px;
font-weight: 600;
font-size: 20px;
line-height: $grid-unit-30;

svg {
margin-right: $grid-unit-10;
}
}

&__end {
justify-content: flex-end;
}

&__step-navigation {
display: flex;
column-gap: $grid-unit-10;
}
}

.navigation-buttons {
font-size: 14px;
line-height: 40px;
align-items: center;
letter-spacing: 0.8px;
display: flex !important;
justify-content: space-evenly;
border-radius: 2px !important;
padding: 20px 14px !important;

&_back {
padding-right: 22px !important;
}

@media screen and (max-width: #{ ($break-medium) }) {
font-size: 13px;
padding: 15px 10px !important;
}
}
15 changes: 15 additions & 0 deletions src/OnboardingSPA/components/ProgressBarSiteGen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const ProgressBarSiteGen = ( { current, total } ) => {
const percentage = ( current / total ) * 100;
return (
<div className="nfd-progress-bar-site-gen">
ajayadav09 marked this conversation as resolved.
Show resolved Hide resolved
<div className="nfd-progress-bar-container">
<div
className="nfd-progress-bar-fill"
style={ { width: `${ percentage }%` } }
></div>
</div>
</div>
);
};

export default ProgressBarSiteGen;
19 changes: 19 additions & 0 deletions src/OnboardingSPA/components/ProgressBarSiteGen/stylesheet.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$sitegen-progress-blue: #3620f8;
$sitegen-progress-grey: #32373e;

.nfd-progress-bar-site-gen {
width: 100%;

.nfd-progress-bar-container {
background-color: $sitegen-progress-grey;
height: 15px;
width: 100%;
border-radius: 0;
overflow: hidden;
}

.nfd-progress-bar-fill {
background-color: $sitegen-progress-blue;
height: 100%;
}
}
Loading