Further progress on registry UI.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Add package README view support and style adjustments
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user