@akinon/pz-akifast 1.107.0 → 1.108.0-rc.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +106 -82
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @akinon/pz-akifast
|
|
2
2
|
|
|
3
|
+
## 1.108.0-rc.87
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d8be48fb: ZERO-3422: Update fetch method to use dynamic request method in wallet complete redirection middleware
|
|
8
|
+
- 16aff543: ZERO-3431: Add test script for redirect utility in package.json
|
|
9
|
+
- 64699d3ff: ZERO-2761: Fix invalid import for plugin module
|
|
10
|
+
- e974d8e8: ZERO-3406: Fix rc build
|
|
11
|
+
- 7eb51ca9: ZERO-3424 :Update package versions
|
|
12
|
+
- 7727ae55: ZERO-3073: Refactor basket page to use server-side data fetching and simplify component structure
|
|
13
|
+
- 8b1d24eb: ZERO-3422: Update fetch method to use dynamic request method in wallet complete redirection middleware
|
|
14
|
+
- 9cfbf6cd: ZERO-3397 :Update README.md to enhance button visibility management and add detailed usage examples for Checkout and Quick Login buttons
|
|
15
|
+
- 33377cfd: ZERO-3267: Refactor import statement for ROUTES in error-page component
|
|
16
|
+
- 33d4d0c9: ZERO-3615: remove custom not found
|
|
17
|
+
|
|
3
18
|
## 1.107.0
|
|
4
19
|
|
|
5
20
|
## 1.106.0
|
package/README.md
CHANGED
|
@@ -8,13 +8,19 @@ You can use the following command to install the extension with the latest plugi
|
|
|
8
8
|
npx @akinon/projectzero@latest --plugins
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Akifast
|
|
12
|
+
|
|
11
13
|
### Setting the Visibility of Buttons
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
All buttons are visible by default.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
Manage the visibility of buttons:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
src/settings.js
|
|
21
|
+
```
|
|
17
22
|
|
|
23
|
+
```javascript
|
|
18
24
|
module.exports = {
|
|
19
25
|
// other settings
|
|
20
26
|
plugins: {
|
|
@@ -28,71 +34,81 @@ module.exports = {
|
|
|
28
34
|
};
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
## Checkout Button Props
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
You can see other props for the button in the `pz-one-click-checkout` package.
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
| Property | Type | Required | Description |
|
|
42
|
+
| -------- | --------- | -------- | -------------------------------------- |
|
|
43
|
+
| isPdp | `boolean` | Optional | Indicates if it's a product info page. |
|
|
44
|
+
| renderer | `object` | Optional | Custom rendering functions. |
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
component={Component.AkifastCheckoutButton}
|
|
40
|
-
props={{
|
|
41
|
-
...checkoutProviderProps, // same with one click checkout props
|
|
42
|
-
isPdp: true
|
|
43
|
-
}}
|
|
44
|
-
/>;
|
|
45
|
-
```
|
|
46
|
+
## Quick Login Props
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
| Property | Type | Required | Description |
|
|
49
|
+
| ---------------- | --------- | -------- | ---------------------------------- |
|
|
50
|
+
| buttonText | `string` | Optional | Text displayed on the button. |
|
|
51
|
+
| isCaptchaVisible | `boolean` | Required | Indicates if captcha is visible. |
|
|
52
|
+
| captchaValidated | `boolean` | Required | Indicates if captcha is validated. |
|
|
53
|
+
| renderer | `object` | Optional | Custom rendering functions. |
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
55
|
+
## Renderer Props Types
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
The full type definitions for the renderer props:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
interface AkifastRendererProps {
|
|
61
|
+
quickLoginButton?: {
|
|
62
|
+
renderButton?: (props: {
|
|
63
|
+
buttonText: string;
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
onClick: () => void;
|
|
66
|
+
rest: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
67
|
+
}) => React.ReactNode;
|
|
68
|
+
};
|
|
69
|
+
checkoutButton?: {
|
|
70
|
+
renderButton?: (props: {
|
|
71
|
+
provider: ProvidersType;
|
|
72
|
+
rest: OneClickCheckoutButtonProps;
|
|
73
|
+
}) => React.ReactNode;
|
|
74
|
+
renderEmptyState?: () => React.ReactNode;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
59
77
|
```
|
|
60
78
|
|
|
61
|
-
|
|
79
|
+
### Usage Examples
|
|
62
80
|
|
|
63
81
|
Both the `CheckoutButton` and `QuickLoginButton` can be customized using the `renderer` prop. This allows you to fully customize the appearance and behavior of these components while maintaining their core functionality.
|
|
64
82
|
|
|
65
|
-
|
|
83
|
+
## Checkout Button
|
|
84
|
+
|
|
85
|
+
Summary:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
/src/views/basket/summary.tsx
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Product Info:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
/src/views/product/product-info.tsx
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Default Usage
|
|
66
98
|
|
|
67
99
|
```javascript
|
|
68
100
|
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
69
101
|
|
|
70
102
|
<PluginModule
|
|
71
|
-
component={Component.
|
|
103
|
+
component={Component.AkifastCheckoutButton}
|
|
72
104
|
props={{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
buttonText: 'Quick Login',
|
|
76
|
-
renderer: {
|
|
77
|
-
renderButton: ({ buttonText, disabled, onClick, rest }) => (
|
|
78
|
-
<button
|
|
79
|
-
className="custom-login-button"
|
|
80
|
-
disabled={disabled}
|
|
81
|
-
onClick={onClick}
|
|
82
|
-
{...rest}
|
|
83
|
-
>
|
|
84
|
-
<svg className="icon-login" viewBox="0 0 24 24">
|
|
85
|
-
{/* Your custom SVG icon */}
|
|
86
|
-
</svg>
|
|
87
|
-
{buttonText}
|
|
88
|
-
</button>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
105
|
+
...checkoutProviderProps, // same with one click checkout props
|
|
106
|
+
isPdp: true
|
|
91
107
|
}}
|
|
92
108
|
/>;
|
|
93
109
|
```
|
|
94
110
|
|
|
95
|
-
###
|
|
111
|
+
### Customized Usage with Renderer
|
|
96
112
|
|
|
97
113
|
```javascript
|
|
98
114
|
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
@@ -113,13 +129,13 @@ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
|
113
129
|
console.log('Original props:', rest);
|
|
114
130
|
}}
|
|
115
131
|
>
|
|
116
|
-
|
|
132
|
+
Hemen Satın Al
|
|
117
133
|
</button>
|
|
118
134
|
</div>
|
|
119
135
|
),
|
|
120
136
|
renderEmptyState: () => (
|
|
121
137
|
<div className="checkout-unavailable">
|
|
122
|
-
Akifast
|
|
138
|
+
Akifast ile ödeme şu an mevcut değil
|
|
123
139
|
</div>
|
|
124
140
|
)
|
|
125
141
|
}
|
|
@@ -127,44 +143,52 @@ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
|
127
143
|
/>;
|
|
128
144
|
```
|
|
129
145
|
|
|
130
|
-
##
|
|
146
|
+
## Quick Login Button
|
|
131
147
|
|
|
132
|
-
|
|
148
|
+
```bash
|
|
149
|
+
/src/views/login/index.tsx
|
|
150
|
+
```
|
|
133
151
|
|
|
134
|
-
|
|
135
|
-
| -------- | --------- | -------------------------------------- |
|
|
136
|
-
| isPdp | `boolean` | Indicates if it's a product info page. |
|
|
137
|
-
| renderer | `object` | Custom rendering functions. |
|
|
152
|
+
### Default Usage
|
|
138
153
|
|
|
139
|
-
|
|
154
|
+
```javascript
|
|
155
|
+
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
140
156
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
<PluginModule
|
|
158
|
+
component={Component.AkifastQuickLoginButton}
|
|
159
|
+
props={{
|
|
160
|
+
isCaptchaVisible,
|
|
161
|
+
captchaValidated
|
|
162
|
+
}}
|
|
163
|
+
/>;
|
|
164
|
+
```
|
|
147
165
|
|
|
148
|
-
|
|
166
|
+
### Customized Usage with Renderer
|
|
149
167
|
|
|
150
|
-
|
|
168
|
+
```javascript
|
|
169
|
+
import PluginModule, { Component } from '@akinon/next/components/plugin-module';
|
|
151
170
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
171
|
+
<PluginModule
|
|
172
|
+
component={Component.AkifastQuickLoginButton}
|
|
173
|
+
props={{
|
|
174
|
+
isCaptchaVisible,
|
|
175
|
+
captchaValidated,
|
|
176
|
+
buttonText: 'Hızlı Giriş',
|
|
177
|
+
renderer: {
|
|
178
|
+
renderButton: ({ buttonText, disabled, onClick, rest }) => (
|
|
179
|
+
<button
|
|
180
|
+
className="custom-login-button"
|
|
181
|
+
disabled={disabled}
|
|
182
|
+
onClick={onClick}
|
|
183
|
+
{...rest}
|
|
184
|
+
>
|
|
185
|
+
<svg className="icon-login" viewBox="0 0 24 24">
|
|
186
|
+
{/* Your custom SVG icon */}
|
|
187
|
+
</svg>
|
|
188
|
+
{buttonText}
|
|
189
|
+
</button>
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
}}
|
|
193
|
+
/>;
|
|
170
194
|
```
|