@@ -8,10 +8,11 @@ interface PurchaseButtonProps {
88 style : 'primary' | 'secondary' ;
99 price : number ;
1010 productSku : 'hardcore-mode-lifetime-access' | 'hardcore-mode-seven-day-access' ;
11+ shortText : string ;
1112}
1213
1314export const PurchaseButton : React . FC < PurchaseButtonProps > = ( props ) => {
14- const { children, price, productSku, style } = props ;
15+ const { children, price, productSku, style, shortText } = props ;
1516
1617 const onClick = ( ) => {
1718 sendMessageToDevvit ( {
@@ -26,21 +27,22 @@ export const PurchaseButton: React.FC<PurchaseButtonProps> = (props) => {
2627 < button
2728 onClick = { onClick }
2829 className = { cn (
29- 'flex w-full cursor-pointer flex-row items-center justify-between gap-4 whitespace-nowrap rounded-full border-2 border-current px-6 py- 3 text-center font-sans font-semibold sm:w-auto' ,
30+ 'flex w-full min-w-0 cursor-pointer flex-row items-center justify-between gap-4 rounded-full border-2 border-current p- 3 text-center font-sans font-semibold sm:w-auto sm:px-6 ' ,
3031 style === 'primary' ? 'text-mustard-gold' : 'text-slate-gray'
3132 ) }
3233 >
33- < span className = "text-left text-base" > { children } </ span >
34+ < span className = "xs:block hidden truncate text-left text-base" > { children } </ span >
35+ < span className = "xs:hidden block text-left text-base" > { shortText } </ span >
3436 < span
3537 className = { cn (
36- 'flex w-fit flex-row items-center gap-[6px] rounded-full px-3 py- 2 text-xs' ,
38+ 'flex flex-none flex-row items-center gap-1 rounded-full p- 2 text-xs sm:gap-[6px] sm:px-3 ' ,
3739 style === 'primary' ? 'bg-mustard-gold text-black' : 'bg-charcoal text-white'
3840 ) }
3941 >
4042 < span className = "flex h-4 w-4 items-center justify-center" >
4143 < GoldIcon />
4244 </ span >
43- Use { price }
45+ < span className = "whitespace-nowrap" > Use { price } </ span >
4446 </ span >
4547 </ button >
4648 ) ;
0 commit comments