Implement minimum amount for a working matrix.to

This commit is contained in:
Jorik Schellekens
2020-08-17 17:48:13 +01:00
parent f8fe32ffbc
commit 1ad11ed25f
28 changed files with 703 additions and 99 deletions
+27 -3
View File
@@ -15,18 +15,42 @@ limitations under the License.
*/
import React from "react";
import "./App.scss";
import SingleColumn from "./layouts/SingleColumn";
import CreateLinkTile from "./components/CreateLinkTile";
import MatrixTile from "./components/MatrixTile";
import Tile from "./components/Tile";
import LinkRouter from "./pages/LinkRouter";
import "./App.scss";
/* eslint-disable no-restricted-globals */
const App: React.FC = () => {
let page = (
<>
<CreateLinkTile /> <hr />{" "}
</>
);
if (location.hash) {
console.log(location.hash);
if (location.hash.startsWith("#/")) {
page = <LinkRouter link={location.hash.slice(2)} />;
} else {
console.log("asdfadf");
page = (
<Tile>
Links should be in the format {location.host}/#/{"<"}
matrix-resource-identifier{">"}
</Tile>
);
}
}
return (
<SingleColumn>
<div className="topSpacer" />
<CreateLinkTile />
<hr />
{page}
<MatrixTile />
<div className="bottomSpacer" />
</SingleColumn>