Skip to content

Commit ba68d63

Browse files
committed
Add back button to customize screen
1 parent 1543ab4 commit ba68d63

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/components/Customize.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect, useMemo, useRef } from "react";
2-
import { useParams, useLocation } from "react-router-dom";
2+
import { useParams, useLocation, useNavigate } from "react-router-dom";
33
import { HexColorPicker, HexColorInput } from "react-colorful";
44
import { render } from "@abstractplay/renderer";
55
import { gameinfo } from "@abstractplay/gameslib";
@@ -10,6 +10,7 @@ import { isEqual, cloneDeep } from "lodash";
1010
function Customize(props) {
1111
const params = useParams();
1212
const location = useLocation();
13+
const navigate = useNavigate();
1314
const providedMetaGame = props.metaGame || params.metaGame;
1415
const [scope, setScope] = useState("game");
1516
const metaGame =
@@ -308,6 +309,14 @@ function Customize(props) {
308309

309310
return (
310311
<div className="container">
312+
<div style={{ marginBottom: "1em" }}>
313+
<button className="button is-small" onClick={() => navigate(-1)}>
314+
<span className="icon">
315+
<i className="fa fa-arrow-left"></i>
316+
</span>
317+
<span>Back</span>
318+
</button>
319+
</div>
311320
<h1 className="title">Customize Settings for {gameName}</h1>
312321
{providedMetaGame && providedMetaGame !== "_default" && (
313322
<div className="tabs is-toggle is-centered is-small">

0 commit comments

Comments
 (0)