Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Nov 10, 2024
1 parent 45ae77e commit 59484a6
Show file tree
Hide file tree
Showing 23 changed files with 977 additions and 943 deletions.
260 changes: 250 additions & 10 deletions frontend/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"three": "^0.167.1",
"tsd-jsdoc": "^2.5.0",
"urdf-loader": "^0.12.2",
"zod": "^3.23.8",
"zxcvbn": "^4.4.2"
Expand Down
22 changes: 5 additions & 17 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Navbar from "@/components/nav/Navbar";
import APIKeys from "@/components/pages/APIKeys";
import About from "@/components/pages/About";
import Account from "@/components/pages/Account";
import ArtifactPlayground from "@/components/pages/ArtifactPlayground";
import Browse from "@/components/pages/Browse";
import Create from "@/components/pages/Create";
import DeleteConnect from "@/components/pages/DeleteConnect";
Expand All @@ -27,7 +26,6 @@ import Logout from "@/components/pages/Logout";
import NotFound from "@/components/pages/NotFound";
import OrderSuccess from "@/components/pages/OrderSuccess";
import OrdersPage from "@/components/pages/Orders";
import Playground from "@/components/pages/Playground";
import PrivacyPolicy from "@/components/pages/PrivacyPolicy";
import Profile from "@/components/pages/Profile";
import ResearchPage from "@/components/pages/ResearchPage";
Expand Down Expand Up @@ -58,17 +56,6 @@ const App = () => {
<Routes>
<Route path={ROUTES.HOME.path} element={<Home />} />

{/* Playground */}
<Route
path={ROUTES.PLAYGROUND.path}
element={<Playground />}
>
<Route
path={ROUTES.PLAYGROUND.WITH_ID.path}
element={<ArtifactPlayground />}
/>
</Route>

{/* General pages */}
<Route path={ROUTES.ABOUT.path} element={<About />} />
<Route
Expand Down Expand Up @@ -120,10 +107,11 @@ const App = () => {
/>

{/* Seller */}
<Route
path={ROUTES.SELL.path}
element={<SellerDashboard />}
>
<Route path={ROUTES.SELL.path}>
<Route
path={ROUTES.SELL.$.DASHBOARD.relativePath}
element={<SellerDashboard />}
/>
<Route
path={ROUTES.SELL.$.ONBOARDING.relativePath}
element={<SellerOnboarding />}
Expand Down
17 changes: 9 additions & 8 deletions frontend/src/components/files/FileRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MJCFRenderer from "./MJCFRenderer";
import STLRenderer from "./STLRenderer";
import { UntarredFile } from "./Tarfile";
import URDFRenderer from "./URDFRenderer";
import MJCFRenderer from "@/components/files/MJCFRenderer";
import STLRenderer from "@/components/files/STLRenderer";
import URDFRenderer from "@/components/files/URDFRenderer";
import { UntarredFile } from "@/components/files/untar";

const isMJCFFile = (content: string, filename: string): boolean => {
const extension = filename.split(".").pop()?.toLowerCase();
Expand All @@ -23,24 +23,25 @@ const FileRenderer: React.FC<{
case "urdf":
return (
<URDFRenderer
urdfContent={new TextDecoder().decode(file.content)}
urdfContent={fileContent}
files={allFiles}
supportedThemes={["light", "dark"]}
/>
);
case "stl":
return <STLRenderer stlContent={file.content.buffer} />;
case "xml":
case "mjcf":
if (isMJCFFile(fileContent, file.name)) {
return <MJCFRenderer mjcfContent={fileContent} height="100%" />;
// return <MJCFRenderer mjcfContent={fileContent} files={allFiles} />;
return <MJCFRenderer />;
} else {
return (
<div className="h-full w-full flex items-center justify-center">
<p>Invalid MJCF file format</p>
</div>
);
}
case "stl":
return <STLRenderer stlContent={file.content.buffer} />;
default:
return (
<div className="h-full w-full flex items-center justify-center">
Expand Down
Loading

0 comments on commit 59484a6

Please sign in to comment.