hide rules when desired
This commit is contained in:
+39
-20
@@ -808,29 +808,48 @@ const getSpellClassNames = (spells, index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ForceRules = ({ rules, onePerPage }) => {
|
const ForceRules = ({ rules, onePerPage }) => {
|
||||||
|
const [hide, setHide] = useState(false);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={"avoid-page-break " + (onePerPage ? "page-break" : "")}
|
className={
|
||||||
style={{
|
"avoid-page-break " +
|
||||||
display: "flex",
|
(onePerPage ? "page-break" : "") +
|
||||||
flexDirection: "column",
|
(hide ? " print-display-none" : "")
|
||||||
gap: 8,
|
}
|
||||||
padding: "var(--size-20)",
|
|
||||||
backgroundColor: "#dfe0e2",
|
|
||||||
border: "2px solid var(--primary-color)",
|
|
||||||
marginBottom: 32,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{[...rules.keys()].map((rule) => (
|
<label
|
||||||
<div
|
className="print-display-none"
|
||||||
key={rule}
|
style={{
|
||||||
style={{
|
display: "flex",
|
||||||
lineHeight: 1.4,
|
alignItems: "center",
|
||||||
}}
|
justifyContent: "flex-end",
|
||||||
>
|
}}
|
||||||
<span style={{ fontWeight: 700 }}>{rule}:</span> {rules.get(rule)}
|
>
|
||||||
</div>
|
<input type="checkbox" onChange={() => setHide(!hide)} />
|
||||||
))}
|
<span className="print-display-none">Don't print this card.</span>
|
||||||
|
</label>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: 8,
|
||||||
|
padding: "var(--size-20)",
|
||||||
|
backgroundColor: "#dfe0e2",
|
||||||
|
border: "2px solid var(--primary-color)",
|
||||||
|
marginBottom: 32,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{[...rules.keys()].map((rule) => (
|
||||||
|
<div
|
||||||
|
key={rule}
|
||||||
|
style={{
|
||||||
|
lineHeight: 1.4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span style={{ fontWeight: 700 }}>{rule}:</span> {rules.get(rule)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ const Weapon = ({ weapon, modelStats, isMelee, className, forceRules }) => {
|
|||||||
return abilities;
|
return abilities;
|
||||||
};
|
};
|
||||||
|
|
||||||
replaceAbilityWithType(["Blast.", "Blast"], "Blast");
|
replaceAbilityWithType(["Blast.", "Blast, ", "Blast"], "Blast");
|
||||||
replaceAbilityWithType(
|
replaceAbilityWithType(
|
||||||
[
|
[
|
||||||
"Each time an attack is made with this weapon, that attack automatically hits the target.",
|
"Each time an attack is made with this weapon, that attack automatically hits the target.",
|
||||||
|
|||||||
Reference in New Issue
Block a user