@daimo/pay
Version:
Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.
28 lines (25 loc) • 868 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 (jsx("div", { ref: textRef, style: {
visibility: ready ? "visible" : "hidden",
fontSize: `${fontSize}%`,
maxHeight: "100%",
maxWidth: "100%",
display: "flex",
justifyContent: "center",
alignItems: "center",
}, children: children }));
};
FitText.displayName = "FitText";
export { FitText as default };
//# sourceMappingURL=index.js.map