Skip to content

Commit c2f8b56

Browse files
authored
iOS 26 Full screen improvements (#448)
* max z-index * hide payment options * reduce vertical spacing * tweaks for better visuals on ios 26.1 * lint
1 parent 04e357b commit c2f8b56

File tree

8 files changed

+60
-15
lines changed

8 files changed

+60
-15
lines changed

packages/donate-button-v4/src/autoPlayMode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function mountShadowRoot() {
7070
const shadowWidgetWrapper = document.createElement('div');
7171
shadowWidgetWrapper.id = 'every-shadow-wrapper';
7272
shadowWidgetWrapper.style.position = 'absolute';
73-
shadowWidgetWrapper.style.zIndex = '20000000';
73+
shadowWidgetWrapper.style.zIndex = '2147483647';
7474
document.body.append(shadowWidgetWrapper);
7575
shadowRoot = shadowWidgetWrapper.attachShadow({mode: 'open'});
7676
}

packages/donate-button-v4/src/components/widget/components/Header/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const containerCss = css({
66
display: 'flex',
77
justifyContent: 'flex-end',
88
alignItems: 'center',
9-
padding: `${Spacing.M} ${Spacing.XL}`,
9+
padding: `${Spacing.M} ${Spacing.L}`,
1010
[BREAKPOINTS.TabletLandscapeUp]: {
1111
padding: 0
1212
}

packages/donate-button-v4/src/components/widget/components/NonprofitInfo/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const fundraiserCardLogoCss = (logoUrl: string) =>
5858
]);
5959

6060
export const nonprofitCardCss = css({
61-
padding: `${Spacing.XL}`,
61+
padding: `0 ${Spacing.L} ${Spacing.L}`,
6262
[BREAKPOINTS.TabletLandscapeUp]: {
6363
...verticalStackCss.css(Spacing.S),
6464
padding: `${Spacing.L}`

packages/donate-button-v4/src/components/widget/components/PaymentProcess/PaymentMethodSelect/index.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import {
88
largePaymentMethodButtonCss,
99
smallPaymentMethodFieldSetCss,
1010
smallPaymentMethodSelectListCss,
11-
smallPaymentMethodButtonCss
11+
smallPaymentMethodButtonCss,
12+
showMoreButtonCss
1213
} from 'src/components/widget/components/PaymentProcess/PaymentMethodSelect/styles';
1314
import {legendCss} from 'src/components/widget/components/PaymentProcess/styles';
1415
import {useConfigContext} from 'src/components/widget/hooks/useConfigContext';
@@ -185,7 +186,9 @@ export const LargePaymentMethodSelect = () => {
185186

186187
export const SmallPaymentMethodSelect = () => {
187188
const methods = usePaymentMethods();
189+
const {primaryColor} = useConfigContext();
188190

191+
const [showMore, setShowMore] = useState(false);
189192
if (methods.length === 1) {
190193
return null;
191194
}
@@ -194,10 +197,27 @@ export const SmallPaymentMethodSelect = () => {
194197
<fieldset className={smallPaymentMethodFieldSetCss}>
195198
<legend className={legendCss}>Payment method</legend>
196199
<ul className={smallPaymentMethodSelectListCss}>
197-
{methods.map((method) => (
200+
{methods.slice(0, 4).map((method) => (
198201
<PaymentMethodListItem key={method} small method={method} />
199202
))}
203+
{showMore &&
204+
methods
205+
.slice(4)
206+
.map((method) => (
207+
<PaymentMethodListItem key={method} small method={method} />
208+
))}
200209
</ul>
210+
{!showMore && (
211+
<button
212+
type="button"
213+
className={showMoreButtonCss(primaryColor)}
214+
onClick={() => {
215+
setShowMore(true);
216+
}}
217+
>
218+
More options
219+
</button>
220+
)}
201221
</fieldset>
202222
);
203223
};

packages/donate-button-v4/src/components/widget/components/PaymentProcess/PaymentMethodSelect/styles.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {fieldSetCss} from 'src/components/widget/components/PaymentProcess/styles';
22
import {BREAKPOINTS} from 'src/components/widget/theme/breakpoints';
33
import {COLORS} from 'src/components/widget/theme/colors';
4+
import {textSize} from 'src/components/widget/theme/font-sizes';
45
import {Radii} from 'src/components/widget/theme/radii';
56
import {
67
verticalStackCss,
@@ -25,6 +26,7 @@ export const largePaymentMethodSelectListCss = css({
2526
export const smallPaymentMethodFieldSetCss = joinClassNames([
2627
fieldSetCss,
2728
css({
29+
marginBottom: Spacing.S,
2830
display: 'block',
2931
[BREAKPOINTS.TabletLandscapeUp]: {
3032
display: 'none'
@@ -103,3 +105,19 @@ export const smallPaymentMethodButtonCss = (
103105
}
104106
: {})
105107
});
108+
109+
export const showMoreButtonCss = (primaryColor: string) =>
110+
css({
111+
background: 'transparent',
112+
border: 'none',
113+
color: primaryColor,
114+
cursor: 'pointer',
115+
textDecoration: 'none',
116+
fontWeight: 700,
117+
fontSize: textSize.xs.fontSize,
118+
lineHeight: textSize.xs.lineHeight,
119+
padding: 0,
120+
textAlign: 'center',
121+
margin: `${Spacing.S} auto 0`,
122+
width: '100%'
123+
});

packages/donate-button-v4/src/components/widget/components/WidgetOverlay/styles.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ export const overlayCss = css({
1010
position: 'fixed',
1111
height: 'auto',
1212
width: '100%',
13-
zIndex: 999,
13+
zIndex: 2147483647,
1414
top: 0,
1515
bottom: 0,
1616
left: 0,
1717
right: 0,
1818
display: 'flex',
19-
background: 'rgba(0, 0, 0, 0.5)',
19+
background: '#ffffff',
2020
justifyContent: 'center',
2121
alignItems: 'center',
2222
color: COLORS.Text,
2323
fontFamily: FontFamily.BasisGrotesque,
2424
padding: 0,
2525
[BREAKPOINTS.TabletLandscapeUp]: {
26-
padding: Spacing.XL
26+
padding: Spacing.XL,
27+
background: 'rgba(0, 0, 0, 0.5)'
2728
},
2829
// reset
2930
boxSizing: 'border-box',

packages/donate-button-v4/src/components/widget/icons/LoadingIcon.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {useConfigContext} from 'src/components/widget/hooks/useConfigContext';
2+
import {BREAKPOINTS} from 'src/components/widget/theme/breakpoints';
13
import {COLORS} from 'src/components/widget/theme/colors';
24
import css from 'src/helpers/css';
35

@@ -14,19 +16,23 @@ const loadingSvgCss = css({
1416
maskSize: 'cover'
1517
});
1618

17-
const loadingPathCss = (color: string) =>
19+
const loadingPathCss = (primaryColor: string) =>
1820
css({
19-
fill: color
21+
fill: primaryColor,
22+
[BREAKPOINTS.TabletLandscapeUp]: {
23+
fill: COLORS.Gray
24+
}
2025
});
26+
2127
interface LoadingIconProps {
2228
size?: number;
23-
color?: string;
2429
}
2530

2631
export const LoadingIcon = ({
27-
size = DEFAULT_LOADING_SIZE,
28-
color = COLORS.LightGray
32+
size = DEFAULT_LOADING_SIZE
2933
}: LoadingIconProps) => {
34+
const {primaryColor} = useConfigContext();
35+
3036
return (
3137
<svg
3238
width={size}
@@ -37,7 +43,7 @@ export const LoadingIcon = ({
3743
className={loadingSvgCss}
3844
>
3945
<path
40-
className={loadingPathCss(color)}
46+
className={loadingPathCss(primaryColor)}
4147
d="M51.147 28.97C51.147 17.614 41.667 9 29.493 9C15.875 9 5 20.5 5 34.744C5 50.094 17.223 62.365 33.68 62.365C50.137 62.365 64.862 49.325 66.017 32.242H58.51C57.114 45.042 46.287 54.859 33.68 54.859C21.553 54.859 12.555 45.956 12.555 34.744C12.555 24.639 20.062 16.507 29.493 16.507C37.385 16.507 43.593 21.897 43.593 28.97C43.593 34.84 39.358 39.749 33.728 39.749V47.256C43.688 47.256 51.148 38.931 51.148 28.97"
4248
/>
4349
</svg>

packages/donate-button-v4/src/manualMode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function manualMode() {
4646
const shadowWidgetWrapper = document.createElement('div');
4747
shadowWidgetWrapper.id = 'every-shadow-wrapper';
4848
shadowWidgetWrapper.style.position = 'absolute';
49-
shadowWidgetWrapper.style.zIndex = '20000000';
49+
shadowWidgetWrapper.style.zIndex = '2147483647';
5050
document.body.append(shadowWidgetWrapper);
5151

5252
widgetMountPoint = document.createElement('div');

0 commit comments

Comments
 (0)