feat: complete TASK-WP0-01 toolchain skeleton
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
import { ToolchainProbe } from "./toolchain-probe.js";
|
||||
|
||||
const root = document.getElementById("root");
|
||||
|
||||
if (!root) {
|
||||
throw new Error("Dada web root element is missing.");
|
||||
}
|
||||
|
||||
createRoot(root).render(
|
||||
<StrictMode>
|
||||
<ToolchainProbe />
|
||||
</StrictMode>,
|
||||
);
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Rect, version as fabricVersion } from "fabric";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
|
||||
export function ToolchainProbe() {
|
||||
return <canvas aria-label="Dada toolchain probe" height={16} width={16} />;
|
||||
}
|
||||
|
||||
export function renderToolchainProbe() {
|
||||
const reactMarkup = renderToStaticMarkup(<ToolchainProbe />);
|
||||
const fabricSvg = new Rect({
|
||||
fill: "#111111",
|
||||
height: 16,
|
||||
width: 16,
|
||||
}).toSVG();
|
||||
|
||||
return {
|
||||
fabricSvg,
|
||||
fabricVersion,
|
||||
reactMarkup,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user