From 9196e07f3a851f75ffb5405bcb4fc94c0a63c3bd Mon Sep 17 00:00:00 2001
From: Gustavo Maximiliano Cortez
Date: Fri, 7 Oct 2016 11:33:39 -0300
Subject: [PATCH] Fix card intro
---
public/views/bitpayCardIntro.html | 89 +++++++++------------------
src/js/controllers/bitpayCardIntro.js | 34 +---------
src/js/services/bitpayCardService.js | 23 -------
src/sass/views/bitpayCardIntro.scss | 14 +----
www/views/tab-home.html | 12 +++-
5 files changed, 47 insertions(+), 125 deletions(-)
diff --git a/public/views/bitpayCardIntro.html b/public/views/bitpayCardIntro.html
index d272f3639..7b42f3611 100644
--- a/public/views/bitpayCardIntro.html
+++ b/public/views/bitpayCardIntro.html
@@ -1,74 +1,45 @@
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
- Turn bitcoin into dollars, swipe anywhere Visa® is accepted.
+ Turn bitcoin into dollars, swipe anywhere Visa® is accepted.
-
-
- Order the BitPay Card
-
-
- Connect my BitPay Card
-
-
-
-
-
-
-
-
-
+
+
- Get local cash anywhere you go, from any Visa®-compatible ATM.
-
- *ATM bank fees may apply
-
+ Get local cash anywhere you go, from any Visa®-compatible ATM.
+
+ *ATM bank fees may apply
+
-
-
- Order the BitPay Card
-
-
- Connect my BitPay Card
-
-
-
-
-
-
-
-
-
+
+
- Pay 0% fees to turn bitcoin into dollars.
+ Pay 0% fees to turn bitcoin into dollars.
-
-
- Order the BitPay Card
-
-
- Connect my BitPay Card
-
-
-
-
-
+
+
+
+
+ Order the BitPay Card
+
+
+ Connect my BitPay Card
+
+
+
diff --git a/src/js/controllers/bitpayCardIntro.js b/src/js/controllers/bitpayCardIntro.js
index 042195951..5e26a0218 100644
--- a/src/js/controllers/bitpayCardIntro.js
+++ b/src/js/controllers/bitpayCardIntro.js
@@ -2,16 +2,6 @@
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $state, $timeout, $ionicHistory, storageService, externalLinkService, bitpayCardService, gettextCatalog, popupService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
- $scope.data = {
- index: 0
- };
-
- $scope.options = {
- loop: false,
- effect: 'flip',
- speed: 500,
- spaceBetween: 100
- };
if (data.stateParams && data.stateParams.secret) {
var obj = {
@@ -25,11 +15,13 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
return;
}
var title = gettextCatalog.getString('Add BitPay Cards?');
- var msg = gettextCatalog.getString('Would you like to add this account to your wallet?');
+ var msg = gettextCatalog.getString('Would you like to add this account ({{email}}) to your wallet?', {email: obj.email});
var ok = gettextCatalog.getString('Add cards');
var cancel = gettextCatalog.getString('Go back');
popupService.showConfirm(title, msg, ok, cancel, function(res) {
if (res) {
+ // Set flag for nextStep
+ storageService.setNextStep('BitpayCard', true, function(err) {});
// Save data
bitpayCardService.setBitpayDebitCards(data, function(err) {
if (err) return;
@@ -71,25 +63,5 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
var target = '_system';
externalLinkService.open(url, target);
};
-
- $scope.goBack = function() {
- if ($scope.data.index != 0) $scope.slider.slidePrev();
- else $state.go('tabs.home');
- };
-
- $scope.slideNext = function() {
- if ($scope.data.index != 2) $scope.slider.slideNext();
- else $state.go('tabs.home');
- };
-
- $scope.$on("$ionicSlides.sliderInitialized", function(event, data) {
- $scope.slider = data.slider;
- });
-
- $scope.$on("$ionicSlides.slideChangeStart", function(event, data) {
- $scope.data.index = data.slider.activeIndex;
- });
-
- $scope.$on("$ionicSlides.slideChangeEnd", function(event, data) {});
});
diff --git a/src/js/services/bitpayCardService.js b/src/js/services/bitpayCardService.js
index 1bce179f1..e01441220 100644
--- a/src/js/services/bitpayCardService.js
+++ b/src/js/services/bitpayCardService.js
@@ -35,27 +35,6 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
return error;
};
- var _getUser = function(cb) {
- _setCredentials();
- storageService.getBitpayCard(credentials.NETWORK, function(err, user) {
- if (err) return cb(err);
- if (lodash.isString(user)) {
- user = JSON.parse(user);
- }
- return cb(null, user);
- });
- };
-
- var _setUser = function(user, cb) {
- _setCredentials();
- user = JSON.stringify(user);
- storageService.setBitpayCard(credentials.NETWORK, user, function(err) {
- return cb(err);
- });
- // Show pending task from the UI
- storageService.setNextStep('BitpayCard', true, function(err) {});
- };
-
var _getSession = function(cb) {
_setCredentials();
$http({
@@ -179,8 +158,6 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
data: userData
}).then(function(data) {
$log.info('BitPay Card BitAuth: SUCCESS');
- // Set an UI flag
- storageService.setNextStep('BitpayCard', true, function(err) {});
// Get cards
_afterBitAuthSuccess(obj, cb);
}, function(data) {
diff --git a/src/sass/views/bitpayCardIntro.scss b/src/sass/views/bitpayCardIntro.scss
index 1405a2f7d..3ce232b0f 100644
--- a/src/sass/views/bitpayCardIntro.scss
+++ b/src/sass/views/bitpayCardIntro.scss
@@ -1,11 +1,11 @@
#bitpayCard-intro {
- .swiper-container-horizontal > .swiper-pagination {
- bottom: 150px;
+ .slider-pager .slider-pager-page {
+ color: #fff;
}
.cta-button{
text-align: center;
position: absolute;
- bottom: 45px;
+ bottom: 55px;
padding: 0 1.5rem;
width: 100%;
}
@@ -34,14 +34,6 @@
border-color: transparent;
border:none;
}
- .swiper-pagination {
- &-bullet {
- background: rgb(100, 124, 232);
- &-active {
- background: rgb(100, 124, 232);
- }
- }
- }
.button-transparent{
background: none !important;
}
diff --git a/www/views/tab-home.html b/www/views/tab-home.html
index 81b5551ca..f3bbc976a 100644
--- a/www/views/tab-home.html
+++ b/www/views/tab-home.html
@@ -97,10 +97,20 @@
- BitPay Card
+ BitPay Visa® Card
{{card.lastFourDigits}}
+
+
+
+
+ BitPay Visa® Card
+ Add your cards
+
+