Skip to content

Commit

Permalink
Updated examples to make use of the buttonRadius property
Browse files Browse the repository at this point in the history
  • Loading branch information
dmengelt committed Mar 28, 2024
1 parent 66b0dee commit 145682b
Show file tree
Hide file tree
Showing 29 changed files with 113 additions and 35 deletions.
20 changes: 10 additions & 10 deletions examples/angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/angular/package.json
Expand Up @@ -19,7 +19,7 @@
"@angular/platform-browser": "^15.0.2",
"@angular/platform-browser-dynamic": "^15.2.9",
"@angular/router": "^15.2.9",
"@google-pay/button-angular": "^3.0.10",
"@google-pay/button-angular": "^3.1.0",
"@types/googlepay": "^0.7.0",
"rxjs": "~6.6.3",
"tslib": "^2.6.1",
Expand Down
10 changes: 10 additions & 0 deletions examples/angular/src/app/app.component.html
Expand Up @@ -50,6 +50,10 @@
<option value="subscribe">subscribe</option>
</select>
</label>
<label>
<span>Button radius:</span>
<input type="text" inputmode="numeric" pattern="[0-9]*" [(ngModel)]="buttonRadius" />
</label>
<label>
<span>Button locale:</span>
<select [(ngModel)]="buttonLocale">
Expand Down Expand Up @@ -97,6 +101,7 @@
environment="TEST"
[buttonType]="buttonType"
[buttonColor]="buttonColor"
[buttonRadius]="buttonRadius"
[buttonLocale]="buttonLocale"
[existingPaymentMethodRequired]="existingPaymentMethodRequired"
[paymentRequest]="{
Expand Down Expand Up @@ -124,6 +129,7 @@
environment="TEST"
[buttonType]="buttonType"
[buttonColor]="buttonColor"
[buttonRadius]="buttonRadius"
[buttonLocale]="buttonLocale"
[existingPaymentMethodRequired]="existingPaymentMethodRequired"
[paymentRequest]="{
Expand Down Expand Up @@ -153,6 +159,7 @@
environment="TEST"
[buttonType]="buttonType"
[buttonColor]="buttonColor"
[buttonRadius]="buttonRadius"
[buttonLocale]="buttonLocale"
[existingPaymentMethodRequired]="existingPaymentMethodRequired"
[paymentRequest]="{
Expand Down Expand Up @@ -197,6 +204,7 @@
environment="TEST"
[buttonType]="buttonType"
[buttonColor]="buttonColor"
[buttonRadius]="buttonRadius"
[buttonLocale]="buttonLocale"
[existingPaymentMethodRequired]="existingPaymentMethodRequired"
[paymentRequest]="{
Expand Down Expand Up @@ -229,6 +237,7 @@
environment="TEST"
[buttonType]="buttonType"
[buttonColor]="buttonColor"
[buttonRadius]="buttonRadius"
[buttonLocale]="buttonLocale"
[existingPaymentMethodRequired]="existingPaymentMethodRequired"
[paymentRequest]="{
Expand All @@ -252,6 +261,7 @@
environment="TEST"
[buttonType]="buttonType"
[buttonColor]="buttonColor"
[buttonRadius]="buttonRadius"
[buttonLocale]="buttonLocale"
[existingPaymentMethodRequired]="existingPaymentMethodRequired"
[paymentRequest]="{
Expand Down
1 change: 1 addition & 0 deletions examples/angular/src/app/app.component.ts
Expand Up @@ -26,6 +26,7 @@ export class AppComponent {
amount = '100.00';
buttonType = 'buy';
buttonColor = 'default';
buttonRadius = 4;
buttonLocale = '';
existingPaymentMethodRequired = false;

Expand Down
9 changes: 9 additions & 0 deletions examples/html/dynamic-examples.js
Expand Up @@ -35,6 +35,7 @@ const controls = {
existingPaymentRequired: new ControlAccessor('existing-payment-method-required'),
buttonColor: new ControlAccessor('button-color'),
buttonType: new ControlAccessor('button-type'),
buttonRadius: new ControlAccessor('button-radius'),
buttonLocale: new ControlAccessor('button-locale'),
};

Expand Down Expand Up @@ -95,6 +96,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand All @@ -114,6 +116,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand Down Expand Up @@ -151,6 +154,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand All @@ -172,6 +176,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand All @@ -194,6 +199,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand Down Expand Up @@ -246,6 +252,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
buttonSizeMode: 'fill',
paymentRequest: {
Expand All @@ -266,6 +273,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand All @@ -288,6 +296,7 @@ const googlePayButtons = [
return {
buttonColor: controls.buttonColor.value,
buttonType: controls.buttonType.value,
buttonRadius: controls.buttonRadius.value,
buttonLocale: controls.buttonLocale.value,
paymentRequest: {
...defaultPaymentRequest,
Expand Down
6 changes: 5 additions & 1 deletion examples/html/index.html
Expand Up @@ -57,6 +57,10 @@
<option value="subscribe">subscribe</option>
</select>
</label>
<label>
<span>Button radius:</span>
<input type="text" inputmode="numeric" pattern="[0-9]*" id="button-radius" value="4" />
</label>
<label>
<span>Button locale:</span>
<select id="button-locale">
Expand Down Expand Up @@ -98,7 +102,7 @@

<div id="examples" class="examples">
<div class="example">
<div class="title">Static Example</div>
<div class="title">Plain Example</div>
<div class="demo">
<google-pay-button id="static" environment="TEST" button-type="plain" button-color="black" button-locale="fr">
</google-pay-button>
Expand Down
37 changes: 18 additions & 19 deletions examples/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/react/src/App.tsx
Expand Up @@ -40,13 +40,15 @@ const App: React.FC = () => {
const [existingPaymentMethodRequired, setExistingPaymentMethodRequired] = useState(false);
const [buttonColor, setButtonColor] = useState('default');
const [buttonType, setButtonType] = useState('buy');
const [buttonRadius, setButtonRadius] = useState('4');
const [buttonLocale, setButtonLocale] = useState('');

const props = {
amount,
existingPaymentMethodRequired,
buttonColor,
buttonType,
buttonRadius,
buttonLocale,
};

Expand Down Expand Up @@ -88,6 +90,16 @@ const App: React.FC = () => {
<option value="subscribe">subscribe</option>
</select>
</label>
<label>
<span>Button radius:</span>
<input
type="text"
inputMode="numeric"
pattern="[0-9]*"
defaultValue={buttonRadius}
onBlur={event => setButtonRadius(event.target.value)}
/>
</label>
<label>
<span>Button locale:</span>
<select onChange={event => setButtonLocale(event.target.value)} value={buttonLocale}>
Expand Down
1 change: 1 addition & 0 deletions examples/react/src/examples/AmexExample.tsx
Expand Up @@ -60,6 +60,7 @@ export default function AmexExample(props: any): React.ReactElement {
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
</Example>
Expand Down
2 changes: 2 additions & 0 deletions examples/react/src/examples/BasicExample.tsx
Expand Up @@ -60,6 +60,7 @@ export default function BasicExample(props: any): React.ReactElement {
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
<GooglePayButton
Expand Down Expand Up @@ -101,6 +102,7 @@ export default function BasicExample(props: any): React.ReactElement {
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
</Example>
Expand Down
1 change: 1 addition & 0 deletions examples/react/src/examples/ButtonSizeExample.tsx
Expand Up @@ -60,6 +60,7 @@ export default function ButtonSizeExample(props: any): React.ReactElement {
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
style={{ width: 400, height: 60 }}
buttonSizeMode="fill"
Expand Down
1 change: 1 addition & 0 deletions examples/react/src/examples/CryptogramExample.tsx
Expand Up @@ -69,6 +69,7 @@ export default function CryptogramExample(props: any): React.ReactElement {
}}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
<div
Expand Down
1 change: 1 addition & 0 deletions examples/react/src/examples/DirectIntegrationExample.tsx
Expand Up @@ -60,6 +60,7 @@ export default function DirectIntegrationExample(props: any): React.ReactElement
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
</Example>
Expand Down
1 change: 1 addition & 0 deletions examples/react/src/examples/DisplayItemsExample.tsx
Expand Up @@ -82,6 +82,7 @@ export default function DisplayItemsExample(props: any): React.ReactElement {
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
</Example>
Expand Down
1 change: 1 addition & 0 deletions examples/react/src/examples/DynamicPriceUpdateExample.tsx
Expand Up @@ -127,6 +127,7 @@ export default function DynamicPriceUpdateExample(props: any): React.ReactElemen
existingPaymentMethodRequired={props.existingPaymentMethodRequired}
buttonColor={props.buttonColor}
buttonType={props.buttonType}
buttonRadius={props.buttonRadius}
buttonLocale={props.buttonLocale}
/>
</Example>
Expand Down

0 comments on commit 145682b

Please sign in to comment.