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 22 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 '../../SiteGenSPA/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
5 changes: 3 additions & 2 deletions src/OnboardingSPA/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { trigger as cronTrigger } from './utils/api/cronTrigger';
import { initialize as initializeSettings } from './utils/api/settings';
import { DESIGN_STEPS_THEME } from '../constants';

import App from './components/App';
// import App from './components/App';
import AppSiteGen from '../SiteGenSPA/components/AppSiteGen';
import { HashRouter } from 'react-router-dom';
import { dispatch } from '@wordpress/data';
import { render } from '@wordpress/element';
Expand All @@ -21,7 +22,7 @@ import { stateToStore } from './chapters/utils';
*/
const NFDOnboarding = () => (
<HashRouter>
<App />
<AppSiteGen />
officiallygod marked this conversation as resolved.
Show resolved Hide resolved
</HashRouter>
);

Expand Down
Binary file added src/OnboardingSPA/static/images/user-avatar.png
ajayadav09 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/SiteGenSPA/components/AdminBarSiteGen/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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">
<span>
{ __( 'Howdy!', 'wp-module-onboarding' ) }, Maya Jiménez
</span>
</span>
<div className="nfd-admin-bar-avatar"></div>
</div>
</div>
);
};

export default AdminBarSiteGen;
47 changes: 47 additions & 0 deletions src/SiteGenSPA/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;
}
}
}
}
80 changes: 80 additions & 0 deletions src/SiteGenSPA/components/Animate/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import classNames from 'classnames';

/**
* @param {Object} props The properties passed to the Animate function.
* @param {string} props.type The name of Animation to be shown.
* @param {object | boolean} props.after The variable to look after for before showing the animation, by default true to show the children right away.
* @param {Object} props.children The children of the component.
* @param {string} props.className The optional class name for the animation.
* @param {boolean} props.duration The duration for the animation.
* @param {boolean} props.timingFunction The timing function for the animation.
*/

const Animate = ( {
type,
after = true,
children,
className = '',
duration = false,
timingFunction = false,
} ) => {
const prefix = 'animate';

/**
* Returns the appropriate className
*
* @return {string | void} ClassName that applies the animations
*/
function getAnimateClassName() {
if ( type ) {
let classname = '';
switch ( type ) {
// Add animation types and appropriate CSS
case 'fade-in':
classname = prefix.concat( '__fade-in' );
break;
case 'fade-in-disabled':
classname = prefix.concat( '__fade-in--disabled' );
break;
case 'fade-in-right':
classname = prefix.concat( '__fade-in--right' );
break;
case 'fade-in-left':
classname = prefix.concat( '__fade-in--left' );
break;
case 'fade-in-up':
classname = prefix.concat( '__fade-in--up' );
break;
case 'shine':
classname = prefix.concat( '__shine' );
break;
case 'shine-placeholder':
classname = prefix.concat( '__shine--placeholder' );
break;
case 'dropdown':
classname = prefix.concat( '__dropdown' );
break;
case 'load':
classname = prefix.concat( '__load' );
break;
}
return classname;
}
}

return ! after ? (
<div className={ `${ prefix }__blank` }>{ children }</div>
) : (
<div
className={ classNames( getAnimateClassName(), className ) }
style={ {
animationDuration: duration,
animationTimingFunction: timingFunction,
} }
>
{ children }
</div>
);
};

export default Animate;
170 changes: 170 additions & 0 deletions src/SiteGenSPA/components/Animate/stylesheet.scss
ajayadav09 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
@keyframes fadeIn {

from {
opacity: 0;
}

to {
opacity: 1;
}
}


@keyframes fadeInRight {

from {
opacity: 0;
transform: translate3d(33%, 0, 0);
}

to {
opacity: 1;
transform: translate3d(0, 0, 0);
}
}

@keyframes fadeInLeft {

from {
opacity: 0;
transform: translate3d(-33%, 0, 0);
}

to {
opacity: 1;
transform: translate3d(0, 0, 0);
}
}

@keyframes fadeInUp {

from {
opacity: 0;
transform: translate3d(0, 33%, 0);
}

to {
opacity: 1;
transform: translate3d(0, 0, 0);
}
}

@keyframes fadeInWithDisabledClicks {

from {
opacity: 0;
pointer-events: none;
}

to {
opacity: 1;
}
}

@keyframes shine {

0% {
transform: translateX(-100%);
}

100% {
transform: translateX(100%);
}
}

@keyframes shine-placeholder {

0% {
background-position: -468px 0;
}

100% {
background-position: 468px 0;
}
}

@keyframes dropdown {

0% {
transform: rotateX(-90deg);
}

70% {
transform: rotateX(20deg);
}

100% {
transform: rotateX(0deg);
}
}

@keyframes load {

0% {
left: -100%;
}

100% {
left: 100%;
}
}

.animate {

&__blank {
opacity: 0;
pointer-events: none;
}

&__shine {
animation: shine 1.5s linear infinite;

&--placeholder {
animation: shine-placeholder 1.5s linear infinite;
}
}

&__dropdown {
animation: dropdown 400ms ease-in-out forwards;
}

&__fade-in {

animation: fadeIn 100ms ease-in-out;

&--disabled {
animation: fadeInWithDisabledClicks 500ms ease-in;
}

&--right {
animation: fadeInRight 360ms ease-out;

@media (prefers-reduced-motion) {
animation: none !important;
translate: none !important;
}
}

&--left {
animation: fadeInLeft 360ms ease-out;

@media (prefers-reduced-motion) {
animation: none !important;
translate: none !important;
}
}

&--up {
animation: fadeInUp 360ms ease-out;

@media (prefers-reduced-motion) {
animation: none !important;
translate: none !important;
}
}
}

&__load {
animation: load 3s linear infinite;
}
}
Loading