Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Base64Png Editor Add IsDirty
/**
* Added on the end of the NavList an isDirty indicator.
*/
<NavItem itemId={0}>
<div className={"base64png-editor--tweaks-nav-item"}>
<p>Invert</p>
<Switch
id="invert-switch"
isDisabled={disabled}
isChecked={invert === "100"}
onChange={(value) => tweakInvert(value ? "100" : "0")}
/>
</div>
</NavItem>
{stateControl.isDirty() && (
<div style={{ display: "flex", alignItems: "center", padding: "20px" }}>
<p style={{ color: "red" }}>Image was Edited!</p>
</div>
)}
</NavList>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment