Skip to content

Commit

Permalink
chore(frontend/Thumbnail): replace old element
Browse files Browse the repository at this point in the history
  • Loading branch information
harbassan committed Aug 31, 2024
1 parent e8e2815 commit 20b6cee
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 204 deletions.
7 changes: 3 additions & 4 deletions frontend/src/components/ListContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { Box } from "@material-ui/core";
import ImageList from "@material-ui/core/ImageList";
import ImageListItem from "@material-ui/core/ImageListItem";

import ThumbImage from "containers/pages/AuthoringTool/Components/ThumbImage";
import Thumbnail from "containers/pages/AuthoringTool/Components/Thumbnail";
import DashedCard from "./DashedCard";
import Thumbnail from "./Thumbnail";

import styles from "../styling/ListContainer.module.scss";
import useStyles from "./component.styles";
Expand Down Expand Up @@ -130,9 +129,9 @@ export default function ListContainer({
}}
>
{sceneSelectionPage ? (
<ThumbImage components={item.components} />
<Thumbnail components={item.components} />
) : (
<ThumbImage
<Thumbnail
components={item.thumbnail?.components || []}
/>
)}
Expand Down
100 changes: 0 additions & 100 deletions frontend/src/components/Thumbnail.jsx

This file was deleted.

14 changes: 0 additions & 14 deletions frontend/src/components/__tests__/Thumbnail.test.js

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const ThumbElement = ({ component }) => {
}
};

const ThumbImage = ({ components }) => {
const Thumbnail = ({ components }) => {
return (
<svg viewBox="0 0 1920 1080">
<rect x="0" y="0" width="1920" height="1080" fill="white" />
Expand All @@ -160,4 +160,4 @@ const ThumbImage = ({ components }) => {
);
};

export default ThumbImage;
export default Thumbnail;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useContext, useEffect, useState } from "react";
import { useHistory, useParams } from "react-router-dom";
import styles from "styling/SceneNavigator.module.scss";
import SceneListItem from "./SceneListItem";
import ThumbImage from "../Components/ThumbImage";
import Thumbnail from "../Components/Thumbnail";

const SceneNavigator = ({ saveScene }) => {
const [thumbnails, setThumbnails] = useState(null);
Expand Down Expand Up @@ -48,7 +48,7 @@ const SceneNavigator = ({ saveScene }) => {
}
key={scene._id}
>
<ThumbImage components={scene.components} />
<Thumbnail components={scene.components} />
</button>
</>
),
Expand Down
10 changes: 2 additions & 8 deletions frontend/src/containers/pages/Dashboard/SceneNode.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import { Box } from "@material-ui/core";
import { Handle, Position } from "react-flow-renderer";
import Thumbnail from "../../../components/Thumbnail";

function SceneNode({ data }) {
const { scenarioId, sceneId } = data;
function SceneNode() {
// const { scenarioId, sceneId } = data;

return (
<Box>
<Handle type="target" position={Position.Top} />
<Thumbnail
url={`${process.env.PUBLIC_URL}/play/${scenarioId}/${sceneId}`}
width="160"
height="90"
/>
<Handle type="source" position={Position.Bottom} id="a" />
{/* <h5 style={textStyle}>{sceneTitle}</h5> */}
</Box>
Expand Down

0 comments on commit 20b6cee

Please sign in to comment.