Skip to content

Commit 98e5316

Browse files
author
Ives van Hoorne
committed
Download function
1 parent 7c58d34 commit 98e5316

File tree

7 files changed

+2074
-259
lines changed

7 files changed

+2074
-259
lines changed

config/webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ const config = {
8484
test: /\.css$/,
8585
loaders: ['style-loader', 'css-loader'],
8686
},
87+
// For importing README.md
88+
{
89+
test: /\.md$/,
90+
loader: 'raw-loader',
91+
},
8792
// "file" loader makes sure those assets get served by WebpackDevServer.
8893
// When you `import` an asset, you get its (virtual) filename.
8994
// In production, they would get copied to the `build` folder.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"postcss-loader": "^1.2.1",
5050
"prettier": "0.21.0",
5151
"promise": "7.1.1",
52+
"raw-loader": "^0.5.1",
5253
"react-hot-loader": "^3.0.0-beta.6",
5354
"recursive-readdir": "^2.1.0",
5455
"rimraf": "^2.6.1",
@@ -69,10 +70,12 @@
6970
"color": "^0.11.4",
7071
"cssnano": "^3.10.0",
7172
"debug": "^2.5.1",
73+
"file-saver": "^1.3.3",
7274
"glamor": "^2.20.12",
7375
"gulp": "^3.9.1",
7476
"gulp-postcss": "^6.4.0",
7577
"humps": "CompuIves/humps",
78+
"jszip": "^3.1.3",
7679
"lodash": "^4.17.2",
7780
"moment": "^2.17.1",
7881
"normalize.css": "^5.0.0",

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ export default class Header extends React.PureComponent {
108108
sandboxActions.massUpdateModules(sandbox.id);
109109
};
110110

111+
zipSandbox = () => {
112+
const { sandbox, sandboxActions } = this.props;
113+
sandboxActions.createZip(sandbox.id);
114+
};
115+
111116
forkSandbox = () => {
112117
const { sandbox, sandboxActions } = this.props;
113118

@@ -147,7 +152,7 @@ export default class Header extends React.PureComponent {
147152
title="Save"
148153
Icon={Save}
149154
/>
150-
<Action title="Download" Icon={Download} placeholder="Coming soon!" />
155+
<Action title="Download" Icon={Download} onClick={this.zipSandbox} />
151156
<Action title="Import" Icon={Import} placeholder="Coming soon!" />
152157
</Left>
153158

src/app/store/entities/sandboxes/README.md

Lines changed: 1623 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)