added button to reset custom color

This commit is contained in:
NilsUeter
2023-05-08 21:22:19 +02:00
parent 0c51e23814
commit 142040e2b3
+25 -12
View File
@@ -99,7 +99,7 @@ function App() {
return ( return (
<div className="App"> <div className="App">
<div className="header print-display-none"> <div className="header print-display-none">
<a href="/" style={{ color: "#fff", fontWeight: 800 }}> <a href="/fancyscribe" style={{ color: "#fff", fontWeight: 800 }}>
FancyScribe FancyScribe
</a> </a>
<div className="subheader"> <div className="subheader">
@@ -155,17 +155,30 @@ function App() {
/> />
One Datacard per Page when Printing One Datacard per Page when Printing
</label> </label>
<label style={{ display: "flex", alignItems: "center", gap: 4 }}> <div style={{ display: "flex", alignItems: "center", gap: 4 }}>
<input <label style={{ display: "flex", alignItems: "center", gap: 4 }}>
type="color" <input
style={{ height: 24, width: 32, padding: "0 2px" }} type="color"
value={primaryColor} style={{ height: 24, width: 32, padding: "0 2px" }}
onChange={(e) => { value={primaryColor}
setPrimaryColor(e.target.value); onChange={(e) => {
}} setPrimaryColor(e.target.value);
></input> }}
Custom Color ></input>
</label> Custom Color
</label>
{primaryColor !== getPrimaryColor(roster.forces[0].catalog) && (
<button
onClick={() =>
setPrimaryColor(getPrimaryColor(roster.forces[0].catalog))
}
style={{ padding: "2px 4px", borderRadius: 4, borderWidth: 1 }}
>
Reset color
</button>
)}
</div>
</div> </div>
<div className="print-display-none" style={{ color: "red" }}> <div className="print-display-none" style={{ color: "red" }}>
{error} {error}