Skip to content

Commit 77c89b9

Browse files
author
Ives van Hoorne
committed
Create modal
1 parent ee5d8fa commit 77c89b9

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import styled from 'styled-components';
3+
4+
const Container = styled.div`
5+
background-color: ${props => props.theme.background};
6+
padding: 1rem;
7+
margin: 0;
8+
color: rgba(255, 255, 255, 0.8);
9+
`;
10+
11+
export default class Deploy extends React.PureComponent {
12+
render() {
13+
return <Container>Deploy</Container>;
14+
}
15+
}

src/app/pages/Sandbox/Editor/Content/Header/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import UserMenu from 'app/containers/UserMenu';
3232
import Preferences from 'app/containers/Preferences';
3333
import NewSandbox from 'app/containers/modals/NewSandbox';
3434

35-
import deploy from 'app/store/entities/sandboxes/utils/deploy';
35+
import Deployment from 'app/containers/Deployment';
3636

3737
import Action from './Action';
3838
import FeedbackView from './FeedbackView';
@@ -109,6 +109,12 @@ export default class Header extends React.PureComponent<Props> {
109109

110110
deploySandbox = () => {
111111
const { sandbox, sandboxActions } = this.props;
112+
113+
this.props.modalActions.openModal({
114+
width: 600,
115+
Body: <Deployment />,
116+
});
117+
112118
sandboxActions.deploy(sandbox.id);
113119
};
114120

src/app/store/entities/sandboxes/actions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export default {
359359
const data = await res.json();
360360

361361
if (!res.ok) {
362-
dispatch(notificationActions.addNotification(data.err.mesage, 'error'));
362+
dispatch(notificationActions.addNotification(data.err.message, 'error'));
363363
return;
364364
}
365365

src/app/store/entities/sandboxes/utils/deploy/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export default async function deploy(
3333
}
3434

3535
apiData.package = JSON.parse(apiData['package.json']);
36+
// We force the sandbox id, so ZEIT will always group the deployments to a
37+
// single sandbox
38+
apiData.package.name = sandbox.id;
3639
delete apiData['package.json'];
3740

3841
const template = getTemplate(sandbox.template);

0 commit comments

Comments
 (0)