Skip to content

Commit

Permalink
chore: cut release (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeul authored Apr 9, 2024
2 parents f2d9e6e + 8a0a2eb commit fb55db7
Show file tree
Hide file tree
Showing 385 changed files with 195 additions and 32 deletions.
4 changes: 3 additions & 1 deletion .github/scripts/runServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ echo "127.0.0.1 localhost.paypal.com" | sudo tee -a /etc/hosts
((npm run dev:standalone 2>&1 & echo $! > pid.log) | tee server.log) &
sleep 40
error_count=$(grep -i error server.log | wc -l)
error_count=$(grep -iv 'errorboundary' server.log | grep -i 'error' | wc -l)
echo "Errors Found: $error_count"
if [[ $error_count -gt 0 ]]; then
echo "Errors found in server.log:"
grep -i error server.log # Print out the errors found
echo "Exiting server"
kill $(<pid.log)
exit 1
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/runServerV2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ echo "127.0.0.1 localhost.paypal.com" | sudo tee -a /etc/hosts
((npm run dev:ci 2>&1 & echo $! > pid.log) | tee server.log) &
sleep 40
error_count=$(grep -i error server.log | wc -l)
error_count=$(grep -iv 'errorboundary' server.log | grep -i 'error' | wc -l)
echo "Errors Found: $error_count"
if [[ $error_count -gt 0 ]]; then
echo "Errors found in server.log:"
grep -i error server.log # Print out the errors found
echo "Exiting server"
kill $(<pid.log)
exit 1
Expand Down
8 changes: 8 additions & 0 deletions src/components/modal/v2/lib/hooks/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default function useCalculator({ autoSubmit = false } = {}) {
merchantId,
customerId,
onCalculate,
onError,
buyerCountry,
ignoreCache,
amount,
Expand Down Expand Up @@ -113,6 +114,13 @@ export default function useCalculator({ autoSubmit = false } = {}) {
});
})
.catch(() => {
// Call the onError handler provided via xprops
if (onError) {
onError({
message: 'Failed to fetch modal offers'
});
}

dispatch({
type: 'view',
data: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/v2/parts/Donut.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Donut = ({
/>
<g
stroke-width={isV4Design ? 0 : segStrokeWidth}
fill={isV4Design ? '#bdbdbd' : 'transparent'}
fill={isV4Design ? '#545D68' : 'transparent'}
stroke-linecap={strokeLinecap}
>
{segments}
Expand Down
35 changes: 35 additions & 0 deletions src/components/modal/v2/parts/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Component } from 'preact';
import { useXProps } from '../lib';

class ErrorBoundary extends Component {
constructor(props) {
super(props);
this.state = { error: null };
}

static getDerivedStateFromError(error) {
return { error: error.message };
}

componentDidCatch(error) {
// eslint-disable-next-line no-console
console.error(error);
this.setState({ error: error.message });
}

render() {
const { onError } = useXProps();
const {
state: { error },
props: { children }
} = this;
if (error && onError) {
onError({
message: 'Preact modal rendering error'
});
}
return children;
}
}

export default ErrorBoundary;
20 changes: 10 additions & 10 deletions src/components/modal/v2/parts/Icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,39 @@ const Icon = ({ name = '', color, content }) => {
);
case 'pay-in-4-card':
return (
<svg width="96" height="60" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="96" height="96" fill="none" xmlns="http://www.w3.org/2000/svg">
<title>PayPal</title>
<rect width="96" height="60" rx="4" fill="#003087" />
<rect x="19.203" y="13" width="57.6" height="33.75" rx="4" fill="#003087" />
<rect y="18" width="96" height="60" rx="4" fill="#003087" />
<rect x="19.199" y="31" width="57.6" height="33.75" rx="4" fill="#003087" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M39.936 22.803c.4-2.267 0-3.867-1.267-5.267-1.267-1.533-3.733-2.2-6.933-2.2h-9c-.667 0-1.2.467-1.334 1.133l-3.8 24.067c-.066.467.267.867.734.867h5.6l-.4 2.466c-.067.467.266.8.666.8h4.734c.6 0 1.066-.466 1.133-.933l.067-.2.866-5.6.067-.267c.067-.533.6-.933 1.133-.933h.734c4.6 0 8.2-1.867 9.266-7.267.467-2.2.2-4.133-.933-5.466-.333-.6-.8-.934-1.333-1.2Z"
d="M39.934 40.8c.4-2.267 0-3.867-1.267-5.267-1.267-1.533-3.733-2.2-6.933-2.2h-9c-.667 0-1.2.467-1.334 1.134l-3.8 24.066c-.066.467.267.867.734.867h5.6l-.4 2.467c-.067.466.266.8.666.8h4.734c.6 0 1.066-.467 1.133-.934l.067-.2.866-5.6.067-.266c.067-.534.6-.934 1.133-.934h.734c4.6 0 8.2-1.866 9.266-7.266.467-2.2.2-4.134-.933-5.467-.333-.6-.8-.933-1.333-1.2Z"
fill="#fff"
fill-opacity=".68"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M39.936 22.803c.4-2.267 0-3.867-1.267-5.267-1.267-1.533-3.733-2.2-6.933-2.2h-9c-.667 0-1.2.467-1.334 1.133l-3.8 24.067c-.066.467.267.867.734.867h5.6l1.4-8.934-.067.267c.133-.667.733-1.133 1.333-1.133h2.667c5.267 0 9.333-2.134 10.6-8.267 0-.2.067-.4.067-.533Z"
d="M39.934 40.8c.4-2.267 0-3.867-1.267-5.267-1.267-1.533-3.733-2.2-6.933-2.2h-9c-.667 0-1.2.467-1.334 1.134l-3.8 24.066c-.066.467.267.867.734.867h5.6l1.4-8.933-.067.266C25.4 50.067 26 49.6 26.6 49.6h2.667c5.267 0 9.333-2.133 10.6-8.267 0-.2.067-.4.067-.533Z"
fill="#fff"
fill-opacity=".7"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M26.936 22.803c.066-.4.266-.667.666-.867.134-.067.267-.133.534-.133h7.133l2.4.2c.2 0 .4.066.6.133.2.067.4.067.6.133.067 0 .133.067.267.067.4.133.666.2.933.467.4-2.267 0-3.867-1.267-5.267-1.333-1.533-3.8-2.2-7-2.2h-9.066c-.667 0-1.2.467-1.334 1.133l-3.8 24.067c-.066.467.267.867.734.867h5.6l3-18.6Z"
d="M26.934 40.8c.066-.4.266-.667.666-.867.134-.066.267-.133.534-.133h7.133l2.4.2c.2 0 .4.067.6.133.2.067.4.067.6.134.067 0 .133.066.267.066.4.134.666.2.933.467.4-2.267 0-3.867-1.267-5.267-1.333-1.533-3.8-2.2-7-2.2h-9.066c-.667 0-1.2.467-1.334 1.134l-3.8 24.066c-.066.467.267.867.734.867h5.6l3-18.6Z"
fill="#fff"
/>
<path
d="M66 46c8.837 0 16-7.163 16-16s-7.163-16-16-16-16 7.163-16 16 7.163 16 16 16Z"
d="M66 64c8.837 0 16-7.163 16-16s-7.163-16-16-16-16 7.163-16 16 7.163 16 16 16Z"
stroke="#fff"
stroke-width="3"
className="checkout"
style={{ 'mix-blend-mode': 'soft-light' }}
/>
<path d="M82 30c0-8.837-7.163-16-16-16" stroke="#3ABBA1" stroke-width="3" stroke-linecap="round" />
<path d="M82 48c0-8.837-7.163-16-16-16" stroke="#3ABBA1" stroke-width="3" stroke-linecap="round" />
<path
d="M67.362 35.25c-.21 0-.322-.112-.322-.322v-1.89h-4.354c-.21 0-.322-.112-.322-.322v-.532c0-.154.042-.28.126-.406l2.968-4.27c.448-.644 1.106-1.638 1.4-2.058a.422.422 0 0 1 .392-.21h.868c.21 0 .322.112.322.322v6.314h1.078c.21 0 .322.112.322.322v.518c0 .21-.112.322-.322.322H68.44v1.89c0 .21-.112.322-.322.322h-.756Zm-3.472-3.374h3.15v-2.702c0-1.022.056-1.722.056-2.114h-.028l-1.358 2.156-.98 1.414c-.42.602-.868 1.246-.84 1.246Z"
d="M67.362 53.25c-.21 0-.322-.112-.322-.322v-1.89h-4.354c-.21 0-.322-.112-.322-.322v-.532c0-.154.042-.28.126-.406l2.968-4.27c.448-.644 1.106-1.638 1.4-2.058a.422.422 0 0 1 .392-.21h.868c.21 0 .322.112.322.322v6.314h1.078c.21 0 .322.112.322.322v.518c0 .21-.112.322-.322.322H68.44v1.89c0 .21-.112.322-.322.322h-.756Zm-3.472-3.374h3.15v-2.702c0-1.022.056-1.722.056-2.114h-.028l-1.358 2.156-.98 1.414c-.42.602-.868 1.246-.84 1.246Z"
fill="#fff"
/>
</svg>
Expand Down
15 changes: 9 additions & 6 deletions src/components/modal/v2/parts/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { h } from 'preact';

import { TransitionStateProvider, XPropsProvider, ServerDataProvider, isLander, isIframe } from '../lib';
import ErrorBoundary from './ErrorBoundary';
import Container from './Container';

import styles from '../styles/index.scss';
Expand All @@ -16,12 +17,14 @@ document.documentElement.className = [isLander && !isIframe && 'lander', isLande
const Modal = ({ serverData, children }) => {
return (
<XPropsProvider>
<ServerDataProvider data={serverData}>
<TransitionStateProvider>
<style>{styles._getCss()}</style>
<Container>{children}</Container>
</TransitionStateProvider>
</ServerDataProvider>
<ErrorBoundary>
<ServerDataProvider data={serverData}>
<TransitionStateProvider>
<style>{styles._getCss()}</style>
<Container>{children}</Container>
</TransitionStateProvider>
</ServerDataProvider>
</ErrorBoundary>
</XPropsProvider>
);
};
Expand Down
6 changes: 5 additions & 1 deletion src/components/modal/v2/parts/views/ShortTerm/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
@include smallMobile {
padding: 0px;
}

.checkout & {
padding: 0px;
}
}

&.checkout {
Expand Down Expand Up @@ -124,7 +128,7 @@
background: $ql-gray;

.donuts__container {
margin-top: -30px;
margin-top: -25px;
padding-bottom: 0px;
::after {
margin-top: -30px;
Expand Down
23 changes: 22 additions & 1 deletion src/components/modal/v2/styles/components/_calculator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
margin-top: 15px;
}

.checkout & {
@include tablet {
margin-bottom: 0px;
}

@include mobile {
margin-bottom: 0px;
}
}

.form {
.title {
color: $text-main;
Expand All @@ -60,6 +70,11 @@
position: absolute;
left: 0.5rem;
top: 0.25rem;

.checkout & {
top: 0.5rem;
left: 0.9rem;
}
}

.input__currency-symbol {
Expand Down Expand Up @@ -87,10 +102,16 @@
font-size: 14px;
}
}

.checkout & {
font-size: 16px;
padding: 1.75rem 0.5rem 0.25rem 0.75rem;
}
}
}

&.v4Design, &.checkout {
&.v4Design,
&.checkout {
h4 {
font-weight: 700;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/modal/v2/styles/components/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@
}

@include mobile {
margin-top: 28px;
margin-top: 10px;
}

&.checkout {
@include mobile {
margin-bottom: 60px;
}
margin-bottom: 60px;
}
}
}

Expand Down
13 changes: 11 additions & 2 deletions src/components/modal/v2/styles/components/_donut.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $donut-text-v4: #545d68;
width: 80px;

svg {
max-width: 64px;
max-width: 50px;
}
&.donut__qualifying_payment {
svg {
Expand Down Expand Up @@ -74,6 +74,10 @@ $donut-text-v4: #545d68;
font-size: 1rem;
line-height: 20px;

.checkout & {
line-height: 17px;
}

@media all and (min-width: $webpage) {
font-size: 0.9rem;
line-height: 22px;
Expand All @@ -92,6 +96,11 @@ $donut-text-v4: #545d68;
@extend .donut__payment;
color: $donut-text-v4;
}

.checkout & {
font-size: 16px;
margin-top: -0.5rem;
}
}

&.donut__timestamp {
Expand Down Expand Up @@ -122,7 +131,7 @@ $donut-text-v4: #545d68;
&::after {
content: '';
flex-grow: 1;
border-top: 1px dashed $grey350;
border-top: 1px dashed $dark-gray;
top: 55px;
width: 100%;
max-width: 50px;
Expand Down
6 changes: 6 additions & 0 deletions src/components/modal/v2/styles/components/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@
padding-bottom: 40px;
}

.checkout & {
@include tablet {
padding-bottom: 44px;
}
}

svg {
position: absolute;
right: 0;
Expand Down
7 changes: 5 additions & 2 deletions src/components/modal/v2/styles/components/_instructions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
margin-left: 42px;
margin-top: 10px;

.checkout & {
margin-top: 22px;
}

@include desktop {
margin-bottom: 10px;

Expand Down Expand Up @@ -103,7 +107,6 @@
display: flex;
flex-direction: row;


&:last-child {
li {
@include tablet {
Expand Down Expand Up @@ -142,7 +145,7 @@
}
}

&.checkout {
&.checkout {
h2 {
@include tablet {
margin-left: 0px;
Expand Down
Loading

0 comments on commit fb55db7

Please sign in to comment.