Skip to content

Instantly share code, notes, and snippets.

@perjo927
Created September 8, 2020 16:01
Show Gist options
  • Save perjo927/ec0e3bc7009c2da77e45647a99942d83 to your computer and use it in GitHub Desktop.
Save perjo927/ec0e3bc7009c2da77e45647a99942d83 to your computer and use it in GitHub Desktop.
Undo Template
import { html } from "lit-html";
export const Undo = ({ disabled, onClick }) => {
const className = `${disabled ? "disabled" : ""}`;
const onUndo = disabled ? () => {} : onClick;
return html`
<div class=${className} @click=${onUndo}>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="black"
width="36px"
height="36px"
>
<path d="M0 0h24v24H0V0z" fill="none" />
<path
d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"
/>
</svg>
</div>
`;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment