diff --git a/front/src/routes/scene/SceneCard.jsx b/front/src/routes/scene/SceneCard.jsx index 916bde91d3..8dce97a4db 100644 --- a/front/src/routes/scene/SceneCard.jsx +++ b/front/src/routes/scene/SceneCard.jsx @@ -24,7 +24,52 @@ class SceneCard extends Component { await this.setState({ saving: false }); }; - render(props, { saving }) { + getMobileView = (props, { saving }) => { + return ( +
+
+ + + + +
{props.scene.name}
+
{props.scene.description}
+
+ {props.scene.tags && + props.scene.tags.map(tag => ( + + {tag.name.length > MAX_LENGTH_TAG ? `${tag.name.substring(0, MAX_LENGTH_TAG - 3)}...` : tag.name} + + ))} +
+
+
+ +
+
+
+ ); + }; + + getDesktopView = (props, { saving }) => { return (
); + }; + + render(props, state) { + if (props.showMobileView) { + return this.getMobileView(props, state); + } + return this.getDesktopView(props, state); } } diff --git a/front/src/routes/scene/SceneCards.jsx b/front/src/routes/scene/SceneCards.jsx index 03889755fe..1a56f0bdc0 100644 --- a/front/src/routes/scene/SceneCards.jsx +++ b/front/src/routes/scene/SceneCards.jsx @@ -1,11 +1,22 @@ import SceneCard from './SceneCard'; const SceneCards = ({ children, ...props }) => ( -
- {props.scenes.map((scene, index) => ( - - ))} -
+ <> +
+ {/* Only visible on small screens */} + {props.scenes.map((scene, index) => ( + + ))} +
+
+
+ {/* Only visible on bigger screens */} + {props.scenes.map((scene, index) => ( + + ))} +
+
+ ); export default SceneCards; diff --git a/front/src/routes/scene/ScenePage.jsx b/front/src/routes/scene/ScenePage.jsx index 33be006a1f..6f951063dc 100644 --- a/front/src/routes/scene/ScenePage.jsx +++ b/front/src/routes/scene/ScenePage.jsx @@ -13,7 +13,7 @@ const ScenePage = ({ children, ...props }) => (
-