diff --git a/src/components/deleteGrid.jsx b/src/components/deleteGrid.jsx index 35fcc719..bac41835 100644 --- a/src/components/deleteGrid.jsx +++ b/src/components/deleteGrid.jsx @@ -27,12 +27,22 @@ export default class DeleteGrid extends React.Component { } render() { - return( - + ); + } + else{ + return( + ); + } } } diff --git a/src/components/matrixSize.jsx b/src/components/matrixSize.jsx index 25767e5d..264199b2 100644 --- a/src/components/matrixSize.jsx +++ b/src/components/matrixSize.jsx @@ -58,25 +58,50 @@ export default class MatrixSize extends React.Component { } render() { - return ( -
-
- - + if(this.props.gridId == "null"){ + return ( +
+
+ + +
+
- -
- ); + ); + } + else{ + return ( +
+
+ + +
+ +
+ ); + } } } diff --git a/src/components/randomize.jsx b/src/components/randomize.jsx index d2f8a274..c65eb650 100644 --- a/src/components/randomize.jsx +++ b/src/components/randomize.jsx @@ -44,8 +44,15 @@ export default class Randomize extends React.Component { } render() { - return ( - - ) + if(this.props.enabled == "enabled"){ + return ( + + ) + } + else{ + return ( + + ) + } } } diff --git a/src/components/resetGridColor.jsx b/src/components/resetGridColor.jsx index ad268c20..93cd20f6 100644 --- a/src/components/resetGridColor.jsx +++ b/src/components/resetGridColor.jsx @@ -22,8 +22,15 @@ export default class ResetGridColor extends React.Component { } render(){ - return( - - ) + if(this.props.enabled == "enabled"){ + return( + + ) + } + else{ + return( + + ) + } } } diff --git a/src/components/shareComponent.jsx b/src/components/shareComponent.jsx index 9d5c002a..7e896edd 100644 --- a/src/components/shareComponent.jsx +++ b/src/components/shareComponent.jsx @@ -123,26 +123,36 @@ export default class ShareComponent extends React.Component { } render(){ - return ( -
- - - - - Share this grid with other users - - - -

{ this.state.shareMessage } - { this.state.currentUsers.join(', ') } -

-
- - - - -
-
- ); + if(this.props.enabled == "enabled"){ + return ( +
+ + + + + Share this grid with other users + + + +

{ this.state.shareMessage } + { this.state.currentUsers.join(', ') } +

+
+ + + + +
+
+ ); + } + else{ + + return ( +
+ +
+ ); + } } } diff --git a/src/components/sidebar.jsx b/src/components/sidebar.jsx index cc74605a..4d080a90 100644 --- a/src/components/sidebar.jsx +++ b/src/components/sidebar.jsx @@ -10,6 +10,27 @@ import styles from '../main.scss'; import 'bootstrap/dist/css/bootstrap.min.css'; export default class SideBar extends React.Component { + constructor() { + super(); + this.state = {enabled: "disabled" } + } + + componentDidMount(){ + if(this.props.gridId == "null"){ + this.setState({enabled: "disabled"}); + } + else{ + this.setState({enabled: "enabled"}) + } + } + componentWillReceiveProps(nextProps) { + if (nextProps.gridId == "null") { + this.setState({enabled: "disabled"}); + } + else{ + this.setState({enabled: "enabled"}) + } + } render(){ return(
@@ -19,7 +40,7 @@ export default class SideBar extends React.Component { Grid Options
-
{/* row */} @@ -32,24 +53,27 @@ export default class SideBar extends React.Component { -
{/* row .dangerZone */}
- Sharing + Sharing
- -
+ +
{/* row */} {/* .sidebarContent */} @@ -58,4 +82,4 @@ export default class SideBar extends React.Component { } } -{/* Source: https://github.com/BlackrockDigital/startbootstrap-simple-sidebar */} \ No newline at end of file +{/* Source: https://github.com/BlackrockDigital/startbootstrap-simple-sidebar */}