added community section and some icons

This commit is contained in:
Kadir Sekha 2018-02-16 16:20:22 +00:00
commit f15fd4a2de
7 changed files with 183 additions and 157 deletions

View file

@ -0,0 +1,23 @@
'use strict';
angular.module('copayApp.controllers').controller('communityController', function($scope, communityService, $ionicScrollDelegate, $timeout, platformInfo) {
$scope.hide = false;
$scope.services = communityService.get();
$scope.isCordova = platformInfo.isCordova;
$scope.toggle = function() {
$scope.hide = !$scope.hide;
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
};
$scope.share = function() {
if (!$scope.isCordova) return;
var text = 'Visit Wallet.Bitcoin.com and get started using Bitcoin Cash today!';
window.plugins.socialsharing.share(text, null, null, null);
}
});

View file

@ -0,0 +1,56 @@
'use strict'
angular.module('copayApp.services').factory('communityService', function(configService, $log, lodash) {
var root = {};
var services = [];
root.register = function(serviceInfo) {
$log.info('Adding Services entry:' + serviceInfo.name);
if (!lodash.find(services, function(x) {
return x.name == serviceInfo.name;
})) {
services.push(serviceInfo);
}
}
root.unregister = function(serviceName) {
var newS = lodash.filter(services, function(x) {
return x.name != serviceName;
});
// Found?
if (newS.length == services.length) return;
$log.info('Removing Services entry:' + serviceName);
// This is to preserve services pointer
while (services.length)
services.pop();
while (newS.length)
services.push(newS.pop());
};
root.get = function() {
return services;
};
var bchRedditItem = {
name: 'bchreddit',
title: 'Bitcoin Cash Reddit',
icon: 'icon-reddit',
href: 'http://reddit.com/r/btc'
};
var bitcoincomTwitterItem = {
name: 'bitcoincomTwitter',
title: 'Bitcoin.com Twitter',
icon: 'icon-twitter',
href: 'https://twitter.com/BTCTN'
};
root.register(bchRedditItem);
root.register(bitcoincomTwitterItem);
return root;
});