reactioning
Version:
Just a simple library to show beautiful reactions in your app.
25 lines (24 loc) • 759 B
JavaScript
import { jsx as o } from "react/jsx-runtime";
import { useState as a } from "react";
import { ThumbUpIcon as r } from "./thumb-up-icon.js";
import { ReactionContainer as p } from "../reaction-container.js";
import '../../assets/thumb-up-reaction.css';const l = "_icon_tnjcz_1", _ = "_animate_tnjcz_5", f = "_moveUpDown_tnjcz_1", c = {
icon: l,
animate: _,
moveUpDown: f
}, v = ({ reaction: t, onClick: e, ...s }) => {
const [i, n] = a(!1);
return /* @__PURE__ */ o(p, { reaction: t, onClick: (m) => {
e == null || e(m), !t.selected && (n(!0), setTimeout(() => {
n(!1);
}, 1e3));
}, ...s, children: /* @__PURE__ */ o(
r,
{
className: `${c.icon} ${i ? c.animate : ""}`
}
) });
};
export {
v as ThumbUpReaction
};