Compare commits
	
		
			22 Commits
		
	
	
		
			c647dfc0c2
			...
			bukopin
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0abfb5245a | |||
| 5467d91085 | |||
| 1206c4f013 | |||
| ffaae28e64 | |||
| 9b915d22c6 | |||
| d46407cc68 | |||
| 26e6047805 | |||
| 470a70cb1f | |||
| ba8629005e | |||
| ba84c86493 | |||
| 9169538996 | |||
| 9f0c68b2ce | |||
| 0ebe039eda | |||
| d72b4c3b5c | |||
|  | 0015c0b654 | ||
|  | 50a12fe2fd | ||
| 0c0e321b05 | |||
| 4bbeb66ea6 | |||
| 97acead5f1 | |||
| 9b18340242 | |||
| 87c81c2416 | |||
|  | b5d734c959 | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -49,3 +49,6 @@ settings.json | |||||||
| dist/ | dist/ | ||||||
|  |  | ||||||
| public/assets | public/assets | ||||||
|  | public/static | ||||||
|  | public/static/**/*.js | ||||||
|  | public/static/**/*.js.map | ||||||
|   | |||||||
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,10 +1,15 @@ | |||||||
| # mobx-ssr-example | #BTN Registration | ||||||
| Server-side rendering with mobx and react-router |  | ||||||
|  | ####Build and run | ||||||
|  |  | ||||||
|  | edit `/src/common/config/app.js` according to your server | ||||||
|  | ``` | ||||||
|  | apiUrl = "https://giift-api.asacreative.com/"; | ||||||
|  | imageUrl = "https://giift-api.asacreative.com"; | ||||||
|  | ``` | ||||||
|  |  | ||||||
| #Build and run |  | ||||||
| ``` | ``` | ||||||
| npm install | npm install | ||||||
| gulp app | npm run build2:parcel:prod | ||||||
| node src/index.js |  | ||||||
| ``` | ``` | ||||||
| Runs an express server on port 3000 | the compiled file will be available in dist folder | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								assets/images/kb_bukopin.jpeg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/images/kb_bukopin.jpeg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 56 KiB | 
							
								
								
									
										23
									
								
								k8s/staging/deployment.yaml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										23
									
								
								k8s/staging/deployment.yaml
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | apiVersion: apps/v1 | ||||||
|  | kind: Deployment | ||||||
|  | metadata: | ||||||
|  |   name: bukopin-redemption-client-react | ||||||
|  |   namespace: bukopin-staging | ||||||
|  | spec: | ||||||
|  |   selector: | ||||||
|  |     matchLabels: | ||||||
|  |       app: bukopin-redemption-client-react | ||||||
|  |   replicas: 1 | ||||||
|  |   template: | ||||||
|  |     metadata: | ||||||
|  |       labels: | ||||||
|  |         app: bukopin-redemption-client-react | ||||||
|  |     spec: | ||||||
|  |       containers: | ||||||
|  |         - name: bukopin-redemption-client-react | ||||||
|  |           image: registry-harbor.app.bangun-kreatif.com/bukopin/bukopin-redemption-client-react:<VERSION> | ||||||
|  |           ports: | ||||||
|  |             - containerPort: 8080 | ||||||
|  |       imagePullSecrets: | ||||||
|  |         - name: regcred | ||||||
|  |  | ||||||
							
								
								
									
										25
									
								
								k8s/staging/ingress.yaml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										25
									
								
								k8s/staging/ingress.yaml
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | apiVersion: networking.k8s.io/v1 | ||||||
|  | kind: Ingress | ||||||
|  | metadata: | ||||||
|  |   name: bukopin-redemption-client-react | ||||||
|  |   namespace: bukopin-staging | ||||||
|  |   annotations: | ||||||
|  |     kubernetes.io/ingress.class: "traefik" | ||||||
|  |     cert-manager.io/cluster-issuer: letsencrypt-prod | ||||||
|  |     traefik.ingress.kubernetes.io/router.middlewares: bukopin-staging-redirect-https@kubernetescrd | ||||||
|  | spec: | ||||||
|  |   rules: | ||||||
|  |     - host: "bukopin-fe.k3s.bangun-kreatif.com" | ||||||
|  |       http: | ||||||
|  |         paths: | ||||||
|  |           - pathType: Prefix | ||||||
|  |             path: / | ||||||
|  |             backend: | ||||||
|  |               service: | ||||||
|  |                 name: bukopin-redemption-client-react | ||||||
|  |                 port: | ||||||
|  |                   number: 8080 | ||||||
|  |   tls: | ||||||
|  |     - hosts: | ||||||
|  |         - "bukopin-fe.k3s.bangun-kreatif.com" | ||||||
|  |       secretName: bukopin-fe-k3s-bangun-kreatif-com-tls | ||||||
							
								
								
									
										9
									
								
								k8s/staging/middleware.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								k8s/staging/middleware.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  | apiVersion: traefik.containo.us/v1alpha1 | ||||||
|  | kind: Middleware | ||||||
|  | metadata: | ||||||
|  |   name: redirect-https | ||||||
|  |   namespace: bukopin-staging | ||||||
|  | spec: | ||||||
|  |   redirectScheme: | ||||||
|  |     scheme: https | ||||||
|  |     permanent: true | ||||||
							
								
								
									
										4
									
								
								k8s/staging/namespace.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								k8s/staging/namespace.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | |||||||
