Show all symbols.

pull/1/head
Atul Varma 2021-02-03 19:36:29 -05:00
rodzic f0960d4280
commit 7019199bd4
2 zmienionych plików z 35 dodań i 1 usunięć

Wyświetl plik

@ -1,14 +1,47 @@
import React from "react";
import ReactDOM from "react-dom";
import _SvgVocabulary from "./svg-vocabulary.json";
import type { SvgSymbolData } from "./vocabulary";
const APP_ID = "app";
const appEl = document.getElementById(APP_ID);
const SvgVocabulary: SvgSymbolData[] = _SvgVocabulary;
if (!appEl) {
throw new Error(`Unable to find #${APP_ID}!`);
}
const App: React.FC<{}> = () => <p>SUP</p>;
type SvgSymbolProps = {
data: SvgSymbolData;
};
const SvgSymbol: React.FC<SvgSymbolProps> = (props) => {
const d = props.data;
return (
<svg
stroke="#000000"
fill="#ffffff"
width={`${d.width}px`}
height={`${d.height}px`}
dangerouslySetInnerHTML={{ __html: d.svg }}
></svg>
);
};
const App: React.FC<{}> = () => (
<>
<h1>Mythic Symbolic</h1>
{SvgVocabulary.map((symbolData) => (
<>
<h2>{symbolData.name}</h2>
<SvgSymbol data={symbolData} />
</>
))}
</>
);
ReactDOM.render(<App />, appEl);

Wyświetl plik

@ -63,6 +63,7 @@
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
"resolveJsonModule": true,
/* Advanced Options */
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */