Skip to content

Commit

Permalink
added support for .svg
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaNaveen committed Sep 11, 2023
1 parent 1be49d1 commit 335079c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/UI/components/model/modelDataLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from "react";

// Define the supported file types for the model files
const SUPPORTED_FILE_TYPES = [".png", ".jpg", ".ant", ".m", ".py", ".jl", ".r", ".txt"];
const SUPPORTED_FILE_TYPES = [".png", ".svg", ".jpg", ".ant", ".m", ".py", ".jl", ".r", ".txt"];

// Define the ModelDataLoader component
const ModelDataLoader = ({
Expand Down
2 changes: 1 addition & 1 deletion src/UI/components/model/modelDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ImageDisplay from "./imageDisplay";
// Define the supported file types for code files
const SUPPORTED_FILE_TYPES = [".ant", ".m", ".py", ".jl", ".r", ".txt"];
// Define the supported image file types
const SUPPORTED_IMAGE_TYPES = [".png", ".jpg"];
const SUPPORTED_IMAGE_TYPES = [".png", ".jpg", ".svg"];

// Define the ModelDisplay component
const ModelDisplay = ({
Expand Down
2 changes: 1 addition & 1 deletion src/UI/components/model/modelFileLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ModelFileLoader = ({
};

// Determine whether the file is an image or not
if (fileName.endsWith(".png") || fileName.endsWith(".jpg")) {
if (fileName.endsWith(".png") || fileName.endsWith(".jpg") || fileName.endsWith(".svg")) {
fetchImage(); // Fetch and display image files
} else {
getFile(); // Fetch and display other types of files
Expand Down

0 comments on commit 335079c

Please sign in to comment.