Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4312f376b8 |
@@ -81,7 +81,7 @@ describe("PaymentMethodSelector", () => {
|
||||
expect(html).toContain('data-density="compact"');
|
||||
expect(html).toContain("Payment Method");
|
||||
expect(html).not.toContain("This caption is hidden");
|
||||
expect(html).toContain("min-h-13");
|
||||
expect(html).toContain("min-h-11");
|
||||
});
|
||||
|
||||
it("does not render when payment method selection is unavailable", () => {
|
||||
|
||||
@@ -54,7 +54,7 @@ export function PaymentMethodSelector({
|
||||
|
||||
return (
|
||||
<section
|
||||
className={`flex flex-col ${isCompact ? "gap-2" : "gap-[clamp(8px,1.852vw,10px)]"} ${className ?? ""}`.trim()}
|
||||
className={`flex flex-col ${isCompact ? "gap-1.5" : "gap-[clamp(8px,1.852vw,10px)]"} ${className ?? ""}`.trim()}
|
||||
data-density={density}
|
||||
aria-labelledby="payment-method-title"
|
||||
>
|
||||
@@ -63,7 +63,7 @@ export function PaymentMethodSelector({
|
||||
>
|
||||
<h2
|
||||
id="payment-method-title"
|
||||
className={`m-0 font-bold leading-[1.2] text-auth-text-primary ${isCompact ? "text-base" : "text-(length:--responsive-card-title,var(--font-size-lg))"}`}
|
||||
className={`m-0 font-bold leading-[1.2] text-auth-text-primary ${isCompact ? "text-sm" : "text-(length:--responsive-card-title,var(--font-size-lg))"}`}
|
||||
style={{ fontFamily: "var(--font-athelas), var(--font-system)" }}
|
||||
>
|
||||
Payment Method
|
||||
@@ -78,7 +78,7 @@ export function PaymentMethodSelector({
|
||||
{paymentMethods.map((method) => {
|
||||
const selected = method.channel === value;
|
||||
const classes = [
|
||||
`flex cursor-pointer items-center justify-center text-center font-[inherit] text-[#3c3b3b] transition-[border-color,box-shadow,transform] duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:enabled:scale-98 disabled:cursor-not-allowed disabled:opacity-72 ${isCompact ? "min-h-13 rounded-[18px] px-3 py-2" : "min-h-[clamp(54px,11.481vw,62px)] rounded-(--responsive-card-radius-sm,18px) px-[clamp(12px,2.593vw,14px)] py-[clamp(9px,1.852vw,10px)]"}`,
|
||||
`flex cursor-pointer items-center justify-center text-center font-[inherit] text-[#3c3b3b] transition-[border-color,box-shadow,transform] duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent active:enabled:scale-98 disabled:cursor-not-allowed disabled:opacity-72 ${isCompact ? "min-h-11 rounded-2xl px-2 py-1.5" : "min-h-[clamp(54px,11.481vw,62px)] rounded-(--responsive-card-radius-sm,18px) px-[clamp(12px,2.593vw,14px)] py-[clamp(9px,1.852vw,10px)]"}`,
|
||||
selected
|
||||
? "border-2 border-[#f657a0] bg-[#fff4f9] shadow-[0_8px_18px_rgba(217,47,127,0.24),0_0_0_3px_rgba(217,47,127,0.18)] -translate-y-0.5"
|
||||
: "border border-[rgba(246,87,160,0.18)] bg-white shadow-[0_5px_7px_0_rgba(247,89,168,0.08)]",
|
||||
@@ -105,7 +105,7 @@ export function PaymentMethodSelector({
|
||||
aria-hidden="true"
|
||||
width={122}
|
||||
height={29}
|
||||
className={`block object-contain ${isCompact ? "max-h-8 w-[min(100%,92px)]" : "max-h-8.5 w-[min(100%,92px)]"}`}
|
||||
className={`block object-contain ${isCompact ? "max-h-7 w-[min(100%,80px)]" : "max-h-8.5 w-[min(100%,92px)]"}`}
|
||||
/>
|
||||
) : (
|
||||
<span className="text-(length:--responsive-body,16px) font-bold leading-[1.1] text-[#1e1e1e]">
|
||||
|
||||
@@ -188,7 +188,7 @@ describe("TipScreen checkout", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("renders the enlarged purchase flow without a character Cover", () => {
|
||||
it("renders the compact purchase flow with character atmosphere", () => {
|
||||
renderScreen();
|
||||
|
||||
expect(container.textContent).toContain("Send Maya a gift");
|
||||
@@ -204,10 +204,14 @@ describe("TipScreen checkout", () => {
|
||||
).toBe("compact");
|
||||
expect(container.textContent).not.toContain("A little sweetness for today");
|
||||
expect(container.textContent).not.toContain("Tip Maya");
|
||||
expect(container.querySelector("main")?.getAttribute("style")).toBeNull();
|
||||
expect(
|
||||
container
|
||||
.querySelector("main")
|
||||
?.getAttribute("style"),
|
||||
).toContain('--tip-cover-image: url("/images/cover/maya.png")');
|
||||
expect(
|
||||
container.querySelectorAll('main > div[aria-hidden="true"]'),
|
||||
).toHaveLength(2);
|
||||
).toHaveLength(3);
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
.shell {
|
||||
--responsive-icon-button-size: 48px;
|
||||
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@@ -9,10 +7,10 @@
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
padding:
|
||||
calc(var(--app-safe-top, 0px) + 16px)
|
||||
calc(var(--app-safe-right, 0px) + clamp(16px, 4.5vw, 24px))
|
||||
calc(var(--app-safe-bottom, 0px) + 16px)
|
||||
calc(var(--app-safe-left, 0px) + clamp(16px, 4.5vw, 24px));
|
||||
calc(var(--app-safe-top, 0px) + 14px)
|
||||
calc(var(--app-safe-right, 0px) + clamp(14px, 4vw, 22px))
|
||||
calc(var(--app-safe-bottom, 0px) + 14px)
|
||||
calc(var(--app-safe-left, 0px) + clamp(14px, 4vw, 22px));
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background:
|
||||
@@ -31,6 +29,7 @@
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
.bgImage,
|
||||
.bgGlowOne,
|
||||
.bgGlowTwo {
|
||||
position: absolute;
|
||||
@@ -38,6 +37,21 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.bgImage {
|
||||
inset: 0 0 auto;
|
||||
height: clamp(230px, 42vh, 330px);
|
||||
background:
|
||||
linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 242, 232, 0.3) 0%,
|
||||
rgba(255, 242, 232, 0.64) 64%,
|
||||
#fff2e8 96%
|
||||
),
|
||||
var(--tip-cover-image) center 18% / cover no-repeat;
|
||||
filter: saturate(0.95) blur(0.2px);
|
||||
opacity: 0.36;
|
||||
}
|
||||
|
||||
.bgGlowOne,
|
||||
.bgGlowTwo {
|
||||
border-radius: 999px;
|
||||
@@ -64,7 +78,7 @@
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
min-height: 50px;
|
||||
min-height: 46px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@@ -82,15 +96,14 @@
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.headerAvatar {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
flex: 0 0 auto;
|
||||
border: 2px solid rgba(255, 255, 255, 0.94);
|
||||
border-radius: 999px;
|
||||
@@ -100,16 +113,16 @@
|
||||
}
|
||||
|
||||
.headerTitle {
|
||||
max-width: 250px;
|
||||
max-width: 220px;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
color: #2a1a1d;
|
||||
font-family: var(--font-athelas), Georgia, serif;
|
||||
font-size: clamp(21px, 5.7vw, 27px);
|
||||
font-size: clamp(18px, 5vw, 24px);
|
||||
font-weight: 760;
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.05;
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -117,17 +130,22 @@
|
||||
.supportPrompt {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: min(100%, 340px);
|
||||
min-height: 3.7em;
|
||||
box-sizing: border-box;
|
||||
margin: 12px auto 0;
|
||||
padding: 0 4px;
|
||||
margin: 10px 0 0;
|
||||
padding: 9px 13px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.64);
|
||||
border-radius: 18px;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
color: #684d51;
|
||||
font-size: clamp(14px, 3.7vw, 15px);
|
||||
font-size: clamp(12.5px, 3.45vw, 14px);
|
||||
font-weight: 650;
|
||||
line-height: 1.35;
|
||||
text-align: center;
|
||||
text-wrap: balance;
|
||||
opacity: 0.78;
|
||||
box-shadow: 0 10px 26px rgba(91, 55, 52, 0.08);
|
||||
backdrop-filter: blur(12px);
|
||||
transition: opacity 0.24s ease;
|
||||
}
|
||||
|
||||
@@ -142,8 +160,8 @@
|
||||
min-height: 0;
|
||||
flex: 0 1 auto;
|
||||
flex-direction: column;
|
||||
gap: 13px;
|
||||
margin-top: 13px;
|
||||
gap: 12px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.productCard {
|
||||
@@ -151,10 +169,10 @@
|
||||
flex: 0 1 auto;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 11px;
|
||||
padding: 13px;
|
||||
gap: 10px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(118, 61, 55, 0.09);
|
||||
border-radius: 26px;
|
||||
border-radius: 24px;
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
box-shadow:
|
||||
0 16px 36px rgba(119, 72, 67, 0.11),
|
||||
@@ -164,12 +182,12 @@
|
||||
|
||||
.coffeeStage {
|
||||
position: relative;
|
||||
width: clamp(150px, 42vw, 184px);
|
||||
width: clamp(136px, 40vw, 176px);
|
||||
aspect-ratio: 1;
|
||||
align-self: center;
|
||||
justify-self: center;
|
||||
overflow: hidden;
|
||||
border-radius: 22px;
|
||||
border-radius: 20px;
|
||||
background: #c59b7d;
|
||||
box-shadow:
|
||||
0 10px 24px rgba(102, 53, 39, 0.16),
|
||||
@@ -213,8 +231,8 @@
|
||||
|
||||
.tierList {
|
||||
display: grid;
|
||||
max-height: 190px;
|
||||
gap: 7px;
|
||||
max-height: 176px;
|
||||
gap: 6px;
|
||||
padding: 2px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
@@ -225,14 +243,14 @@
|
||||
.tierOption {
|
||||
position: relative;
|
||||
display: grid;
|
||||
min-height: 54px;
|
||||
grid-template-columns: minmax(0, 1fr) auto 22px;
|
||||
min-height: 50px;
|
||||
grid-template-columns: minmax(0, 1fr) auto 20px;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
box-sizing: border-box;
|
||||
padding: 8px 9px 8px 11px;
|
||||
padding: 7px 8px 7px 10px;
|
||||
border: 1px solid rgba(112, 71, 65, 0.12);
|
||||
border-radius: 17px;
|
||||
border-radius: 15px;
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
@@ -284,7 +302,7 @@
|
||||
overflow: hidden;
|
||||
color: #2a1b1e;
|
||||
font-family: var(--font-athelas), Georgia, serif;
|
||||
font-size: clamp(15px, 4vw, 18px);
|
||||
font-size: clamp(13px, 3.7vw, 16px);
|
||||
font-weight: 750;
|
||||
letter-spacing: -0.015em;
|
||||
line-height: 1.05;
|
||||
@@ -299,15 +317,15 @@
|
||||
|
||||
.tierPrice {
|
||||
color: #d23f79;
|
||||
font-size: clamp(13px, 3.5vw, 16px);
|
||||
font-size: clamp(12px, 3.2vw, 14px);
|
||||
font-weight: 900;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tierCheck {
|
||||
display: grid;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
place-items: center;
|
||||
border: 1px solid rgba(111, 76, 73, 0.2);
|
||||
border-radius: 999px;
|
||||
@@ -315,8 +333,8 @@
|
||||
}
|
||||
|
||||
.tierCheck svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.tierOption[data-selected="true"] .tierCheck {
|
||||
@@ -337,7 +355,7 @@
|
||||
border-radius: 22px;
|
||||
background: rgba(255, 255, 255, 0.78);
|
||||
color: #76575c;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
line-height: 1.45;
|
||||
text-align: center;
|
||||
@@ -349,15 +367,15 @@
|
||||
}
|
||||
|
||||
.catalogStatus button {
|
||||
min-height: 44px;
|
||||
padding: 0 20px;
|
||||
min-height: 40px;
|
||||
padding: 0 18px;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
background: #2b1a1e;
|
||||
color: #ffffff;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 850;
|
||||
}
|
||||
|
||||
@@ -379,21 +397,21 @@
|
||||
}
|
||||
|
||||
.skeletonImage {
|
||||
width: clamp(150px, 42vw, 184px);
|
||||
width: clamp(136px, 40vw, 176px);
|
||||
aspect-ratio: 1;
|
||||
justify-self: center;
|
||||
border-radius: 22px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.skeletonList {
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.skeletonList span {
|
||||
display: block;
|
||||
min-height: 54px;
|
||||
border-radius: 17px;
|
||||
min-height: 50px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.paymentMethodSlot {
|
||||
@@ -406,7 +424,7 @@
|
||||
|
||||
.checkoutButton {
|
||||
width: 100%;
|
||||
min-height: 58px;
|
||||
min-height: 52px;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
background:
|
||||
@@ -415,7 +433,7 @@
|
||||
color: #ffffff;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-size: clamp(17px, 4.5vw, 20px);
|
||||
font-size: clamp(15px, 4vw, 18px);
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.01em;
|
||||
box-shadow:
|
||||
@@ -438,7 +456,7 @@
|
||||
.checkoutError {
|
||||
margin: 7px 0 0;
|
||||
color: #b2474f;
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
text-align: center;
|
||||
@@ -446,100 +464,99 @@
|
||||
|
||||
@media (max-width: 350px) {
|
||||
.shell {
|
||||
padding-right: calc(var(--app-safe-right, 0px) + 12px);
|
||||
padding-left: calc(var(--app-safe-left, 0px) + 12px);
|
||||
padding-right: calc(var(--app-safe-right, 0px) + 11px);
|
||||
padding-left: calc(var(--app-safe-left, 0px) + 11px);
|
||||
}
|
||||
|
||||
.header {
|
||||
min-height: 44px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.headerIdentity {
|
||||
gap: 6px;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.headerTitle {
|
||||
max-width: 200px;
|
||||
font-size: 20px;
|
||||
max-width: 170px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.productCard {
|
||||
gap: 9px;
|
||||
padding: 11px;
|
||||
gap: 7px;
|
||||
padding: 9px;
|
||||
}
|
||||
|
||||
.tierOption {
|
||||
grid-template-columns: minmax(0, 1fr) auto 20px;
|
||||
gap: 6px;
|
||||
padding-right: 7px;
|
||||
padding-left: 9px;
|
||||
grid-template-columns: minmax(0, 1fr) auto 18px;
|
||||
gap: 5px;
|
||||
padding-right: 6px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.tierName {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tierPrice {
|
||||
font-size: 13px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.tierCheck {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 700px) {
|
||||
.shell {
|
||||
--responsive-icon-button-size: 44px;
|
||||
|
||||
padding-top: calc(var(--app-safe-top, 0px) + 10px);
|
||||
padding-bottom: calc(var(--app-safe-bottom, 0px) + 10px);
|
||||
padding-top: calc(var(--app-safe-top, 0px) + 9px);
|
||||
padding-bottom: calc(var(--app-safe-bottom, 0px) + 9px);
|
||||
}
|
||||
|
||||
.header {
|
||||
min-height: 44px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.headerAvatar {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.purchaseFlow {
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.supportPrompt {
|
||||
margin-top: 9px;
|
||||
padding: 0 3px;
|
||||
font-size: 13.5px;
|
||||
line-height: 1.35;
|
||||
min-height: 0;
|
||||
margin-top: 7px;
|
||||
padding: 7px 11px;
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.productCard {
|
||||
padding: 11px;
|
||||
padding: 9px;
|
||||
}
|
||||
|
||||
.coffeeStage,
|
||||
.skeletonImage {
|
||||
width: 148px;
|
||||
width: 128px;
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.tierList {
|
||||
max-height: 162px;
|
||||
gap: 6px;
|
||||
max-height: 148px;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.tierOption,
|
||||
.skeletonList span {
|
||||
min-height: 48px;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.checkoutButton {
|
||||
min-height: 54px;
|
||||
min-height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, type CSSProperties } from "react";
|
||||
|
||||
import { BackButton, CharacterAvatar } from "@/app/_components";
|
||||
import { MobileShell } from "@/app/_components/core";
|
||||
@@ -201,7 +201,15 @@ export function TipScreen({
|
||||
|
||||
return (
|
||||
<MobileShell background="#fff5ed">
|
||||
<main className={styles.shell}>
|
||||
<main
|
||||
className={styles.shell}
|
||||
style={
|
||||
{
|
||||
"--tip-cover-image": `url("${character.assets.cover}")`,
|
||||
} as CSSProperties
|
||||
}
|
||||
>
|
||||
<div className={styles.bgImage} aria-hidden="true" />
|
||||
<div className={styles.bgGlowOne} aria-hidden="true" />
|
||||
<div className={styles.bgGlowTwo} aria-hidden="true" />
|
||||
|
||||
@@ -209,7 +217,6 @@ export function TipScreen({
|
||||
<BackButton
|
||||
href={characterRoutes.splash}
|
||||
variant="soft"
|
||||
iconSize={28}
|
||||
ariaLabel="Back to character home"
|
||||
analyticsKey="tip.back_to_splash"
|
||||
/>
|
||||
@@ -222,7 +229,7 @@ export function TipScreen({
|
||||
src={character.assets.avatar}
|
||||
alt={character.displayName}
|
||||
size="100%"
|
||||
imageSize={52}
|
||||
imageSize={44}
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user