Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
feat: apps page (will fix formatting)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbnm0 committed Feb 20, 2024
1 parent e51c46e commit f4d9c10
Show file tree
Hide file tree
Showing 8 changed files with 7,099 additions and 21 deletions.
7,057 changes: 7,057 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added public/apps/placeholder/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ declare global {
__$ampere: any;
}
}

export default function App() {
useEffect(() => {
if ("serviceWorker" in navigator) {
Expand All @@ -42,6 +43,7 @@ export default function App() {
<Route path="/view/:url" Component={View} />
<Route path="/settings" Component={Settings} />
<Route path="/apps" Component={Apps} />
<Route path="/app/:url" Component={App} />
<Route path="/~/*" Component={ServiceWorkerError} />
<Route path="*" Component={PageNotFound} />
</Routes>
Expand Down
12 changes: 12 additions & 0 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useParams } from "react-router-dom";

export default function App() {
const { url } = useParams();
return (
<>
<iframe
src={`../apps/${url}`}
/>
</>
);
}
37 changes: 19 additions & 18 deletions src/pages/Apps.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import Navbar from "@/components/Navbar";
import Header from "@/components/Header";
/*
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
*/
import { apps } from "./apps/apps";

export function open() {

}

export default function Apps() {
return (
<>
Expand All @@ -20,23 +23,21 @@ export default function Apps() {
Apps
</div>
<div className="w-full h-[calc(100%_-_5rem)] translate-y-20">
<iframe
width="100%"
height="100%"
src="https://example.com"
></iframe>
{/*
{apps.map((app) => (
<div>
<Card>
<CardHeader>
<CardTitle></CardTitle>
<CardDescription></CardDescription>
</CardHeader>
</Card>
</div>
))}
*/}
<a href={`../../apps/${app.path}`}>
<Card>
<CardHeader>
<CardTitle>{app.name}</CardTitle>
<CardDescription>{app.desc}</CardDescription>
</CardHeader>
<CardContent>
<img src={`../../apps/${app.path}/icon.png`}></img>
</CardContent>
</Card>
</a>
</div>
))}
</div>
</div>
</>
Expand Down
10 changes: 8 additions & 2 deletions src/pages/apps/apps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// import list from "apps.json";
import list from "./apps.json";

// export const apps = list as [];
export type Application = {
name: string;
desc: string;
path: string;
}

export const apps = list as Application[];
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
},
"include": ["src"],
"include": ["src", "src/pages/apps"],
"references": [{ "path": "./tsconfig.node.json" }],
}

0 comments on commit f4d9c10

Please sign in to comment.