Further progress on registry UI.
Some checks failed
continuous-integration/drone/push Build is failing

Add package README view support and style adjustments
This commit is contained in:
Fabian Stamm
2020-07-31 20:16:12 +02:00
parent 0bee324519
commit 7fcdf2c383
13 changed files with 336 additions and 76 deletions

View File

@ -1,6 +1,8 @@
/// <reference path="./types/jsx.d.ts" />
import { React, jsx } from "./deps.ts";
import { v4 } from "https://deno.land/std/uuid/mod.ts";
class StringReader implements Deno.Reader {
private data: Uint8Array;
private offset = 0;
@ -27,11 +29,12 @@ export default async function render(
name: string,
data: any
): Promise<Deno.Reader> {
const id = v4.generate();
const component: {
default: () => JSX.IntrinsicElements | Promise<JSX.IntrinsicElements>;
} = await import(`./views/${name}.tsx`);
} = await import(`./views/${name}.tsx?id=${id}.tsx`);
const res = await (<component.default {...data} />).render();
console.log(res);
return new StringReader(res as string);
}