Skip to content

Commit

Permalink
2024/02/02 - Quick thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
FadiShawki committed Jan 2, 2024
1 parent 2871939 commit 38a1b46
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Legacy from "./lib/layout/experimental-designs/Legacy";
import BlueprintJS from "./lib/layout/experimental-designs/BlueprintJS";
import Modules from "./@orbitmines/js/react/Modules";
import Icons from "./lib/layout/experimental-designs/Icons";
import {ThumbnailPage} from "./lib/paper/Paper";

export const Router = () => {

Expand All @@ -24,6 +25,7 @@ export const Router = () => {
<Route path="profiles">
<Route path=":profile" element={<Profile />} />
</Route>
<Route path="thumbnail" element={<ThumbnailPage />} />
<Route path="experimental">
<Route path="legacy" element={<Legacy />} />
<Route path="blueprintjs" element={<BlueprintJS />} />
Expand Down
45 changes: 43 additions & 2 deletions src/lib/paper/Paper.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import React from 'react';
import {Helmet} from "react-helmet";
import ExportablePaper, {PdfProps} from "./views/ExportablePaper";
import {Children, value} from "../typescript/React";
import {Children, renderable, value} from "../typescript/React";
import Browser from "./views/Browser";
import {useLocation, useSearchParams} from "react-router-dom";
import {ReferenceCounter, ReferenceProps} from "./layout/Reference";
import {ReferenceCounter, ReferenceProps, useCounter} from "./layout/Reference";
import {PaperHeader} from "./PaperContent";
import {Grid, Row} from "../layout/flexbox";
import {Center} from "@react-three/drei";
import {Continuation, Loop, RenderedRay, torus, Vertex} from "../../@orbitmines/explorer/OrbitMinesExplorer";
import {length} from "../../@orbitmines/explorer/Ray";
import {CachedVisualizationCanvas, VisualizationCanvas} from "../../@orbitmines/explorer/Visualization";
import JetBrainsMono from "../layout/font/fonts/JetBrainsMono/JetBrainsMono";
import {ON_ORBITS} from "../../routes/papers/2023.OnOrbits";
import ORGANIZATIONS from "../organizations/ORGANIZATIONS";
import {PROFILES} from "../../profiles/profiles";

export type PaperProps = ReferenceProps & {
header?: any //
Expand Down Expand Up @@ -38,6 +42,43 @@ export const PaperView = (paper: PaperProps) => {
return <Browser paper={paper}/>;
};

export const ThumbnailPage = () => {
const [params] = useSearchParams();

const title = params.get('title') ?? 'OrbitMines - Stream';
const subtitle = params.get('subtitle') ?? '';

const referenceCounter = useCounter();

const paper: Omit<PaperProps, 'children'> = {
title,
subtitle,
pdf: {
fonts: [ JetBrainsMono ],
},
organizations: [ORGANIZATIONS.orbitmines_research],
authors: [{
...PROFILES.fadi_shawki,
external: PROFILES.fadi_shawki.external?.filter((profile) => [
ORGANIZATIONS.github.key,
ORGANIZATIONS.twitter.key,
ORGANIZATIONS.discord.key,
ORGANIZATIONS.youtube.key,
ORGANIZATIONS.twitch.key,
].includes(profile.organization.key))
}],
draft: false,
Reference: (props: {}) => (<></>),
references: referenceCounter
}

return <div>
<PaperThumbnail {...paper}>
<></>
</PaperThumbnail>
</div>
}

export const PaperThumbnail = (
{size, ...props}: PaperProps & { size?: { width: number, height: number } }
) => {
Expand Down

0 comments on commit 38a1b46

Please sign in to comment.