Skip to content

Commit

Permalink
added updated files
Browse files Browse the repository at this point in the history
  • Loading branch information
sanskarg348 committed Sep 15, 2022
1 parent f050f59 commit 6eea8a7
Show file tree
Hide file tree
Showing 35 changed files with 24,137 additions and 0 deletions.
3 changes: 3 additions & 0 deletions atri_app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["react-app", "prettier"]
}
2 changes: 2 additions & 0 deletions atri_app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
21 changes: 21 additions & 0 deletions atri_app/app-node/src/getAppText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import App from "../../app/src/App";
import ReactDOMServer from "react-dom/server";
import { StaticRouter } from "react-router-dom/server";

function renderRoute(App: React.FC, route: string): string {
const appStr = ReactDOMServer.renderToString(
<StaticRouter location={route}>
<App />
</StaticRouter>
);
return appStr;
}

export function getAppText(url: string, appHtmlContent: string) {
const appText = renderRoute(App, url);
const finalText = appHtmlContent.replace(
'<div id="root" style="height: 100vh"></div>',
`<div id="root" style="height: 100vh">${appText}</div>`
);
return finalText;
}
14 changes: 14 additions & 0 deletions atri_app/app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');</style>
<style>@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,400;1,500;1,600;1,700&display=swap');</style>
<title>Atri Labs</title>
</head>
<body>
<div id="root" style="height: 100vh"></div>
</body>
</html>
19 changes: 19 additions & 0 deletions atri_app/app/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Routes, Route } from "react-router-dom";
import "./styles.css";
import Home from "./pages/Home.jsx";
import Viewtest from "./pages/Viewtest.jsx";
import Newtest from "./pages/Newtest.jsx";
import Newtestresult from "./pages/Newtestresult.jsx";
import Login from "./pages/Login.jsx";

export default function App() {
return (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/viewtest" element={<Viewtest />} />
<Route path="/newtest" element={<Newtest />} />
<Route path="/newtestresult" element={<Newtestresult />} />
<Route path="/login" element={<Login />} />
</Routes>
);
}
21 changes: 21 additions & 0 deletions atri_app/app/src/hooks/useIoStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import create from "zustand";

const useIoStore = create((set) => {
return {
"Home": {},
"viewtest": {},
"newtest": {
"Upload1": {
"io": {
"files": {
"type": "files",
"mode": "upload"
}
}
}
},
"newtestresult": {},
"login": {}
}});

export default useIoStore;
Loading

0 comments on commit 6eea8a7

Please sign in to comment.