@daimo/pay
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
35 lines (32 loc) • 846 B
JavaScript
import { jsx } from 'react/jsx-runtime';
import React from 'react';
import useFitText from '../../../hooks/useFitText.js';
const FitText = ({ children }) => {
const [ready, setReady] = React.useState(false);
const { fontSize, ref: textRef } = useFitText({
logLevel: "none",
maxFontSize: 100,
minFontSize: 70,
onStart: () => setReady(true),
onFinish: () => setReady(true)
});
return /* @__PURE__ */ jsx(
"div",
{
ref: textRef,
style: {
visibility: ready ? "visible" : "hidden",
fontSize: `${fontSize}%`,
maxHeight: "100%",
maxWidth: "100%",
display: "flex",
justifyContent: "center",
alignItems: "center"
},
children
}
);
};
FitText.displayName = "FitText";
export { FitText as default };
//# sourceMappingURL=index.js.map