Skip to content

Commit 0872afb

Browse files
author
Luke Frauhiger
authored
Merge pull request #220 from moderntribe/ftc-wizard
FTC wizard & error page
2 parents 8d2caa9 + b1d3542 commit 0872afb

34 files changed

+397
-73
lines changed

.changeset/real-coins-accept.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/serious-ladybugs-do.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/twenty-needles-sort.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/site-settings/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @moderntribe/sitedetails
22

3+
## 1.0.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b01e5af]
8+
- Updated dependencies [81f8d17]
9+
- @moderntribe/wme-ui@3.1.0
10+
311
## 1.0.0
412

513
### Major Changes

packages/site-settings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@moderntribe/site-settings",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Site settings foundation",
55
"source": "src/index.tsx",
66
"main": "dist/umd/index.js",

packages/sitebuilder/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @moderntribe/sitebuilder
22

3+
## 3.0.0
4+
5+
### Major Changes
6+
7+
- 81f8d17: The FTC Wizard now can be completed and will gather all required data from the user
8+
9+
### Patch Changes
10+
11+
- Updated dependencies [b01e5af]
12+
- Updated dependencies [81f8d17]
13+
- @moderntribe/wme-ui@3.1.0
14+
315
## 2.0.1
416

517
### Patch Changes

packages/sitebuilder/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@moderntribe/sitebuilder",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"description": "SiteBuilder foundation",
55
"source": "src/index.tsx",
66
"main": "dist/umd/index.js",
@@ -11,7 +11,7 @@
1111
],
1212
"scripts": {
1313
"build": "rollup --config node:@moderntribe/rollup-config --environment NODE_ENV:production",
14-
"dev": "rollup --config node:@moderntribe/rollup-config --watch",
14+
"dev": "rollup --config node:@moderntribe/rollup-config",
1515
"lint": "eslint . --ext ts,tsx",
1616
"lint:fix": "eslint . --fix --ext ts,tsx",
1717
"test": "echo \"Error: no test specified\" && exit 1"

packages/sitebuilder/src/components/Frame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Frame = ({ children }: ChildrenProps) => {
1515
boxShadow: currentStep === 1 ? 'none' : '0px 0px 32px 0px #0000001a',
1616
alignSelf: 'center',
1717
margin: '0px auto',
18-
width: activeDevice === 'desktop' ? '100%' : 'auto',
18+
width: activeDevice.breakpoint === 'desktop' ? '100%' : 'auto',
1919
height: '100%',
2020
};
2121

packages/sitebuilder/src/components/ModalDeviceSelection.tsx

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,30 @@ import { Box, SvgIcon } from '@mui/material';
22
import { DesktopWindows, TabletMac, PhoneIphone } from '@mui/icons-material';
33
import { useWizard } from '@sb/hooks';
44

5-
interface DevicesInterface {
6-
desktop: typeof SvgIcon;
7-
tablet: typeof SvgIcon;
8-
mobile: typeof SvgIcon;
5+
export interface DeviceInterface {
6+
icon: typeof SvgIcon;
7+
width: string;
8+
}
9+
10+
export interface DevicesInterface {
11+
desktop: DeviceInterface;
12+
tablet: DeviceInterface;
13+
mobile: DeviceInterface;
914
}
1015

1116
const devices:DevicesInterface = {
12-
desktop: DesktopWindows,
13-
tablet: TabletMac,
14-
mobile: PhoneIphone,
17+
desktop: {
18+
icon: DesktopWindows,
19+
width: '100%',
20+
},
21+
tablet: {
22+
icon: TabletMac,
23+
width: '768px',
24+
},
25+
mobile: {
26+
icon: PhoneIphone,
27+
width: '480px',
28+
},
1529
};
1630

1731
const deviceSx = {
@@ -26,22 +40,32 @@ const deviceSx = {
2640
}
2741
};
2842

43+
const wrapperSx = {
44+
display: 'flex',
45+
alignItems: 'center',
46+
justifyContent: 'center',
47+
zIndex: 1,
48+
};
49+
2950
export const ModalDeviceSelection = () => {
3051
const { setActiveDevice, wizardState: { activeDevice } } = useWizard();
3152

32-
const handleDeviceClick = (nextDevice: string) => {
33-
if (nextDevice === activeDevice) {
53+
const handleDeviceClick = (nextDevice: keyof DevicesInterface) => {
54+
if (nextDevice === activeDevice.breakpoint) {
3455
return;
3556
}
36-
setActiveDevice(nextDevice);
57+
setActiveDevice({
58+
breakpoint: nextDevice,
59+
width: devices[ nextDevice ].width
60+
});
3761
};
3862

39-
return <Box sx={ { display: 'flex', alignItems: 'center' } }>
40-
{ (Object.keys(devices) as Array<keyof typeof devices>).map((key) => {
41-
const DeviceName = devices[ key ];
63+
return <Box sx={ wrapperSx }>
64+
{ (Object.keys(devices) as Array<keyof typeof devices>).map((key: keyof DevicesInterface) => {
65+
const DeviceName = devices[ key ].icon;
4266
return <DeviceName
4367
key={ key }
44-
sx={ activeDevice === key ? deviceSx.active : deviceSx.default }
68+
sx={ activeDevice.breakpoint === key ? deviceSx.active : deviceSx.default }
4569
onClick={ () => handleDeviceClick(key) }
4670
/>;
4771
}) }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Box } from '@mui/material';
2+
3+
const ErrorScreenWrapper = {
4+
position: 'fixed',
5+
top: '0',
6+
left: '0',
7+
width: '100vw',
8+
height: '100vh',
9+
display: 'flex',
10+
justifyContent: 'center',
11+
alignItems: 'center',
12+
backgroundColor: '#fff',
13+
zIndex: 15
14+
};
15+
16+
export const NotificationOverlay = (props: { children: React.ReactNode }) => {
17+
const { children } = props;
18+
19+
return <Box sx={ ErrorScreenWrapper }>{ children }</Box>;
20+
};

0 commit comments

Comments
 (0)