|  | apiVersion: v1 | ||||||
|  | kind: Namespace | ||||||
|  | metadata: | ||||||
|  |   name: bukopin-staging | ||||||
							
								
								
									
										13
									
								
								k8s/staging/service.yaml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								k8s/staging/service.yaml
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | apiVersion: v1 | ||||||
|  | kind: Service | ||||||
|  | metadata: | ||||||
|  |   name: bukopin-redemption-client-react | ||||||
|  |   namespace: bukopin-staging | ||||||
|  |   labels: | ||||||
|  |     run: bukopin-redemption-client-react | ||||||
|  | spec: | ||||||
|  |   ports: | ||||||
|  |     - port: 8080 | ||||||
|  |       protocol: TCP | ||||||
|  |   selector: | ||||||
|  |     app:  bukopin-redemption-client-react | ||||||
							
								
								
									
										65
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										65
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -4377,11 +4377,6 @@ | |||||||
|       "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", |       "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", | ||||||
|       "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==" |       "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==" | ||||||
|     }, |     }, | ||||||
|     "commander": { |  | ||||||
|       "version": "2.2.0", |  | ||||||
|       "resolved": "http://registry.npmjs.org/commander/-/commander-2.2.0.tgz", |  | ||||||
|       "integrity": "sha1-F1rUuTF/P/YV8gHB5XIk9Vo+kd8=" |  | ||||||
|     }, |  | ||||||
|     "commondir": { |     "commondir": { | ||||||
|       "version": "1.0.1", |       "version": "1.0.1", | ||||||
|       "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", |       "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", | ||||||
| @@ -6327,10 +6322,6 @@ | |||||||
|       "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.2.0.tgz", |       "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.2.0.tgz", | ||||||
|       "integrity": "sha1-EChTPSwcNj90pnlv9X7AUg3tK+E=" |       "integrity": "sha1-EChTPSwcNj90pnlv9X7AUg3tK+E=" | ||||||
|     }, |     }, | ||||||
|     "exploder": { |  | ||||||
|       "version": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0", |  | ||||||
|       "from": "git://github.com/cezary/exploder.git" |  | ||||||
|     }, |  | ||||||
|     "express": { |     "express": { | ||||||
|       "version": "4.16.4", |       "version": "4.16.4", | ||||||
|       "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", |       "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", | ||||||
| @@ -7001,7 +6992,8 @@ | |||||||
|         }, |         }, | ||||||
|         "ansi-regex": { |         "ansi-regex": { | ||||||
|           "version": "2.1.1", |           "version": "2.1.1", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "aproba": { |         "aproba": { | ||||||
|           "version": "1.2.0", |           "version": "1.2.0", | ||||||
| @@ -7019,11 +7011,13 @@ | |||||||
|         }, |         }, | ||||||
|         "balanced-match": { |         "balanced-match": { | ||||||
|           "version": "1.0.0", |           "version": "1.0.0", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "brace-expansion": { |         "brace-expansion": { | ||||||
|           "version": "1.1.11", |           "version": "1.1.11", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "balanced-match": "^1.0.0", |             "balanced-match": "^1.0.0", | ||||||
|             "concat-map": "0.0.1" |             "concat-map": "0.0.1" | ||||||
| @@ -7036,15 +7030,18 @@ | |||||||
|         }, |         }, | ||||||
|         "code-point-at": { |         "code-point-at": { | ||||||
|           "version": "1.1.0", |           "version": "1.1.0", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "concat-map": { |         "concat-map": { | ||||||
|           "version": "0.0.1", |           "version": "0.0.1", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "console-control-strings": { |         "console-control-strings": { | ||||||
|           "version": "1.1.0", |           "version": "1.1.0", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "core-util-is": { |         "core-util-is": { | ||||||
|           "version": "1.0.2", |           "version": "1.0.2", | ||||||
| @@ -7147,7 +7144,8 @@ | |||||||
|         }, |         }, | ||||||
|         "inherits": { |         "inherits": { | ||||||
|           "version": "2.0.3", |           "version": "2.0.3", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "ini": { |         "ini": { | ||||||
|           "version": "1.3.5", |           "version": "1.3.5", | ||||||
| @@ -7157,6 +7155,7 @@ | |||||||
|         "is-fullwidth-code-point": { |         "is-fullwidth-code-point": { | ||||||
|           "version": "1.0.0", |           "version": "1.0.0", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "number-is-nan": "^1.0.0" |             "number-is-nan": "^1.0.0" | ||||||
|           } |           } | ||||||
| @@ -7169,17 +7168,20 @@ | |||||||
|         "minimatch": { |         "minimatch": { | ||||||
|           "version": "3.0.4", |           "version": "3.0.4", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "brace-expansion": "^1.1.7" |             "brace-expansion": "^1.1.7" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         "minimist": { |         "minimist": { | ||||||
|           "version": "0.0.8", |           "version": "0.0.8", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "minipass": { |         "minipass": { | ||||||
|           "version": "2.3.5", |           "version": "2.3.5", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "safe-buffer": "^5.1.2", |             "safe-buffer": "^5.1.2", | ||||||
|             "yallist": "^3.0.0" |             "yallist": "^3.0.0" | ||||||
| @@ -7196,6 +7198,7 @@ | |||||||
|         "mkdirp": { |         "mkdirp": { | ||||||
|           "version": "0.5.1", |           "version": "0.5.1", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "minimist": "0.0.8" |             "minimist": "0.0.8" | ||||||
|           } |           } | ||||||
| @@ -7268,7 +7271,8 @@ | |||||||
|         }, |         }, | ||||||
|         "number-is-nan": { |         "number-is-nan": { | ||||||
|           "version": "1.0.1", |           "version": "1.0.1", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "object-assign": { |         "object-assign": { | ||||||
|           "version": "4.1.1", |           "version": "4.1.1", | ||||||
| @@ -7278,6 +7282,7 @@ | |||||||
|         "once": { |         "once": { | ||||||
|           "version": "1.4.0", |           "version": "1.4.0", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "wrappy": "1" |             "wrappy": "1" | ||||||
|           } |           } | ||||||
| @@ -7353,7 +7358,8 @@ | |||||||
|         }, |         }, | ||||||
|         "safe-buffer": { |         "safe-buffer": { | ||||||
|           "version": "5.1.2", |           "version": "5.1.2", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "safer-buffer": { |         "safer-buffer": { | ||||||
|           "version": "2.1.2", |           "version": "2.1.2", | ||||||
| @@ -7383,6 +7389,7 @@ | |||||||
|         "string-width": { |         "string-width": { | ||||||
|           "version": "1.0.2", |           "version": "1.0.2", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "code-point-at": "^1.0.0", |             "code-point-at": "^1.0.0", | ||||||
|             "is-fullwidth-code-point": "^1.0.0", |             "is-fullwidth-code-point": "^1.0.0", | ||||||
| @@ -7400,6 +7407,7 @@ | |||||||
|         "strip-ansi": { |         "strip-ansi": { | ||||||
|           "version": "3.0.1", |           "version": "3.0.1", | ||||||
|           "bundled": true, |           "bundled": true, | ||||||
|  |           "optional": true, | ||||||
|           "requires": { |           "requires": { | ||||||
|             "ansi-regex": "^2.0.0" |             "ansi-regex": "^2.0.0" | ||||||
|           } |           } | ||||||
| @@ -7438,11 +7446,13 @@ | |||||||
|         }, |         }, | ||||||
|         "wrappy": { |         "wrappy": { | ||||||
|           "version": "1.0.2", |           "version": "1.0.2", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         }, |         }, | ||||||
|         "yallist": { |         "yallist": { | ||||||
|           "version": "3.0.3", |           "version": "3.0.3", | ||||||
|           "bundled": true |           "bundled": true, | ||||||
|  |           "optional": true | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
| @@ -11899,14 +11909,6 @@ | |||||||
|       "resolved": "https://registry.npmjs.org/numbro/-/numbro-1.11.1.tgz", |       "resolved": "https://registry.npmjs.org/numbro/-/numbro-1.11.1.tgz", | ||||||
|       "integrity": "sha512-qL0Etqbunz4RtPx4bNjMONe9HyUpgbrM4Sa3VpWY5oRdp9ry5DufAj6lCvnIcluRBA9QUacrllYc73QK0G6VAw==" |       "integrity": "sha512-qL0Etqbunz4RtPx4bNjMONe9HyUpgbrM4Sa3VpWY5oRdp9ry5DufAj6lCvnIcluRBA9QUacrllYc73QK0G6VAw==" | ||||||
|     }, |     }, | ||||||
|     "nwbuild": { |  | ||||||
|       "version": "0.0.5", |  | ||||||
|       "resolved": "https://registry.npmjs.org/nwbuild/-/nwbuild-0.0.5.tgz", |  | ||||||
|       "integrity": "sha1-9Gc+85BMJzqxzaX0/fx8D4qEpAM=", |  | ||||||
|       "requires": { |  | ||||||
|         "commander": "2.2.0" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "oauth-sign": { |     "oauth-sign": { | ||||||
|       "version": "0.9.0", |       "version": "0.9.0", | ||||||
|       "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", |       "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", | ||||||
| @@ -14769,8 +14771,11 @@ | |||||||
|       "version": "0.1.0", |       "version": "0.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/react-gif/-/react-gif-0.1.0.tgz", |       "resolved": "https://registry.npmjs.org/react-gif/-/react-gif-0.1.0.tgz", | ||||||
|       "integrity": "sha1-/A21vUnTHdRRnIVRAp+zXTtk04E=", |       "integrity": "sha1-/A21vUnTHdRRnIVRAp+zXTtk04E=", | ||||||
|       "requires": { |       "dependencies": { | ||||||
|         "exploder": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0" |         "exploder": { | ||||||
|  |           "version": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0", | ||||||
|  |           "from": "git://github.com/cezary/exploder.git#721e1a2f777ff5dafe853981ca21b8874aae1fb0" | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "react-google-charts": { |     "react-google-charts": { | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|   "description": "Server-side rendering with mobx and react-router", |   "description": "Server-side rendering with mobx and react-router", | ||||||
|   "main": "src/index.js", |   "main": "src/index.js", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "start": "node src/index.js", |     "start": "node -r esm src/index.js", | ||||||
|     "babel-node": "node node_modules/@babel/node/bin/babel-node.js --presets=@babel/preset-env --plugins=@babel/plugin-transform-runtime", |     "babel-node": "node node_modules/@babel/node/bin/babel-node.js --presets=@babel/preset-env --plugins=@babel/plugin-transform-runtime", | ||||||
|     "watch:client": "webpack --watch", |     "watch:client": "webpack --watch", | ||||||
|     "watch:server": "npm run babel-node -- ./src/index.js", |     "watch:server": "npm run babel-node -- ./src/index.js", | ||||||
| @@ -55,6 +55,7 @@ | |||||||
|     "cssnano": "^4.1.8", |     "cssnano": "^4.1.8", | ||||||
|     "debug": "^4.1.1", |     "debug": "^4.1.1", | ||||||
|     "decimal.js-light": "^2.3.1", |     "decimal.js-light": "^2.3.1", | ||||||
|  |     "esm": "^3.2.25", | ||||||
|     "exenv": "^1.2.2", |     "exenv": "^1.2.2", | ||||||
|     "express": "^4.16.2", |     "express": "^4.16.2", | ||||||
|     "faker": "^4.1.0", |     "faker": "^4.1.0", | ||||||
| @@ -90,7 +91,6 @@ | |||||||
|     "mobx-react": "^5.4.3", |     "mobx-react": "^5.4.3", | ||||||
|     "mobx-react-devtools": "^6.0.3", |     "mobx-react-devtools": "^6.0.3", | ||||||
|     "moment": "^2.24.0", |     "moment": "^2.24.0", | ||||||
|     "nwbuild": "0.0.5", |  | ||||||
|     "parcel-bundler": "^1.11.0", |     "parcel-bundler": "^1.11.0", | ||||||
|     "prop-types": "^15.6.2", |     "prop-types": "^15.6.2", | ||||||
|     "raw-loader": "^0.5.1", |     "raw-loader": "^0.5.1", | ||||||
| @@ -108,7 +108,6 @@ | |||||||
|     "react-easy-print": "^0.6.0-beta.3", |     "react-easy-print": "^0.6.0-beta.3", | ||||||
|     "react-flexible-carousel": "^1.2.6", |     "react-flexible-carousel": "^1.2.6", | ||||||
|     "react-froala-wysiwyg": "^2.8.4", |     "react-froala-wysiwyg": "^2.8.4", | ||||||
|     "react-gif": "^0.1.0", |  | ||||||
|     "react-google-charts": "^3.0.8", |     "react-google-charts": "^3.0.8", | ||||||
|     "react-grid-gallery": "^0.5.2", |     "react-grid-gallery": "^0.5.2", | ||||||
|     "react-handsontable": "^0.3.1", |     "react-handsontable": "^0.3.1", | ||||||
|   | |||||||
| @@ -2,9 +2,9 @@ | |||||||
| <html> | <html> | ||||||
| <head> | <head> | ||||||
|     <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|     <title>BTN</title> |     <title>KB Bukopin</title> | ||||||
|   <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||||||
|     <link rel="icon" type="image/png" href="/assets/images/logo-bankbtn.png" sizes="96x96" /> |     <link rel="icon" type="image/png" href="/assets/images/kb_bukopin.jpeg" sizes="96x96" /> | ||||||
|     <style> |     <style> | ||||||
|         body { |         body { | ||||||
|             visibility: hidden; |             visibility: hidden; | ||||||
|   | |||||||
| @@ -2,9 +2,9 @@ | |||||||
| <html> | <html> | ||||||
| <head> | <head> | ||||||
|     <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|     <title>BTN</title> |     <title>KB Bukopin</title> | ||||||
|   <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||||||
|     <link rel="icon" type="image/png" href="/assets/images/logo-bankbtn.png" sizes="96x96" /> |     <link rel="icon" type="image/png" href="/assets/images/kb_bukopin.jpeg" sizes="96x96" /> | ||||||
|     <style> |     <style> | ||||||
|         body { |         body { | ||||||
|             visibility: hidden; |             visibility: hidden; | ||||||
|   | |||||||
| @@ -2,9 +2,9 @@ | |||||||
| <html> | <html> | ||||||
| <head> | <head> | ||||||
|     <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|     <title>BTN</title> |     <title>KB Bukopin</title> | ||||||
|   <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||||||
|     <link rel="icon" type="image/png" href="/assets/images/logo-bankbtn.png" sizes="96x96" /> |     <link rel="icon" type="image/png" href="/assets/images/kb_bukopin.jpeg" sizes="96x96" /> | ||||||
|     <style> |     <style> | ||||||
|         body { |         body { | ||||||
|             visibility: hidden; |             visibility: hidden; | ||||||
|   | |||||||
| @@ -2,9 +2,9 @@ | |||||||
| <html> | <html> | ||||||
| <head> | <head> | ||||||
|     <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|     <title>BTN</title> |     <title>KB Bukopin</title> | ||||||
|   <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |     <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||||||
|     <link rel="icon" type="image/png" href="/assets/images/logo-bankbtn.png" sizes="96x96" /> |     <link rel="icon" type="image/png" href="/assets/images/kb_bukopin.jpeg" sizes="96x96" /> | ||||||
|     <style> |     <style> | ||||||
|         body { |         body { | ||||||
|             visibility: hidden; |             visibility: hidden; | ||||||
|   | |||||||
							
								
								
									
										568088
									
								
								public/static/bundle.js
									
									
									
									
									
								
							
							
						
						
									
										568088
									
								
								public/static/bundle.js
									
									
									
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -24,13 +24,13 @@ let type = 'akuntiket'; | |||||||
| // apiUrl = "https://marketplace-sillyfish-api.asacreative.com/v1/"; | // apiUrl = "https://marketplace-sillyfish-api.asacreative.com/v1/"; | ||||||
| // imageUrl = "https://marketplace-sillyfish-api.asacreative.com"; | // imageUrl = "https://marketplace-sillyfish-api.asacreative.com"; | ||||||
|  |  | ||||||
| apiUrl = "https://giift-api.asacreative.com/"; | apiUrl = "https://herbal-backend.k3s.bangun-kreatif.com/v1/"; | ||||||
| imageUrl = "https://giift-api.asacreative.com"; | imageUrl = "https://herbal-backend.k3s.bangun-kreatif.com/v1/"; | ||||||
|  |  | ||||||
| type = 'localhost'; | type = 'localhost'; | ||||||
| if(window.location.href.includes("localhost") || window.location.href.includes("marketplace-store")){ | if(window.location.href.includes("localhost") || window.location.href.includes("marketplace-store")){ | ||||||
|   // appUrl = 'http://localhost:7700'; |   // appUrl = 'http://localhost:7700'; | ||||||
|   apiUrl = "https://giift-api.asacreative.com/"; |   // apiUrl = "https://giift-api.asacreative.com/"; | ||||||
|   // apiUrl = "http://localhost:4001/" |   // apiUrl = "http://localhost:4001/" | ||||||
| }else{ | }else{ | ||||||
|   // appUrl = 'https://sillyfish.asacreative.com'; |   // appUrl = 'https://sillyfish.asacreative.com'; | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ import { | |||||||
|   // Drawer, |   // Drawer, | ||||||
|   // List, |   // List, | ||||||
|   // ListItem, |   // ListItem, | ||||||
|   // IconMenu, |   IconMenu, | ||||||
|   // IconButton, |   // IconButton, | ||||||
|   // MenuItem, |   // MenuItem, | ||||||
|   DropDownMenu, |   DropDownMenu, | ||||||
| @@ -29,8 +29,8 @@ import { | |||||||
|   Dialog, |   Dialog, | ||||||
|   Snackbar, |   Snackbar, | ||||||
|   // Toolbar, |   // Toolbar, | ||||||
|   // ToolbarGroup, |   ToolbarGroup, | ||||||
|   // ToolbarSeparator, |   ToolbarSeparator, | ||||||
|   // ToolbarTitle, |   // ToolbarTitle, | ||||||
|   // Badge |   // Badge | ||||||
| } from 'material-ui'; | } from 'material-ui'; | ||||||
| @@ -260,10 +260,6 @@ class App extends React.Component { | |||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   openCreateProjectDialog() { |  | ||||||
|  |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   handleToggleIcon = () => this.setState({ open: !this.state.open }); |   handleToggleIcon = () => this.setState({ open: !this.state.open }); | ||||||
|   handleToggleIconSecondary = () => this.setState({ openSecondary: !this.state.openSecondary }); |   handleToggleIconSecondary = () => this.setState({ openSecondary: !this.state.openSecondary }); | ||||||
|   handleClose = () => this.setState({ open: false }); |   handleClose = () => this.setState({ open: false }); | ||||||
| @@ -373,8 +369,8 @@ class App extends React.Component { | |||||||
|     let applicationIcon = require('../../../../assets/images/logo_new.png'); |     let applicationIcon = require('../../../../assets/images/logo_new.png'); | ||||||
|     let applicationName = 'Giift'; |     let applicationName = 'Giift'; | ||||||
|     if (APP_TYPE === 'btn') { |     if (APP_TYPE === 'btn') { | ||||||
|       applicationIcon = "http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png"; |       applicationIcon = "https://www.niaga.asia/wp-content/uploads/2021/02/IMG-20210223-WA0025.jpg"; | ||||||
|       applicationName = "BTN"; |       applicationName = "KB Bukopin"; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     let onNotifRowClick = (record) => { |     let onNotifRowClick = (record) => { | ||||||
| @@ -564,7 +560,7 @@ class App extends React.Component { | |||||||
|         <WithdrawDialog /> |         <WithdrawDialog /> | ||||||
|  |  | ||||||
|         <div className={classes.root}> |         <div className={classes.root}> | ||||||
|           <AppBar position="fixed"> |           <AppBar style={{ zIndex: 1 }} position="fixed"> | ||||||
|             <Toolbar className={classes.toolbar}> |             <Toolbar className={classes.toolbar}> | ||||||
|               <div className={classes.sectionMobile}> |               <div className={classes.sectionMobile}> | ||||||
|                 <IconButton className={classes.menuButton} color="action" aria-label="Open drawer" onClick={this.toggleDrawerNew(true)}> |                 <IconButton className={classes.menuButton} color="action" aria-label="Open drawer" onClick={this.toggleDrawerNew(true)}> | ||||||
| @@ -577,8 +573,8 @@ class App extends React.Component { | |||||||
|                 <img |                 <img | ||||||
|                   className={classes.title} |                   className={classes.title} | ||||||
|                   style={{ |                   style={{ | ||||||
|                     width: 100, |                     width: 70, | ||||||
|                     height: 30 |                     height: 40 | ||||||
|                   }} |                   }} | ||||||
|                   src={applicationIcon} /> |                   src={applicationIcon} /> | ||||||
|               </Link> |               </Link> | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ export const styles = theme => ({ | |||||||
|         width: "100%", |         width: "100%", | ||||||
|         top: 0, |         top: 0, | ||||||
|         zIndex: 1000, |         zIndex: 1000, | ||||||
|         backgroundColor: yellow['500'], |         backgroundColor: '#FAAF03', | ||||||
|         height: '70px !important', |         height: '70px !important', | ||||||
|         padding: "8px 24px", |         padding: "8px 24px", | ||||||
|         borderBottom: "1px solid rgb(223, 223, 223)" |         borderBottom: "1px solid rgb(223, 223, 223)" | ||||||
| @@ -94,4 +94,4 @@ export const styles = theme => ({ | |||||||
|       fullList: { |       fullList: { | ||||||
|         width: 'auto', |         width: 'auto', | ||||||
|       }, |       }, | ||||||
| }); | }); | ||||||
|   | |||||||
| @@ -74,12 +74,6 @@ export default class ConfirmationCompletedComponent extends React.Component{ | |||||||
|                             <Hidden smDown> |                             <Hidden smDown> | ||||||
|                                 <Grid item xs={6}> |                                 <Grid item xs={6}> | ||||||
|                                     <img src={require('../../../../assets/images/login/register_image_2.png')} width={"80%"}/> |                                     <img src={require('../../../../assets/images/login/register_image_2.png')} width={"80%"}/> | ||||||
|                                     <Typography style={{color : '#FFF'}} variant={"h6"}> |  | ||||||
|                                         Selamat Datang di BTN Point |  | ||||||
|                                     </Typography> |  | ||||||
|                                     <Typography style={{color : '#FFF'}} variant={"subtitle2"}> |  | ||||||
|                                         Daftar untuk mendapatkan berbagai macam manfaat dan keuntungan |  | ||||||
|                                     </Typography> |  | ||||||
|                                 </Grid> |                                 </Grid> | ||||||
|                             </Hidden> |                             </Hidden> | ||||||
|                             <Grid item xs={12} sm={12} md={6} style={{paddingLeft : 50,paddingRight : 50}}> |                             <Grid item xs={12} sm={12} md={6} style={{paddingLeft : 50,paddingRight : 50}}> | ||||||
| @@ -88,7 +82,22 @@ export default class ConfirmationCompletedComponent extends React.Component{ | |||||||
|                                   Konfirmasi Berhasil |                                   Konfirmasi Berhasil | ||||||
|                                 </Typography> |                                 </Typography> | ||||||
|                                 <Typography variant="body1" gutterBottom> |                                 <Typography variant="body1" gutterBottom> | ||||||
|                                   Terima Kasih, mohon cek email anda untuk langkah selanjutnya |                                   Mohon cek email Anda untuk melihat hadiah. Dapatkan tambahan hadiah dan benefit lainnya dengan menjadi nasabah BTN. | ||||||
|  |                                   {/*<Typography style={{color : '#000'}} variant={"h6"}>*/} | ||||||
|  |                                     {/*Selamat Datang di BTN Shop*/} | ||||||
|  |                                   {/*</Typography>*/} | ||||||
|  |                                   {/*<Typography style={{color : '#000'}} variant={"subtitle2"}>*/} | ||||||
|  |                                     {/*Dapatkan tambahan hadiah dan benefit lainnya dengan menjadi nasabah BTN, Silahkan klik disini*/} | ||||||
|  |                                   {/*</Typography>*/} | ||||||
|  |                                   <a href="https://open-account.btn.co.id/form.html" target={"_blank"}> | ||||||
|  |  | ||||||
|  |                                     <Button | ||||||
|  |                                       variant="contained" | ||||||
|  |                                       style={{ backgroundColor: '#ffeb3b', marginTop: '15px' }}> | ||||||
|  |                                       Jadi Nasabah BTN | ||||||
|  |                                     </Button> | ||||||
|  |  | ||||||
|  |                                   </a> | ||||||
|                                   {/*We have sent an email with a confirmation link to your email address. Please allow 5-10 minutes for this message to arrive.*/} |                                   {/*We have sent an email with a confirmation link to your email address. Please allow 5-10 minutes for this message to arrive.*/} | ||||||
|                                 </Typography> |                                 </Typography> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ import {lowerCase,debounce} from 'lodash'; | |||||||
| // import 'froala-editor/css/froala_style.min.css'; | // import 'froala-editor/css/froala_style.min.css'; | ||||||
| // import 'froala-editor/css/froala_editor.pkgd.min.css'; | // import 'froala-editor/css/froala_editor.pkgd.min.css'; | ||||||
| const $ = require("jquery"); | const $ = require("jquery"); | ||||||
| require("froala-editor/js/froala_editor.pkgd.min.js")($); | // require("froala-editor/js/froala_editor.pkgd.min.js")($); | ||||||
| window.$ = window.jQuery = $; | window.$ = window.jQuery = $; | ||||||
| // require("froala-editor/js/froala_editor.pkgd.min.js")($); | // require("froala-editor/js/froala_editor.pkgd.min.js")($); | ||||||
| // require("froala-editor/js/plugins/code_view.min.js")($); | // require("froala-editor/js/plugins/code_view.min.js")($); | ||||||
| @@ -109,14 +109,14 @@ export default class Form extends React.Component { | |||||||
|   async componentDidMount() { |   async componentDidMount() { | ||||||
|     console.log(this.props.match.params.id,'ini id params') |     console.log(this.props.match.params.id,'ini id params') | ||||||
|     window.scrollTo(0, 0); |     window.scrollTo(0, 0); | ||||||
|      |  | ||||||
|     this.contentManagerStore.getTags(); |     this.contentManagerStore.getTags(); | ||||||
|     // this.contentManagerStore.getTypes(); |     // this.contentManagerStore.getTypes(); | ||||||
|     this.contentManagerStore.clearItems(); |     this.contentManagerStore.clearItems(); | ||||||
|     if(this.props.match.params.id){ |     if(this.props.match.params.id){ | ||||||
|       this.contentManagerStore.getDetail(this.props.match.params.id).then(res => {   |       this.contentManagerStore.getDetail(this.props.match.params.id).then(res => { | ||||||
|         console.log(this.contentManagerStore.selected.title,this.contentManagerStore.selected.content,'res detail') |         console.log(this.contentManagerStore.selected.title,this.contentManagerStore.selected.content,'res detail') | ||||||
|          |  | ||||||
|         let newArray = this.contentManagerStore.selected.additional_data.items.map(it => it); |         let newArray = this.contentManagerStore.selected.additional_data.items.map(it => it); | ||||||
|         let newTagsArray =this.contentManagerStore.selected.tags.map(it => it); |         let newTagsArray =this.contentManagerStore.selected.tags.map(it => it); | ||||||
|  |  | ||||||
| @@ -157,7 +157,7 @@ export default class Form extends React.Component { | |||||||
|     // setTimeout(() => { |     // setTimeout(() => { | ||||||
|     //   $('.fr-wrapper').children[0].style.display = 'none'; |     //   $('.fr-wrapper').children[0].style.display = 'none'; | ||||||
|     // }, 1000); |     // }, 1000); | ||||||
|      |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   handleModelChange = (model) => { |   handleModelChange = (model) => { | ||||||
| @@ -209,14 +209,14 @@ export default class Form extends React.Component { | |||||||
|         .catch(err => { |         .catch(err => { | ||||||
|           this.globalUI.openSnackbar(err.message); |           this.globalUI.openSnackbar(err.message); | ||||||
|           console.error(err, 'ini errornya'); |           console.error(err, 'ini errornya'); | ||||||
|            |  | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|      |  | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   deleteData = () => { |   deleteData = () => { | ||||||
|      |  | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   searchItem = ()=>{ |   searchItem = ()=>{ | ||||||
| @@ -245,10 +245,10 @@ export default class Form extends React.Component { | |||||||
|         .catch(err => { |         .catch(err => { | ||||||
|           this.globalUI.openSnackbar(err.message); |           this.globalUI.openSnackbar(err.message); | ||||||
|           console.error(err, 'ini errornya'); |           console.error(err, 'ini errornya'); | ||||||
|            |  | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|      |  | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   handleBackClose = () => { |   handleBackClose = () => { | ||||||
| @@ -314,7 +314,7 @@ export default class Form extends React.Component { | |||||||
|         console.log("new fileList",newFileList); |         console.log("new fileList",newFileList); | ||||||
|         this.setState({fileList : newFileList}); |         this.setState({fileList : newFileList}); | ||||||
|       }) |       }) | ||||||
|        |  | ||||||
|  |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -469,10 +469,10 @@ export default class Form extends React.Component { | |||||||
|           } |           } | ||||||
|         }, () => { |         }, () => { | ||||||
|           console.log("value",this.state.formData.additional_data[key]); |           console.log("value",this.state.formData.additional_data[key]); | ||||||
|            |  | ||||||
|           console.log("value2",v); |           console.log("value2",v); | ||||||
|           console.log("key",key); |           console.log("key",key); | ||||||
|            |  | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
|     }); |     }); | ||||||
| @@ -675,10 +675,10 @@ export default class Form extends React.Component { | |||||||
|                           )} |                           )} | ||||||
|                         </div> |                         </div> | ||||||
|                       ) : ('')} |                       ) : ('')} | ||||||
|                        |  | ||||||
|                       {this.props.match.params.id ? (<ButtonAntd type={'primary'} style={{width: '100%', marginTop: 25}} onClick={this.handleOpen} icon={'save'}>Save</ButtonAntd>) : (<ButtonAntd type={'primary'} style={{width: '100%', marginTop: 25}} onClick={this.handleOpen} icon={'upload'}>Publish</ButtonAntd>)} |                       {this.props.match.params.id ? (<ButtonAntd type={'primary'} style={{width: '100%', marginTop: 25}} onClick={this.handleOpen} icon={'save'}>Save</ButtonAntd>) : (<ButtonAntd type={'primary'} style={{width: '100%', marginTop: 25}} onClick={this.handleOpen} icon={'upload'}>Publish</ButtonAntd>)} | ||||||
|                        |  | ||||||
|                        |  | ||||||
|                     </div> |                     </div> | ||||||
|                   </Card> |                   </Card> | ||||||
|                 </Affix> |                 </Affix> | ||||||
|   | |||||||
| @@ -199,7 +199,7 @@ class DashboardComponent extends React.Component { | |||||||
|                       Voucher |                       Voucher | ||||||
|                     </Typography> |                     </Typography> | ||||||
|                     <Typography component="p"> |                     <Typography component="p"> | ||||||
|                       <NumberFormat value={(0).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} /> |                       <NumberFormat value={(this.props.appstate.wallet.data.wallet).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '} /> | ||||||
|                     </Typography> |                     </Typography> | ||||||
|                   </MuiCardContent> |                   </MuiCardContent> | ||||||
|                   <MuiCardActions> |                   <MuiCardActions> | ||||||
| @@ -330,7 +330,8 @@ class DashboardComponent extends React.Component { | |||||||
|               style={{ marginTop: 15 }}> |               style={{ marginTop: 15 }}> | ||||||
|               {(this.vouchersStore.list.length > 0) ? |               {(this.vouchersStore.list.length > 0) ? | ||||||
|                 this.vouchersStore.list.map((item, index) => { |                 this.vouchersStore.list.map((item, index) => { | ||||||
|                   let image = get(item, 'images.logo', ''); |                   console.log("itemm", item) | ||||||
|  |                   let image = get(item, 'images.main', ''); | ||||||
|  |  | ||||||
|                   if (!image.includes('http')) { |                   if (!image.includes('http')) { | ||||||
|                     image = this.http.appendImagePath(image); |                     image = this.http.appendImagePath(image); | ||||||
|   | |||||||
| @@ -46,7 +46,7 @@ export default class LoginComponent extends React.Component { | |||||||
|  |  | ||||||
|     let loginImage = 'http://giift.asacreative.com/giift_logo_wide.4d15de72.png'; |     let loginImage = 'http://giift.asacreative.com/giift_logo_wide.4d15de72.png'; | ||||||
|     if(APP_TYPE === 'btn') { |     if(APP_TYPE === 'btn') { | ||||||
|       loginImage = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png' |       loginImage = 'https://www.niaga.asia/wp-content/uploads/2021/02/IMG-20210223-WA0025.jpg' | ||||||
|     } |     } | ||||||
|     return ( |     return ( | ||||||
|       <div className="loginWrapper"> |       <div className="loginWrapper"> | ||||||
|   | |||||||
| @@ -30,7 +30,7 @@ export const styles = theme => ({ | |||||||
|     }, |     }, | ||||||
|     logoContainer : { |     logoContainer : { | ||||||
|         textAlign : 'center', |         textAlign : 'center', | ||||||
|         background : yellow['500'], |         background : '#FAAF03', | ||||||
|         padding : 20 |         padding : 20 | ||||||
|     } |     } | ||||||
| }); | }); | ||||||
|   | |||||||
| @@ -73,7 +73,7 @@ export default class ComponentName extends React.Component { | |||||||
|           //   description: 'Please check your email to continue' |           //   description: 'Please check your email to continue' | ||||||
|           // }); |           // }); | ||||||
|           this.props.history.push({ |           this.props.history.push({ | ||||||
|             pathname:LINKS.REGISTER_COMPLETED |             pathname:LINKS.VOUCHERS | ||||||
|           }); |           }); | ||||||
|           this.setState({isLoading: false, isSuccess: true}) |           this.setState({isLoading: false, isSuccess: true}) | ||||||
|           // this |           // this | ||||||
|   | |||||||
| @@ -75,7 +75,7 @@ export default class RegisterCompletedComponent extends React.Component{ | |||||||
|                                 <Grid item xs={6}> |                                 <Grid item xs={6}> | ||||||
|                                     <img src={require('../../../../assets/images/login/register_image_2.png')} width={"80%"}/> |                                     <img src={require('../../../../assets/images/login/register_image_2.png')} width={"80%"}/> | ||||||
|                                     <Typography style={{color : '#FFF'}} variant={"h6"}> |                                     <Typography style={{color : '#FFF'}} variant={"h6"}> | ||||||
|                                         Selamat Datang di BTN Point |                                         Selamat Datang di KB Bukopin | ||||||
|                                     </Typography> |                                     </Typography> | ||||||
|                                     <Typography style={{color : '#FFF'}} variant={"subtitle2"}> |                                     <Typography style={{color : '#FFF'}} variant={"subtitle2"}> | ||||||
|                                         Daftar untuk mendapatkan berbagai macam manfaat dan keuntungan |                                         Daftar untuk mendapatkan berbagai macam manfaat dan keuntungan | ||||||
| @@ -85,10 +85,11 @@ export default class RegisterCompletedComponent extends React.Component{ | |||||||
|                             <Grid item xs={12} sm={12} md={6} style={{paddingLeft : 50,paddingRight : 50}}> |                             <Grid item xs={12} sm={12} md={6} style={{paddingLeft : 50,paddingRight : 50}}> | ||||||
|                               <Paper className={classes.formRegister}> |                               <Paper className={classes.formRegister}> | ||||||
|                                 <Typography variant="h6" gutterBottom> |                                 <Typography variant="h6" gutterBottom> | ||||||
|                                   Pendaftaran Berhasil |                                   Selamat anda telah berhasil terdaftar | ||||||
|                                 </Typography> |                                 </Typography> | ||||||
|                                 <Typography variant="body1" gutterBottom> |                                 <Typography variant="body1" gutterBottom> | ||||||
|                                   Kami telah mengirim sebuah surat elektronik yang berisi tautan untuk konfirmasi pendaftaran ke email anda, harap menunggu 5 sampai 10 menit untuk surat sampai |                                   Mohon cek email Anda untuk konfirmasi pendaftaran | ||||||
|  |                                   {/*Kami telah mengirim sebuah email yang berisi tautan untuk konfirmasi pendaftaran ke email anda, harap menunggu 5 sampai 10 menit untuk surat sampai*/} | ||||||
|                                   {/*We have sent an email with a confirmation link to your email address. Please allow 5-10 minutes for this message to arrive.*/} |                                   {/*We have sent an email with a confirmation link to your email address. Please allow 5-10 minutes for this message to arrive.*/} | ||||||
|                                 </Typography> |                                 </Typography> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -45,6 +45,9 @@ class RegisterPage extends React.Component { | |||||||
|         errors: { |         errors: { | ||||||
|           email_exists: '', |           email_exists: '', | ||||||
|           phone_exists: '', |           phone_exists: '', | ||||||
|  |           referal_not_found: '', | ||||||
|  |           no_ktp: '', | ||||||
|  |           no_rekening: '' | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
|         // form |         // form | ||||||
| @@ -54,6 +57,7 @@ class RegisterPage extends React.Component { | |||||||
|         password: "", |         password: "", | ||||||
|         full_name: "", |         full_name: "", | ||||||
|         no_ktp: '', |         no_ktp: '', | ||||||
|  |         no_rekening: '', | ||||||
|         upload_ktp: '', |         upload_ktp: '', | ||||||
|         upload_photo: '', |         upload_photo: '', | ||||||
|         address: '', |         address: '', | ||||||
| @@ -115,6 +119,17 @@ class RegisterPage extends React.Component { | |||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     handleChange = name => event => { |     handleChange = name => event => { | ||||||
|  |         if((name === 'no_ktp' || name === 'no_rekening') && (this.state.errors.no_ktp !== '' && this.state.errors.no_rekening !== '')){ | ||||||
|  |             this.setState({ | ||||||
|  |                 errors:{ | ||||||
|  |                     ...this.state.errors, | ||||||
|  |                     no_ktp: '', | ||||||
|  |                     no_rekening: '' | ||||||
|  |                 } | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |       {console.log("namee", name)} | ||||||
|         this.setState({ |         this.setState({ | ||||||
|             [name]: event.target.value, |             [name]: event.target.value, | ||||||
|         }); |         }); | ||||||
| @@ -163,6 +178,16 @@ class RegisterPage extends React.Component { | |||||||
|          }) |          }) | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         if(this.state.no_ktp === '' && this.state.no_rekening === ''){ | ||||||
|  |             return this.setState({ | ||||||
|  |                 errors: { | ||||||
|  |                   ...this.state.errors, | ||||||
|  |                   no_ktp: 'Salah satu harus diisi', | ||||||
|  |                   no_rekening: 'Salah satu harus diisi' | ||||||
|  |                 } | ||||||
|  |               }) | ||||||
|  |         } | ||||||
|  |  | ||||||
|         this.setState({ isLoading: true }); |         this.setState({ isLoading: true }); | ||||||
|  |  | ||||||
|         let data = { |         let data = { | ||||||
| @@ -180,39 +205,50 @@ class RegisterPage extends React.Component { | |||||||
|             // subdistrict_id: this.state.subdistrict, |             // subdistrict_id: this.state.subdistrict, | ||||||
|             // zip_code: this.state.zip_code, |             // zip_code: this.state.zip_code, | ||||||
|             referal: this.state.query.referal, |             referal: this.state.query.referal, | ||||||
|             additional_data: {} |             additional_data: { | ||||||
|         }; |                 no_rekening : this.state.no_rekening | ||||||
|         this.authStore.register(data).then(res => { |  | ||||||
|             //message.success("Please check your email to confirm your account");this.props.history.push(LINKS.LOGIN); |  | ||||||
|             setTimeout(() => { |  | ||||||
|                 this.setState({ isLoading: false }); |  | ||||||
|               this.props.history.push(LINKS.REGISTER_COMPLETED); |  | ||||||
|             //     this.props.history.push(LINKS.LOGIN); |  | ||||||
|             }, 250); |  | ||||||
|         }).catch(err => { |  | ||||||
|             this.setState({ isLoading: false }); |  | ||||||
|  |  | ||||||
|             if (err.type === 'BodyValidationError') { |  | ||||||
|               message.error(err.detail[0].message); |  | ||||||
|             } else { |  | ||||||
|               if (err.message.toLowerCase().includes('email')) { |  | ||||||
|                 this.setState({ |  | ||||||
|                   errors: { |  | ||||||
|                     ...this.state.errors, |  | ||||||
|                     email_exists: 'Email sudah terdaftar' |  | ||||||
|                   } |  | ||||||
|                 }) |  | ||||||
|               } else if (err.message.toLowerCase().includes('phone number')) { |  | ||||||
|                 this.setState({ |  | ||||||
|                   errors: { |  | ||||||
|                     ...this.state.errors, |  | ||||||
|                     phone_exists: 'Nomer handphone sudah terdaftar' |  | ||||||
|                   } |  | ||||||
|                 }) |  | ||||||
|               } |  | ||||||
|               // message.error(err.message); |  | ||||||
|             } |             } | ||||||
|         }); |         }; | ||||||
|  |         this.props.history.push(LINKS.VOUCHERS); | ||||||
|  |         // this.authStore.register(data).then(res => { | ||||||
|  |         //     //message.success("Please check your email to confirm your account");this.props.history.push(LINKS.LOGIN); | ||||||
|  |         //     setTimeout(() => { | ||||||
|  |         //         this.setState({ isLoading: false }); | ||||||
|  |         //       this.props.history.push(LINKS.REGISTER_COMPLETED); | ||||||
|  |         //     //     this.props.history.push(LINKS.LOGIN); | ||||||
|  |         //     }, 250); | ||||||
|  |         // }).catch(err => { | ||||||
|  |         //     this.setState({ isLoading: false }); | ||||||
|  |         // | ||||||
|  |         //     if (err.type === 'BodyValidationError') { | ||||||
|  |         //       message.error(err.detail[0].message); | ||||||
|  |         //     } else { | ||||||
|  |         //       if (err.message.toLowerCase().includes('email')) { | ||||||
|  |         //         this.setState({ | ||||||
|  |         //           errors: { | ||||||
|  |         //             ...this.state.errors, | ||||||
|  |         //             email_exists: 'Email sudah terdaftar' | ||||||
|  |         //           } | ||||||
|  |         //         }) | ||||||
|  |         //       } else if (err.message.toLowerCase().includes('phone number')) { | ||||||
|  |         //         this.setState({ | ||||||
|  |         //           errors: { | ||||||
|  |         //             ...this.state.errors, | ||||||
|  |         //             phone_exists: 'Nomer handphone sudah terdaftar' | ||||||
|  |         //           } | ||||||
|  |         //         }) | ||||||
|  |         //       } else if (err.message.toLowerCase().includes('referal')) { | ||||||
|  |         //         this.setState({ | ||||||
|  |         //           errors: { | ||||||
|  |         //             ...this.state.errors, | ||||||
|  |         //             referal_not_found: 'Kode Referal Salah - Silahkan Hubungi Petugas BTN' | ||||||
|  |         //           } | ||||||
|  |         //         }) | ||||||
|  |         //       } else { | ||||||
|  |         //         message.error(err.message); | ||||||
|  |         //       } | ||||||
|  |         //     } | ||||||
|  |         // }); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     handleChangeUploadKtp = (info) => { |     handleChangeUploadKtp = (info) => { | ||||||
| @@ -324,7 +360,7 @@ class RegisterPage extends React.Component { | |||||||
|  |  | ||||||
|                 <Grid container spacing={0} className={classes.gridContainer}> |                 <Grid container spacing={0} className={classes.gridContainer}> | ||||||
|                     <Grid item cols={12} className={classes.logoContainer}> |                     <Grid item cols={12} className={classes.logoContainer}> | ||||||
|                         <img src={require('../../../../assets/images/logo_new.png')} className={classes.logo} /> |                         <img src={require('../../../../assets/images/kb_bukopin.jpeg')} className={classes.logo} /> | ||||||
|                     </Grid> |                     </Grid> | ||||||
|                     <Grid item xs={12} sm={12} md={10} lg={10} className={classes.registerContainer} style={{ |                     <Grid item xs={12} sm={12} md={10} lg={10} className={classes.registerContainer} style={{ | ||||||
|                       alignSelf: 'center' |                       alignSelf: 'center' | ||||||
| @@ -334,10 +370,10 @@ class RegisterPage extends React.Component { | |||||||
|                                 <Grid item xs={5}> |                                 <Grid item xs={5}> | ||||||
|                                     <img src={require('../../../../assets/images/register_image_2.png')} width={"80%"} /> |                                     <img src={require('../../../../assets/images/register_image_2.png')} width={"80%"} /> | ||||||
|                                     <Typography style={{ color: '#FFF' }} variant={"h6"}> |                                     <Typography style={{ color: '#FFF' }} variant={"h6"}> | ||||||
|                                         Selamat Datang di BTN Shop! |                                         Selamat Datang di Bukopin Shop! | ||||||
|                                     </Typography> |                                     </Typography> | ||||||
|                                     <Typography style={{ color: '#FFF' }} variant={"subtitle2"}> |                                     <Typography style={{ color: '#FFF' }} variant={"subtitle2"}> | ||||||
|                                         Dapatkan promo dan keuntungan lebih dari BTN! |                                         Dapatkan promo dan keuntungan lebih dari Bukopin! | ||||||
|                                     </Typography> |                                     </Typography> | ||||||
|                                 </Grid> |                                 </Grid> | ||||||
|                             </Hidden> |                             </Hidden> | ||||||
| @@ -354,7 +390,7 @@ class RegisterPage extends React.Component { | |||||||
|                                         flexDirection: 'row' |                                         flexDirection: 'row' | ||||||
|                                     }}> |                                     }}> | ||||||
|                                         <Grid container spacing={16}> |                                         <Grid container spacing={16}> | ||||||
|                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> |                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 7, paddingRight: 5 }}> | ||||||
|                                                 <TextField |                                                 <TextField | ||||||
|                                                     id="name" |                                                     id="name" | ||||||
|                                                     label="Nama Lengkap" |                                                     label="Nama Lengkap" | ||||||
| @@ -366,7 +402,7 @@ class RegisterPage extends React.Component { | |||||||
|                                                     fullWidth |                                                     fullWidth | ||||||
|                                                 /> |                                                 /> | ||||||
|                                             </Grid> |                                             </Grid> | ||||||
|                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> |                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 7 }}> | ||||||
|                                                 <TextField |                                                 <TextField | ||||||
|                                                     id="phone" |                                                     id="phone" | ||||||
|                                                     label="Nomor Handphone" |                                                     label="Nomor Handphone" | ||||||
| @@ -381,7 +417,7 @@ class RegisterPage extends React.Component { | |||||||
|                                                 /> |                                                 /> | ||||||
|                                             </Grid> |                                             </Grid> | ||||||
|  |  | ||||||
|                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> |                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 7, paddingRight: 5 }}> | ||||||
|                                                 <TextField |                                                 <TextField | ||||||
|                                                     id="email" |                                                     id="email" | ||||||
|                                                     label="Email" |                                                     label="Email" | ||||||
| @@ -394,7 +430,7 @@ class RegisterPage extends React.Component { | |||||||
|                                                     helperText={this.state.errors.email_exists} |                                                     helperText={this.state.errors.email_exists} | ||||||
|                                                 /> |                                                 /> | ||||||
|                                             </Grid> |                                             </Grid> | ||||||
|                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 5 }}> |                                             <Grid item xs={12} sm={12} md={6} style={{ paddingLeft: 5, paddingRight: 7 }}> | ||||||
|                                                 <TextField |                                                 <TextField | ||||||
|                                                     id="ktp" |                                                     id="ktp" | ||||||
|                                                     label="Nomor KTP" |                                                     label="Nomor KTP" | ||||||
| @@ -404,6 +440,8 @@ class RegisterPage extends React.Component { | |||||||
|                                                     type={"number"} |                                                     type={"number"} | ||||||
|                                                     variant="outlined" |                                                     variant="outlined" | ||||||
|                                                     fullWidth |                                                     fullWidth | ||||||
|  |                                                     error={!!this.state.errors.no_ktp} | ||||||
|  |                                                     helperText={this.state.errors.no_ktp} | ||||||
|                                                 /> |                                                 /> | ||||||
|                                             </Grid> |                                             </Grid> | ||||||
|  |  | ||||||
| @@ -560,6 +598,19 @@ class RegisterPage extends React.Component { | |||||||
|                                             {/*</Grid>*/} |                                             {/*</Grid>*/} | ||||||
|                                         </Grid> |                                         </Grid> | ||||||
|                                     </div> |                                     </div> | ||||||
|  |                                     <Grid item xs={12} sm={12} md={12}> | ||||||
|  |                                       <TextField | ||||||
|  |                                         label="Nomor Rekening" | ||||||
|  |                                         value={this.state.no_rekening} | ||||||
|  |                                         onChange={this.handleChange('no_rekening')} | ||||||
|  |                                         margin="normal" | ||||||
|  |                                         type={"number"} | ||||||
|  |                                         fullWidth | ||||||
|  |                                         error={!!this.state.errors.no_rekening} | ||||||
|  |                                         helperText={this.state.errors.no_rekening} | ||||||
|  |                                         variant="outlined" | ||||||
|  |                                       /> | ||||||
|  |                                     </Grid> | ||||||
|  |  | ||||||
|                                     <Grid item xs={12} sm={12} md={12}> |                                     <Grid item xs={12} sm={12} md={12}> | ||||||
|                                       <TextField |                                       <TextField | ||||||
| @@ -576,6 +627,8 @@ class RegisterPage extends React.Component { | |||||||
|                                         margin="normal" |                                         margin="normal" | ||||||
|                                         type={"password"} |                                         type={"password"} | ||||||
|                                         fullWidth |                                         fullWidth | ||||||
|  |                                         error={!!this.state.errors.referal_not_found} | ||||||
|  |                                         helperText={this.state.errors.referal_not_found || 'Hubungi petugas untuk mendapatkan hadiah'} | ||||||
|                                         variant="outlined" |                                         variant="outlined" | ||||||
|                                       /> |                                       /> | ||||||
|                                     </Grid> |                                     </Grid> | ||||||
| @@ -583,11 +636,13 @@ class RegisterPage extends React.Component { | |||||||
|                                     <div style={{ padding: 5, marginTop: 20 }}> |                                     <div style={{ padding: 5, marginTop: 20 }}> | ||||||
|                                         <Button |                                         <Button | ||||||
|                                           fullWidth |                                           fullWidth | ||||||
|                                           variant="contained" style={{ backgroundColor: '#ffeb3b',marginBottom: 16 }} onClick={this.register}> |                                           variant="contained" style={{ backgroundColor: '#FAAF03' }} onClick={this.register}> | ||||||
|                                             {this.state.isLoading ? <CircularProgress className={classes.progress} /> : "Daftar"} |                                             {this.state.isLoading ? <CircularProgress className={classes.progress} /> : "Daftar"} | ||||||
|                                         </Button> |                                         </Button> | ||||||
|  |  | ||||||
|                                       <Typography variant="subtitle2" gutterBottom> |                                       <Typography variant="subtitle2" gutterBottom style={{ | ||||||
|  |                                         marginTop: 16 | ||||||
|  |                                       }}> | ||||||
|                                       Belum menerima email? <Link to={"/resend_email"} replace>Kirim ulang email</Link> |                                       Belum menerima email? <Link to={"/resend_email"} replace>Kirim ulang email</Link> | ||||||
|                                       </Typography> |                                       </Typography> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ export const styles = theme => ({ | |||||||
|         flex :1, |         flex :1, | ||||||
|         flexGrow : 1, |         flexGrow : 1, | ||||||
|         height : "100vh", |         height : "100vh", | ||||||
|         backgroundColor:'#024f8e', |         backgroundColor:'#FEFAF0', | ||||||
|         marginTop: '-56px', |         marginTop: '-56px', | ||||||
|     }, |     }, | ||||||
|     gridContainer : { |     gridContainer : { | ||||||
| @@ -31,7 +31,7 @@ export const styles = theme => ({ | |||||||
|     }, |     }, | ||||||
|     logoContainer : { |     logoContainer : { | ||||||
|         textAlign : 'center', |         textAlign : 'center', | ||||||
|         background : yellow['500'], |         background : '#FAAF03', | ||||||
|         padding : 20 |         padding : 20 | ||||||
|     }, |     }, | ||||||
| }); | }); | ||||||
|   | |||||||
| @@ -3,8 +3,22 @@ import {observer, inject} from 'mobx-react'; | |||||||
| import Routes, { LINKS } from "../../routes"; | import Routes, { LINKS } from "../../routes"; | ||||||
| import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; | import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; | ||||||
| import getMuiTheme from 'material-ui/styles/getMuiTheme'; | import getMuiTheme from 'material-ui/styles/getMuiTheme'; | ||||||
|  | import { MuiThemeProvider as MuiThemeProviderNew, createMuiTheme } from '@material-ui/core/styles'; | ||||||
| import typography from 'material-ui/styles/typography'; | import typography from 'material-ui/styles/typography'; | ||||||
|  |  | ||||||
|  | const theme = createMuiTheme({ | ||||||
|  |   typography: { | ||||||
|  |     // Use the system font instead of the default Roboto font. | ||||||
|  |     fontFamily: [ | ||||||
|  |       'Montserrat', | ||||||
|  |       'Roboto', | ||||||
|  |       '-apple-system', | ||||||
|  |       'BlinkMacSystemFont', | ||||||
|  |       '"Segoe UI"' | ||||||
|  |     ].join(','), | ||||||
|  |   } | ||||||
|  | }); | ||||||
|  |  | ||||||
| @inject('appstate') | @inject('appstate') | ||||||
| @observer | @observer | ||||||
| export default class ComponentName extends React.Component { | export default class ComponentName extends React.Component { | ||||||
| @@ -60,7 +74,9 @@ export default class ComponentName extends React.Component { | |||||||
|     return ( |     return ( | ||||||
|       <div> |       <div> | ||||||
|         <MuiThemeProvider muiTheme={muiTheme}> |         <MuiThemeProvider muiTheme={muiTheme}> | ||||||
|         <Routes></Routes> |           <MuiThemeProviderNew theme={theme}> | ||||||
|  |             <Routes></Routes> | ||||||
|  |           </MuiThemeProviderNew> | ||||||
|         </MuiThemeProvider> |         </MuiThemeProvider> | ||||||
|       </div> |       </div> | ||||||
|     ) |     ) | ||||||
|   | |||||||
| @@ -40,10 +40,11 @@ export default class ItemList extends React.Component { | |||||||
|               <p className={'transactionDate'}>{moment(data.updated_at).format("dddd, MMMM Do YYYY, HH:mm:ss")}</p> |               <p className={'transactionDate'}>{moment(data.updated_at).format("dddd, MMMM Do YYYY, HH:mm:ss")}</p> | ||||||
|             </div> |             </div> | ||||||
|             <div className={'bodyContainer'}> |             <div className={'bodyContainer'}> | ||||||
|               <p className={'nameText'}>{data.item.name + " : " + data.item_sku.name}</p> |               <p className={'nameText'}>{data.item.name}</p> | ||||||
|               <div className={'childContainer'}> |               <div className={'childContainer'}> | ||||||
|                 <p className={'childTitle'}>Price</p> |                 <p className={'childTitle'}>Price</p> | ||||||
|                 <p className={'childText'}>{(+data.item_sku.price).toFixed(0)} Points</p> |                 {/*<p className={'childText'}>{(+data.price).toFixed(0)} Points</p>*/} | ||||||
|  |                 <p className={'childText'}>{data.price} Points</p> | ||||||
|               </div> |               </div> | ||||||
|               <div className={'childContainer'}> |               <div className={'childContainer'}> | ||||||
|                 <p className={'childTitle'}>Voucher Code</p> |                 <p className={'childTitle'}>Voucher Code</p> | ||||||
|   | |||||||
| @@ -29,41 +29,35 @@ export default class TransactionPage extends React.Component { | |||||||
|         created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |         created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), | ||||||
|         updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |         updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), | ||||||
|         deleted_at: null, |         deleted_at: null, | ||||||
|         name: faker.commerce.productName(), |         item: { | ||||||
|         status: 'Transaction Success', |           name: faker.commerce.productName(), | ||||||
|         price: faker.commerce.price(), |         }, | ||||||
|  |         item_sku: { | ||||||
|  |           name: faker.commerce.productName(), | ||||||
|  |         }, | ||||||
|  |         transaction: { | ||||||
|  |           status: 'Transaction Success', | ||||||
|  |         }, | ||||||
|  |         price: faker.commerce.price(1000, 1000000, 0, ''), | ||||||
|         voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`, |         voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`, | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|         transaction_id: `INV/20190101/VII/X/${faker.random.alphaNumeric(6).toUpperCase()}`, |         transaction_id: `INV/20190101/VII/X/${faker.random.alphaNumeric(6).toUpperCase()}`, | ||||||
|         created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |         created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), | ||||||
|         updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |         updated_at: moment(faker.date.past(5, '2020-01-01T00:00:00.000Z')).format("dddd, MMMM Do YYYY, HH:mm:ss"), | ||||||
|         deleted_at: null, |         deleted_at: null, | ||||||
|         name: faker.commerce.productName(), |         item: { | ||||||
|         status: 'Transaction Success', |           name: faker.commerce.productName(), | ||||||
|  |         }, | ||||||
|  |         item_sku: { | ||||||
|  |           name: faker.commerce.productName(), | ||||||
|  |         }, | ||||||
|  |         transaction: { | ||||||
|  |           status: 'Transaction Success', | ||||||
|  |         }, | ||||||
|         price: faker.commerce.price(), |         price: faker.commerce.price(), | ||||||
|         voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`, |         voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`, | ||||||
|       }, |       } | ||||||
|       { |  | ||||||
|         transaction_id: `INV/20190101/VII/X/${faker.random.alphaNumeric(6).toUpperCase()}`, |  | ||||||
|         created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |  | ||||||
|         updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |  | ||||||
|         deleted_at: null, |  | ||||||
|         name: faker.commerce.productName(), |  | ||||||
|         status: 'Transaction Success', |  | ||||||
|         price: faker.commerce.price(), |  | ||||||
|         voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`, |  | ||||||
|       }, |  | ||||||
|       { |  | ||||||
|         transaction_id: `INV/20190101/VII/X/${faker.random.alphaNumeric(6).toUpperCase()}`, |  | ||||||
|         created_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |  | ||||||
|         updated_at: moment(faker.date.past()).format("dddd, MMMM Do YYYY, HH:mm:ss"), |  | ||||||
|         deleted_at: null, |  | ||||||
|         name: faker.commerce.productName(), |  | ||||||
|         status: 'Transaction Success', |  | ||||||
|         price: faker.commerce.price(), |  | ||||||
|         voucher_code: `${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()} - ${faker.random.alphaNumeric(5).toUpperCase()}`, |  | ||||||
|       }, |  | ||||||
|     ]; |     ]; | ||||||
|  |  | ||||||
|     return( |     return( | ||||||
| @@ -91,8 +85,8 @@ export default class TransactionPage extends React.Component { | |||||||
|  |  | ||||||
|           <div className={'listContainer'}> |           <div className={'listContainer'}> | ||||||
|             { |             { | ||||||
|               (this.purchasedVoucher.data.length > 0) ? |               (data.length > 0) ? | ||||||
|                 this.purchasedVoucher.data.map(item => { |                 data.map(item => { | ||||||
|                   return <ItemList data={item}/> |                   return <ItemList data={item}/> | ||||||
|                 }) : |                 }) : | ||||||
|                 ( |                 ( | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ | |||||||
|   align-items: center; |   align-items: center; | ||||||
|  |  | ||||||
|   .parentContainer{ |   .parentContainer{ | ||||||
|     width: 40vw; |     width: 60vw; | ||||||
|  |  | ||||||
|     .barContainer{ |     .barContainer{ | ||||||
|       display: flex; |       display: flex; | ||||||
|   | |||||||
| @@ -46,7 +46,7 @@ export class CheckoutVouchers extends React.Component { | |||||||
|  |  | ||||||
|   render() { |   render() { | ||||||
|     const {classes} = this.props; |     const {classes} = this.props; | ||||||
|     const logoUrl = (this.props.vouchersStore.dataItems.images.logo) ? get(this.vouchersStore.dataItems, 'images.logo', '') : 'http://lorempixel.com/400/200'; |     const logoUrl = (this.props.vouchersStore.dataItems.images.main) ? get(this.vouchersStore.dataItems, 'images.main', '') : 'http://lorempixel.com/400/200'; | ||||||
|  |  | ||||||
|     let image = logoUrl; |     let image = logoUrl; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| @media(min-width: 1000px){ | @media(min-width: 1000px){ | ||||||
|   .imageCard{ |   .imageCard{ | ||||||
|     width: 20vw; |     width: 20vw; | ||||||
|     height: 25vh; |     height: 35vh; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   .upper-card{ |   .upper-card{ | ||||||
|   | |||||||
| @@ -29,12 +29,16 @@ export class ItemCard extends React.Component { | |||||||
|   render() { |   render() { | ||||||
|     const {data = {}} = this.props; |     const {data = {}} = this.props; | ||||||
|  |  | ||||||
|     let image = get(data, 'images.logo', ''); |     // console.log({data}) | ||||||
|  |  | ||||||
|  |     let image = get(data, 'images.main', ''); | ||||||
|  |  | ||||||
|     if (!image.includes('http')) { |     if (!image.includes('http')) { | ||||||
|       image = this.http.appendImagePath(image); |       image = this.http.appendImagePath(image); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     console.log({image}) | ||||||
|  |  | ||||||
|     return ( |     return ( | ||||||
|       <Card className={'itemCard'}> |       <Card className={'itemCard'}> | ||||||
|         <img className={'imageCard'} src={image}/> |         <img className={'imageCard'} src={image}/> | ||||||
|   | |||||||
| @@ -40,7 +40,7 @@ export default class ModalVouchersComponent extends React.Component { | |||||||
|   render() { |   render() { | ||||||
|     const {item} = this.props.appstate; |     const {item} = this.props.appstate; | ||||||
|     const {data = {}, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Modal'} = this.props; |     const {data = {}, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Modal'} = this.props; | ||||||
|     let image = get(data, 'images.logo', ''); |     let image = get(data, 'images.main', ''); | ||||||
|  |  | ||||||
|     if (!image.includes('http')) { |     if (!image.includes('http')) { | ||||||
|       image = this.http.appendImagePath(image); |       image = this.http.appendImagePath(image); | ||||||
| @@ -102,38 +102,45 @@ export default class ModalVouchersComponent extends React.Component { | |||||||
|                 placeholder="Please Select your Option" |                 placeholder="Please Select your Option" | ||||||
|                 optionFilterProp="children" |                 optionFilterProp="children" | ||||||
|                 onChange={(value) => { |                 onChange={(value) => { | ||||||
|  |                   console.log({value}) | ||||||
|                   this.setState({selectedOption: value}); |                   this.setState({selectedOption: value}); | ||||||
|                   this.setState({hidden: 'none'}); |                   this.setState({hidden: 'none'}); | ||||||
|                   // console.log('onChange',value); |                   // console.log('onChange',value); | ||||||
|                   const points = item.selectedData.sku.filter(item => item.id == value); |                   // const points = item.selectedData.sku.filter(item => item.id == value); | ||||||
|                   this.setState({ |                   this.setState({ | ||||||
|                     skuName :points[0].name, |                     skuName : get(data, 'name', '').name, | ||||||
|                     skuPrice : points[0].price, |                     skuPrice : get(data, 'regular_price', '0.0'), | ||||||
|                     buttonDisbaled:false |                     buttonDisbaled: false | ||||||
|                   }) |                   }) | ||||||
|                 } |                 }} | ||||||
|                 } |  | ||||||
|                 onDropdownVisibleChange={(value) => { |                 onDropdownVisibleChange={(value) => { | ||||||
|                   this.setState({hidden: 'inline'}) |                   this.setState({hidden: 'inline'}) | ||||||
|                 }} |                 }} | ||||||
|               > |               > | ||||||
|                 {(item.selectedData.sku || []).map((item, index) => { |                 {(item.selectedData.sku || [{ | ||||||
|  |                   vouchers: [{count: +get(data, 'stock', '0.0')}], | ||||||
|  |                   price: get(data, 'regular_price', '0.0'), | ||||||
|  |                   id: get(data, 'id', ''), | ||||||
|  |                   name: get(data, 'name', '') | ||||||
|  |                 }]).map((selectedItem, index) => { | ||||||
|                   // const {vouchers:[{count}]} = item; |                   // const {vouchers:[{count}]} = item; | ||||||
|  |  | ||||||
|  |                   console.log({item: selectedItem}) | ||||||
|  |  | ||||||
|                   let count = 1; |                   let count = 1; | ||||||
|  |  | ||||||
|                   if (data.source === 'internal') { |                   if (data.source === 'internal') { | ||||||
|                     count = get(item, 'vouchers[0].count', 0) || 0; |                     count = get(selectedItem, 'vouchers[0].count', 0) || 0; | ||||||
|                   } |                   } | ||||||
|                   console.log(count); |                   console.log(count); | ||||||
|                   const outOfStock = !(+count > 0); |                   const outOfStock = !(+count > 0); | ||||||
|  |  | ||||||
|                   return ( |                   return ( | ||||||
|                     <Option disabled={outOfStock} value={item.id}> |                     <Option disabled={outOfStock} value={selectedItem.id}> | ||||||
|                       <div style={{display:'flex',justifyContent:'space-between', width:'100%'}}> |                       <div style={{display:'flex',justifyContent:'space-between', width:'100%'}}> | ||||||
|                         <span>{item.name} {outOfStock ? " - Out of Stock" : ""}</span> |                         <span>{selectedItem.name} {outOfStock ? " - Out of Stock" : ""}</span> | ||||||
|                         <span style={{color:'#FF6F00', display:this.state.hidden}}> |                         <span style={{color:'#FF6F00', display:this.state.hidden}}> | ||||||
|                         Rp. <NumberFormat value={(+item.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/> |                         Rp. <NumberFormat value={(+selectedItem.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/> | ||||||
|                       </span> |                       </span> | ||||||
|                       </div> |                       </div> | ||||||
|                     </Option> |                     </Option> | ||||||
| @@ -144,7 +151,9 @@ export default class ModalVouchersComponent extends React.Component { | |||||||
|               <div className={'costContainerModal'}> |               <div className={'costContainerModal'}> | ||||||
|                 <div className={'costLeftPaneModal'}> |                 <div className={'costLeftPaneModal'}> | ||||||
|                   <p className={'costTitleModal'}>Points</p> |                   <p className={'costTitleModal'}>Points</p> | ||||||
|                   <p className={'costValueModal'}><NumberFormat value={(+this.state.skuPrice).toFixed(0)} displayType={'text'} thousandSeparator={true}/> </p> |                   <p className={'costValueModal'}> | ||||||
|  |                     <NumberFormat value={(+this.state.skuPrice).toFixed(0)} displayType={'text'} thousandSeparator={true}/> | ||||||
|  |                   </p> | ||||||
|                 </div> |                 </div> | ||||||
|                 <div className={'costRightPaneModal'}> |                 <div className={'costRightPaneModal'}> | ||||||
|                   <Route render={({ history}) => ( |                   <Route render={({ history}) => ( | ||||||
| @@ -205,38 +214,45 @@ export default class ModalVouchersComponent extends React.Component { | |||||||
|                 placeholder="Please Select your Option" |                 placeholder="Please Select your Option" | ||||||
|                 optionFilterProp="children" |                 optionFilterProp="children" | ||||||
|                 onChange={(value) => { |                 onChange={(value) => { | ||||||
|  |                   console.log({value}) | ||||||
|                   this.setState({selectedOption: value}); |                   this.setState({selectedOption: value}); | ||||||
|                   this.setState({hidden: 'none'}); |                   this.setState({hidden: 'none'}); | ||||||
|                   // console.log('onChange',value); |                   // console.log('onChange',value); | ||||||
|                   const points = item.selectedData.sku.filter(item => item.id == value); |                   const points = item.selectedData.sku.filter(item => item.id == value); | ||||||
|                   this.setState({ |                   this.setState({ | ||||||
|                     skuName :points[0].name, |                     skuName : get(data, 'name', '').name, | ||||||
|                     skuPrice : points[0].price, |                     skuPrice : get(data, 'regular_price', '0.0'), | ||||||
|                     buttonDisbaled:false |                     buttonDisbaled: false | ||||||
|                   }) |                   }) | ||||||
|                 } |                 }} | ||||||
|                 } |  | ||||||
|                 onDropdownVisibleChange={(value) => { |                 onDropdownVisibleChange={(value) => { | ||||||
|                   this.setState({hidden: 'inline'}) |                   this.setState({hidden: 'inline'}) | ||||||
|                 }} |                 }} | ||||||
|               > |               > | ||||||
|                 {(item.selectedData.sku || []).map((item, index) => { |                 {(item.selectedData.sku || [{ | ||||||
|  |                   vouchers: [{count: +get(data, 'stock', '0.0')}], | ||||||
|  |                   price: get(data, 'regular_price', '0.0'), | ||||||
|  |                   id: get(data, 'id', ''), | ||||||
|  |                   name: get(data, 'name', '') | ||||||
|  |                 }]).map((selectedItem, index) => { | ||||||
|                   // const {vouchers:[{count}]} = item; |                   // const {vouchers:[{count}]} = item; | ||||||
|  |  | ||||||
|  |                   console.log({item: selectedItem}) | ||||||
|  |  | ||||||
|                   let count = 1; |                   let count = 1; | ||||||
|  |  | ||||||
|                   if (data.source === 'internal') { |                   if (data.source === 'internal') { | ||||||
|                     count = get(item, 'vouchers[0].count', 0) || 0; |                     count = get(selectedItem, 'vouchers[0].count', 0) || 0; | ||||||
|                   } |                   } | ||||||
|                   console.log(count); |                   console.log(count); | ||||||
|                   const outOfStock = !(+count > 0); |                   const outOfStock = !(+count > 0); | ||||||
|  |  | ||||||
|                   return ( |                   return ( | ||||||
|                     <Option disabled={outOfStock} value={item.id}> |                     <Option disabled={outOfStock} value={selectedItem.id}> | ||||||
|                       <div style={{display:'flex',justifyContent:'space-between', width:'100%'}}> |                       <div style={{display:'flex',justifyContent:'space-between', width:'100%'}}> | ||||||
|                         <span>{item.name} {outOfStock ? " - Out of Stock" : ""}</span> |                         <span>{selectedItem.name} {outOfStock ? " - Out of Stock" : ""}</span> | ||||||
|                         <span style={{color:'#FF6F00', display:this.state.hidden}}> |                         <span style={{color:'#FF6F00', display:this.state.hidden}}> | ||||||
|                         Rp. <NumberFormat value={(+item.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/> |                         Rp. <NumberFormat value={(+selectedItem.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/> | ||||||
|                       </span> |                       </span> | ||||||
|                       </div> |                       </div> | ||||||
|                     </Option> |                     </Option> | ||||||
|   | |||||||
| @@ -59,7 +59,7 @@ export default class PaymentVouchers extends React.Component { | |||||||
|     //   applicationName = 'BTN'; |     //   applicationName = 'BTN'; | ||||||
|     //   applicationLogo = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png'; |     //   applicationLogo = 'http://btn-redemption-2.bangun-kreatif.com/dr6u0fppdi4xy.cloudfront.net/FilesDirectory/Albilad/ImgIconImage/logo-btn.png'; | ||||||
|     // } |     // } | ||||||
|     const logoUrl = (this.props.vouchersStore.dataItems.images.logo) ? get(this.vouchersStore.dataItems, 'images.logo', '') : 'http://lorempixel.com/400/200'; |     const logoUrl = (this.props.vouchersStore.dataItems.images.main) ? get(this.vouchersStore.dataItems, 'images.main', '') : 'http://lorempixel.com/400/200'; | ||||||
|  |  | ||||||
|     let image = logoUrl; |     let image = logoUrl; | ||||||
|  |  | ||||||
| @@ -110,7 +110,7 @@ export default class PaymentVouchers extends React.Component { | |||||||
|                 {this.props.vouchersStore.dataItems.name} - {this.props.vouchersStore.skuName} |                 {this.props.vouchersStore.dataItems.name} - {this.props.vouchersStore.skuName} | ||||||
|               </h3> |               </h3> | ||||||
|               <h3 className={'item-points'}> |               <h3 className={'item-points'}> | ||||||
|                 BTN Points Payment |                 KB Bukopin Payment | ||||||
|               </h3> |               </h3> | ||||||
|             </div> |             </div> | ||||||
|             <img className={'image-logo'} src={image} /> |             <img className={'image-logo'} src={image} /> | ||||||
| @@ -207,18 +207,29 @@ export default class PaymentVouchers extends React.Component { | |||||||
|                     </Card> |                     </Card> | ||||||
|                 </div> |                 </div> | ||||||
|                 <div className="row"> |                 <div className="row"> | ||||||
|                 <Button type="primary" block onClick={() => { |                 <Button | ||||||
|  |                   type="primary" | ||||||
|  |                   block | ||||||
|  |                   onClick={() => { | ||||||
|  |                     this.globalUI.hideDialogLoading(); | ||||||
|  |                     this.props.history.push(LINKS.TRANSACTION) | ||||||
|  |                     openNotificationWithIcon('success') | ||||||
|  |  | ||||||
|  |                     return; | ||||||
|                     this.vouchersStore.buyVoucher(this.vouchersStore.skuId) |                     this.vouchersStore.buyVoucher(this.vouchersStore.skuId) | ||||||
|                     .then(res => { |                       .then(res => { | ||||||
|                       this.globalUI.hideDialogLoading(); |                         this.globalUI.hideDialogLoading(); | ||||||
|                       this.props.history.push(LINKS.TRANSACTION) |                         this.props.history.push(LINKS.TRANSACTION) | ||||||
|                         openNotificationWithIcon('success') |                         openNotificationWithIcon('success') | ||||||
|                     }) |                       }) | ||||||
|                     .catch(err => { |                       .catch(err => { | ||||||
|                       this.globalUI.openSnackbar(err.message); |                         this.globalUI.openSnackbar(err.message); | ||||||
|                       console.error(err, 'ini errornya'); |                         console.error(err, 'ini errornya'); | ||||||
|                     }); |                       }); | ||||||
|                     }}>Pakai Points</Button> |                   }} | ||||||
|  |                 > | ||||||
|  |                   Pakai Points | ||||||
|  |                 </Button> | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |             </div> | ||||||
|             <div className="col s0 m2 l2" /> |             <div className="col s0 m2 l2" /> | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
| @media(min-width: 1000px){ | @media(min-width: 1000px){ | ||||||
|   .image-logo{ |   .image-logo{ | ||||||
|     width: 10vw; |     width: 10vw; | ||||||
|     height: 10vh; |     height: 35vh; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   .item-container{ |   .item-container{ | ||||||
|   | |||||||
| @@ -67,6 +67,23 @@ export class VoucherStepper extends React.Component { | |||||||
|         content: 'Sistem akan langsung memotong point anda ketika anda menekan tombol konfirmasi dibawah.', |         content: 'Sistem akan langsung memotong point anda ketika anda menekan tombol konfirmasi dibawah.', | ||||||
|         onOk: () => { |         onOk: () => { | ||||||
|           this.globalUI.showDialogLoading(); |           this.globalUI.showDialogLoading(); | ||||||
|  |           const openNotificationWithIcon = (type) => { | ||||||
|  |             notification[type]({ | ||||||
|  |               message: 'Berhasil', | ||||||
|  |               description: `Selamat anda telah mendapatkan vouchers ${this.vouchersStore.dataItems.name} - ${this.vouchersStore.skuName}`, | ||||||
|  |               placement:'topRight', | ||||||
|  |               duration: 5, | ||||||
|  |             }); | ||||||
|  |           }; | ||||||
|  |           this.globalUI.hideDialogLoading(); | ||||||
|  |           // this.props.history.push(LINKS.TRANSACTION) | ||||||
|  |           openNotificationWithIcon('success'); | ||||||
|  |           this.setState({ | ||||||
|  |             stepIndex: stepIndex + 1, | ||||||
|  |             finished: stepIndex >= 2, | ||||||
|  |           }); | ||||||
|  |  | ||||||
|  |           return; | ||||||
|           this.vouchersStore.buyVoucher(this.vouchersStore.skuId) |           this.vouchersStore.buyVoucher(this.vouchersStore.skuId) | ||||||
|             .then(res => { |             .then(res => { | ||||||
|               const openNotificationWithIcon = (type) => { |               const openNotificationWithIcon = (type) => { | ||||||
|   | |||||||
| @@ -8,12 +8,14 @@ | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   .itemCard{ |   .itemCard{ | ||||||
|     background-color: #eee; |     background-color: white; | ||||||
|     border: #ccc 1px solid; |     border: #ccc 1px solid; | ||||||
|     width: 100%; |     width: 100%; | ||||||
|  |     height: 200px; | ||||||
|     display: flex; |     display: flex; | ||||||
|     flex-direction: column; |     flex-direction: column; | ||||||
|     justify-content: center; |     justify-content: center; | ||||||
|  |     text-align: center; | ||||||
|     align-items: center; |     align-items: center; | ||||||
|     margin-bottom: 10px; |     margin-bottom: 10px; | ||||||
|     cursor: pointer; |     cursor: pointer; | ||||||
| @@ -21,7 +23,7 @@ | |||||||
|  |  | ||||||
|   .imageCard{ |   .imageCard{ | ||||||
|     width: 120px; |     width: 120px; | ||||||
|     max-height: 60px; |     max-height: 100px; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   .titleCard{ |   .titleCard{ | ||||||
|   | |||||||
| @@ -19,13 +19,66 @@ export default class ModalTopupComponent extends React.Component { | |||||||
|       inputCode2: '', |       inputCode2: '', | ||||||
|       inputCode3: '', |       inputCode3: '', | ||||||
|       inputCode4: '', |       inputCode4: '', | ||||||
|       confirmLoading: false |       confirmLoading: false, | ||||||
|  |       onOk: {} | ||||||
|     }; |     }; | ||||||
|     this.defaultState = Object.assign({}, this.state); |     this.defaultState = Object.assign({}, this.state); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   componentDidMount() {} |   componentDidMount() {} | ||||||
|  |  | ||||||
|  |   redeemCode (code) { | ||||||
|  |  | ||||||
|  |     const codeList = [ | ||||||
|  |       { | ||||||
|  |         code: 'MLXNAPNU18nd0871', | ||||||
|  |         amount: 10000 | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         code: 'ABAKO1239KLKHASD', | ||||||
|  |         amount: 20000 | ||||||
|  |       }, | ||||||
|  |  | ||||||
|  |       { | ||||||
|  |         code: 'W54VCZJN23FGSDAG', | ||||||
|  |         amount: 50000 | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         code: '123456789ABCEFGH', | ||||||
|  |         amount: 100000 | ||||||
|  |       } | ||||||
|  |     ] | ||||||
|  |  | ||||||
|  |     let rightCode = {}; | ||||||
|  |  | ||||||
|  |     codeList.map((cl) => { | ||||||
|  |       if (cl.code === code){ | ||||||
|  |         rightCode = cl | ||||||
|  |       }} | ||||||
|  |     ) | ||||||
|  |  | ||||||
|  |     this.setState({ | ||||||
|  |       inputCode1: '', | ||||||
|  |       inputCode2: '', | ||||||
|  |       inputCode3: '', | ||||||
|  |       inputCode4: '' | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     if (rightCode.code){ | ||||||
|  |       message.success("Voucher redeem success"); | ||||||
|  |       this.props.appstate.wallet.data.wallet = this.props.appstate.wallet.data.wallet + rightCode.amount | ||||||
|  |       this.setState({ | ||||||
|  |         confirmLoading: false | ||||||
|  |       }); | ||||||
|  |       this.state.onOk() | ||||||
|  |     }else{ | ||||||
|  |       this.setState({ | ||||||
|  |         confirmLoading: false | ||||||
|  |       }); | ||||||
|  |       message.warning("Voucher redeem failed") | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|   render() { |   render() { | ||||||
|     const {data, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Redeem your code'} = this.props; |     const {data, isVisible = false, onOk = () => {}, onCancel = () => {}, title='Redeem your code'} = this.props; | ||||||
|  |  | ||||||
| @@ -35,25 +88,29 @@ export default class ModalTopupComponent extends React.Component { | |||||||
|         visible={isVisible} |         visible={isVisible} | ||||||
|         onOk={async () => { |         onOk={async () => { | ||||||
|           this.setState({ |           this.setState({ | ||||||
|             confirmLoading: true |             confirmLoading: true, | ||||||
|  |             onOk: onOk() | ||||||
|           }); |           }); | ||||||
|           let voucherCode = this.state.inputCode1 + this.state.inputCode2 + this.state.inputCode3 + this.state.inputCode4; |           let voucherCode = this.state.inputCode1 + this.state.inputCode2 + this.state.inputCode3 + this.state.inputCode4; | ||||||
|  |           console.log("voucherCode", voucherCode) | ||||||
|  |  | ||||||
|           try { |           this.redeemCode(voucherCode) | ||||||
|             await this.props.appstate.wallet.redeemVoucherCode(voucherCode); |  | ||||||
|             this.props.onOk(); |           // try { | ||||||
|             message.info("Voucher redeem success"); |           //   await this.props.appstate.wallet.redeemVoucherCode(voucherCode); | ||||||
|           } catch (e) { |           //   this.props.onOk(); | ||||||
|             message.error(e.message); |           //   message.info("Voucher redeem success"); | ||||||
|           } finally { |           // } catch (e) { | ||||||
|             this.setState({ |           //   message.error(e.message); | ||||||
|               inputCode1: '', |           // } finally { | ||||||
|               inputCode2: '', |           //   this.setState({ | ||||||
|               inputCode3: '', |           //     inputCode1: '', | ||||||
|               inputCode4: '', |           //     inputCode2: '', | ||||||
|               confirmLoading: false |           //     inputCode3: '', | ||||||
|             }); |           //     inputCode4: '', | ||||||
|           } |           //     confirmLoading: false | ||||||
|  |           //   }); | ||||||
|  |           // } | ||||||
|  |  | ||||||
|         }} |         }} | ||||||
|         onCancel={() => { |         onCancel={() => { | ||||||
|   | |||||||
| @@ -178,7 +178,7 @@ export default class Routes extends React.Component { | |||||||
|           <Route exact path={LINKS.INVITE_CONFIRMATION_LOGIN} component={InviteConfirmationLoginComponent}/> |           <Route exact path={LINKS.INVITE_CONFIRMATION_LOGIN} component={InviteConfirmationLoginComponent}/> | ||||||
|           <Route exact path={LINKS.ACCEPT_INVITE} component={AcceptInvite}/> |           <Route exact path={LINKS.ACCEPT_INVITE} component={AcceptInvite}/> | ||||||
|           <Route path={LINKS.CHANGE_PASSWORD} component={ChangePassword}/> |           <Route path={LINKS.CHANGE_PASSWORD} component={ChangePassword}/> | ||||||
|           <PrivateRoute path={LINKS.APP_CONTAINER} component={AppContainer}/> |           <Route path={LINKS.APP_CONTAINER} component={AppContainer}/> | ||||||
|         </Switch> |         </Switch> | ||||||
|       </Router> |       </Router> | ||||||
|     ); |     ); | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ export class ItemStore extends BaseStore { | |||||||
|   @observable listImages = []; |   @observable listImages = []; | ||||||
|   constructor(context) { |   constructor(context) { | ||||||
|     super(context); |     super(context); | ||||||
|     this.url = "items"; |     this.url = "/categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items"; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @action |   @action | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ export default class Vouchers { | |||||||
|         getList(){ |         getList(){ | ||||||
|             console.log('res'); |             console.log('res'); | ||||||
|             this.isLoading = true; |             this.isLoading = true; | ||||||
|             return this.http.get("items") |             return this.http.get("categories/11936220-31f7-4f5e-8555-9110dbec4a5d/items") | ||||||
|             .then(res => { |             .then(res => { | ||||||
|               this.list = res.data; |               this.list = res.data; | ||||||
|               this.isLoading = false; |               this.isLoading = false; | ||||||
|   | |||||||
| @@ -2,14 +2,15 @@ | |||||||
| @import "./helper.scss"; | @import "./helper.scss"; | ||||||
| @import url('https://fonts.googleapis.com/css?family=Roboto:100,300,400,500'); | @import url('https://fonts.googleapis.com/css?family=Roboto:100,300,400,500'); | ||||||
| @import url('https://fonts.googleapis.com/css?family=Source+Code+Pro:300,400,500,600'); | @import url('https://fonts.googleapis.com/css?family=Source+Code+Pro:300,400,500,600'); | ||||||
|  | @import url('https://fonts.googleapis.com/css?family=Montserrat'); | ||||||
| @import "./animated.scss"; | @import "./animated.scss"; | ||||||
|  |  | ||||||
| body { | body { | ||||||
|   -webkit-font-smoothing: antialiased !important; |   -webkit-font-smoothing: antialiased !important; | ||||||
|   background-color: #f1f5f9; |   background-color: #FEFAF0; | ||||||
|   text-transform: none; |   text-transform: none; | ||||||
|   padding-top: 56px; |   padding-top: 56px; | ||||||
|   font-family: "Avenir Next W01", "Proxima Nova W01", "Rubik", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; |   font-family: 'Montserrat', "Avenir Next W01", "Proxima Nova W01", "Rubik", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; | ||||||
|   font-size: .8rem; |   font-size: .8rem; | ||||||
|   font-weight: 400; |   font-weight: 400; | ||||||
|   line-height: 1.5; |   line-height: 1.5; | ||||||
|   | |||||||
| @@ -57,7 +57,7 @@ module.exports = { | |||||||
|         test: /\.sass?$/, |         test: /\.sass?$/, | ||||||
|         use: 'happypack/loader?id=styles' |         use: 'happypack/loader?id=styles' | ||||||
|       }, { |       }, { | ||||||
|         test: /\.(jpg|png)$/, |         test: /\.(jpg|jpeg|png|gif)$/, | ||||||
|         loaders: [ |         loaders: [ | ||||||
|           'url-loader?limit=10000&publicPath=static/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead |           'url-loader?limit=10000&publicPath=static/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead | ||||||
|         ] |         ] | ||||||
|   | |||||||
| @@ -47,7 +47,7 @@ module.exports = { | |||||||
|         test: /\.sass?$/, |         test: /\.sass?$/, | ||||||
|         use: 'happypack/loader?id=styles' |         use: 'happypack/loader?id=styles' | ||||||
|       }, { |       }, { | ||||||
|         test: /\.(jpg|png)$/, |         test: /\.(jpg|jpeg|png|gif)$/, | ||||||
|         loaders: [ |         loaders: [ | ||||||
|           'url-loader?limit=10000&publicPath=dist/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead |           'url-loader?limit=10000&publicPath=dist/' // Any png-image or woff-font below or equal to 10K will be converted to inline base64 instead | ||||||
|         ] |         ] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user