diff --git a/package.json b/package.json
index ff3634c..9f78c9a 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"blockly": "^3.20200625.2",
+ "file-saver": "^2.0.2",
"prismjs": "^1.20.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
diff --git a/public/media/1x1.gif b/public/media/blockly/1x1.gif
similarity index 100%
rename from public/media/1x1.gif
rename to public/media/blockly/1x1.gif
diff --git a/public/media/click.mp3 b/public/media/blockly/click.mp3
similarity index 100%
rename from public/media/click.mp3
rename to public/media/blockly/click.mp3
diff --git a/public/media/click.ogg b/public/media/blockly/click.ogg
similarity index 100%
rename from public/media/click.ogg
rename to public/media/blockly/click.ogg
diff --git a/public/media/click.wav b/public/media/blockly/click.wav
similarity index 100%
rename from public/media/click.wav
rename to public/media/blockly/click.wav
diff --git a/public/media/delete.mp3 b/public/media/blockly/delete.mp3
similarity index 100%
rename from public/media/delete.mp3
rename to public/media/blockly/delete.mp3
diff --git a/public/media/delete.ogg b/public/media/blockly/delete.ogg
similarity index 100%
rename from public/media/delete.ogg
rename to public/media/blockly/delete.ogg
diff --git a/public/media/delete.wav b/public/media/blockly/delete.wav
similarity index 100%
rename from public/media/delete.wav
rename to public/media/blockly/delete.wav
diff --git a/public/media/disconnect.mp3 b/public/media/blockly/disconnect.mp3
similarity index 100%
rename from public/media/disconnect.mp3
rename to public/media/blockly/disconnect.mp3
diff --git a/public/media/disconnect.ogg b/public/media/blockly/disconnect.ogg
similarity index 100%
rename from public/media/disconnect.ogg
rename to public/media/blockly/disconnect.ogg
diff --git a/public/media/disconnect.wav b/public/media/blockly/disconnect.wav
similarity index 100%
rename from public/media/disconnect.wav
rename to public/media/blockly/disconnect.wav
diff --git a/public/media/dropdown-arrow.svg b/public/media/blockly/dropdown-arrow.svg
similarity index 100%
rename from public/media/dropdown-arrow.svg
rename to public/media/blockly/dropdown-arrow.svg
diff --git a/public/media/handclosed.cur b/public/media/blockly/handclosed.cur
similarity index 100%
rename from public/media/handclosed.cur
rename to public/media/blockly/handclosed.cur
diff --git a/public/media/handdelete.cur b/public/media/blockly/handdelete.cur
similarity index 100%
rename from public/media/handdelete.cur
rename to public/media/blockly/handdelete.cur
diff --git a/public/media/handopen.cur b/public/media/blockly/handopen.cur
similarity index 100%
rename from public/media/handopen.cur
rename to public/media/blockly/handopen.cur
diff --git a/public/media/pilcrow.png b/public/media/blockly/pilcrow.png
similarity index 100%
rename from public/media/pilcrow.png
rename to public/media/blockly/pilcrow.png
diff --git a/public/media/quote0.png b/public/media/blockly/quote0.png
similarity index 100%
rename from public/media/quote0.png
rename to public/media/blockly/quote0.png
diff --git a/public/media/quote1.png b/public/media/blockly/quote1.png
similarity index 100%
rename from public/media/quote1.png
rename to public/media/blockly/quote1.png
diff --git a/public/media/sprites.png b/public/media/blockly/sprites.png
similarity index 100%
rename from public/media/sprites.png
rename to public/media/blockly/sprites.png
diff --git a/public/media/sprites.svg b/public/media/blockly/sprites.svg
similarity index 100%
rename from public/media/sprites.svg
rename to public/media/blockly/sprites.svg
diff --git a/src/actions/types.js b/src/actions/types.js
index 27bd18d..a086a29 100644
--- a/src/actions/types.js
+++ b/src/actions/types.js
@@ -5,6 +5,7 @@ export const MOVE_BLOCK = 'MOVE_BLOCK';
export const CHANGE_BLOCK = 'CHANGE_BLOCK';
export const DELETE_BLOCK = 'DELETE_BLOCK';
export const CLEAR_STATS = 'CLEAR_STATS';
+export const NAME = 'NAME';
export const TUTORIAL_SUCCESS = 'TUTORIAL_SUCCESS';
diff --git a/src/actions/workspaceActions.js b/src/actions/workspaceActions.js
index a9700c8..ab2d4e3 100644
--- a/src/actions/workspaceActions.js
+++ b/src/actions/workspaceActions.js
@@ -1,4 +1,4 @@
-import { NEW_CODE, CHANGE_WORKSPACE, CREATE_BLOCK, MOVE_BLOCK, CHANGE_BLOCK, DELETE_BLOCK, CLEAR_STATS } from './types';
+import { NEW_CODE, CHANGE_WORKSPACE, CREATE_BLOCK, MOVE_BLOCK, CHANGE_BLOCK, DELETE_BLOCK, CLEAR_STATS, NAME } from './types';
import * as Blockly from 'blockly/core';
@@ -72,3 +72,10 @@ export const clearStats = () => (dispatch) => {
payload: stats
});
};
+
+export const workspaceName = (name) => (dispatch) => {
+ dispatch({
+ type: NAME,
+ payload: name
+ })
+}
diff --git a/src/components/Blockly/BlocklyWindow.js b/src/components/Blockly/BlocklyWindow.js
index decce8d..b988186 100644
--- a/src/components/Blockly/BlocklyWindow.js
+++ b/src/components/Blockly/BlocklyWindow.js
@@ -63,8 +63,8 @@ class BlocklyWindow extends Component {
length: 1,
colour: '#4EAF47', // senseBox-green
snap: false
- }}
- media={'/media/'}
+ }}
+ media={'/media/blockly/'}
move={this.props.move !== undefined && !this.props.move ? {} :
{ // https://developers.google.com/blockly/guides/configure/web/move
scrollbars: true,
diff --git a/src/components/Breadcrumbs.js b/src/components/Breadcrumbs.js
index 71a57ea..dc0af20 100644
--- a/src/components/Breadcrumbs.js
+++ b/src/components/Breadcrumbs.js
@@ -1,27 +1,49 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
+import clsx from 'clsx';
-import Breadcrumbs from '@material-ui/core/Breadcrumbs';
+import { withStyles } from '@material-ui/core/styles';
+import MaterialUIBreadcrumbs from '@material-ui/core/Breadcrumbs';
import Typography from '@material-ui/core/Typography';
-class MyBreadcrumbs extends Component {
+import { faHome } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+const styles = (theme) => ({
+ home: {
+ color: theme.palette.secondary.main,
+ width: '20px !important',
+ height: '20px',
+ marginTop: '2px'
+ },
+ hover: {
+ '&:hover': {
+ color: theme.palette.primary.main
+ }
+ }
+});
+
+class Breadcrumbs extends Component {
render() {
return (
- this.props.content && this.props.content.length > 1 ?
-