Merge branch 'master' into mx

This commit is contained in:
Letícia Camara 2018-10-30 18:42:26 -03:00
commit 47b51ce53f
33 changed files with 158 additions and 31 deletions

View file

@ -365,3 +365,35 @@ ul.social-buttons {
padding-left: 0 !important; padding-left: 0 !important;
padding-right: 0 !important; padding-right: 0 !important;
} }
.ambassadorsTitle {
margin-top: 0 !important;
}
@media screen and (min-width: 328px) {
.ambassadorsTitle {
font-weight: bold;
}
.marketingMargin {
font-weight: bold;
}
.merchantsMargin {
font-weight: bold;
}
}
th {
text-align: left !important;
}
#mainNav p {
margin-left: 0 !important;
}
header .col-md-10, header .col-md-10 > div {
padding-left: 0 !important;
}
.search-books-input-wrapper > div {
margin-left: 0 !important;
}

BIN
src/assets/img/about/ab1.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 182 KiB

BIN
src/assets/img/about/ab2.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

After

Width:  |  Height:  |  Size: 235 KiB

BIN
src/assets/img/about/ab3.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 190 KiB

BIN
src/assets/img/about/ab4.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 238 KiB

BIN
src/assets/img/about/ab5.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 204 KiB

BIN
src/assets/img/footer/dtube.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 291 B

BIN
src/assets/img/footer/footer_logo.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/assets/img/footer/steemit.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 70 KiB

BIN
src/assets/img/header/logo.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
src/assets/img/map/ambassador_cluster.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/img/map/ambassador_pin.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/img/map/merchant_cluster.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/img/map/merchant_pin.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/img/services/bill_pay_counters.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/assets/img/services/cafe_bars.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/img/services/delivery_drivers.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/assets/img/services/gas_stations.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/img/services/grocery.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/img/services/phone_orders.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
src/assets/img/services/restaurants.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/assets/img/services/retail.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -14,13 +14,15 @@ import AppLogo from '../assets/img/header/logo.png';
function AppHeader() { function AppHeader() {
return ( return (
<AppBar position="static" color="inherit" style={{backgroundColor: '#138F52'}}> <AppBar position="static" color="inherit" style={{backgroundColor: '#138F52'}}>
<div className="col-md-10 mx-md-auto" >
<Toolbar> <Toolbar>
<Typography style={{margin: '0 auto'}} variant="title" color="inherit"> <Typography variant="title" color="inherit">
<Link to="/"> <Link to="/">
<img src={AppLogo} className="app-book-menu-remove-icon" alt="Palmpay logo" /> <img src={AppLogo} className="app-book-menu-remove-icon" alt="Palmpay logo" />
</Link> </Link>
</Typography> </Typography>
</Toolbar> </Toolbar>
</div>
</AppBar> </AppBar>
); );
} }

View file

@ -93,8 +93,22 @@ class EnhancedTable extends Component {
const data = const data =
order === 'desc' order === 'desc'
? this.state.data.sort((a, b) => (b[orderBy] < a[orderBy] ? -1 : 1)) ? this.state.data.sort((a, b) => {
: this.state.data.sort((a, b) => (a[orderBy] < b[orderBy] ? -1 : 1)); let a_value = a[orderBy];
let b_value = b[orderBy];
a_value = a_value.hasOwnProperty('searchText') ? a_value.searchText.toLowerCase() : a_value.toLowerCase();
b_value = b_value.hasOwnProperty('searchText') ? b_value.searchText.toLowerCase() : b_value.toLowerCase();
return (b_value < a_value) ? -1 : 1;
})
: this.state.data.sort((a, b) => {
let a_value = a[orderBy];
let b_value = b[orderBy];
a_value = a_value.hasOwnProperty('searchText') ? a_value.searchText.toLowerCase() : a_value.toLowerCase();
b_value = b_value.hasOwnProperty('searchText') ? b_value.searchText.toLowerCase() : b_value.toLowerCase();
if(a_value.trim() === '') a_value = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
if(b_value.trim() === '') b_value = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
return (a_value < b_value) ? -1 : 1;
});
this.setState({ data, order, orderBy }); this.setState({ data, order, orderBy });
}; };

View file

@ -88,7 +88,7 @@ class LayerMapSwitches extends React.Component {
onChange={this.props.onChange('ambassadorLayer')} onChange={this.props.onChange('ambassadorLayer')}
value="ambassadors" value="ambassadors"
classes={{ classes={{
switchBase: ( (this.props.ambsMap) ? classes.iOSSwitchBaseBlue : classes.iOSSwitchBaseGreen ), switchBase: classes.iOSSwitchBaseBlue,
bar: classes.iOSBar, bar: classes.iOSBar,
icon: classes.iOSIcon, icon: classes.iOSIcon,
iconChecked: classes.iOSIconChecked, iconChecked: classes.iOSIconChecked,
@ -102,7 +102,7 @@ class LayerMapSwitches extends React.Component {
control={ control={
<Switch <Switch
classes={{ classes={{
switchBase: ( (this.props.ambsMap) ? classes.iOSSwitchBaseBlue : classes.iOSSwitchBaseGreen ), switchBase: classes.iOSSwitchBaseGreen,
bar: classes.iOSBar, bar: classes.iOSBar,
icon: classes.iOSIcon, icon: classes.iOSIcon,
iconChecked: classes.iOSIconChecked, iconChecked: classes.iOSIconChecked,

View file

@ -24,7 +24,6 @@ import LoadingGif from '../../assets/img/loading_icon.gif';
const countries = Countries(); const countries = Countries();
const centerStyle = { const centerStyle = {
textAlign: 'center',
marginTop: 20, marginTop: 20,
marginBottom: 20 marginBottom: 20
}; };
@ -139,9 +138,25 @@ class AmbassadorsPage extends Component {
searchText: app.addLocationSearchText(ambassador.cities), searchText: app.addLocationSearchText(ambassador.cities),
value: app.addLocation(ambassador.cities) value: app.addLocation(ambassador.cities)
} }
ambassador.map = app.addMapButton(ambassador.nickname, ambassador.cities); ambassador.telegram_original = ambassador.telegram;
ambassador.link = <a target="_blank" rel="noopener noreferrer" ambassador.telegram = {
href={ambassador.url}>{stripProtocol(ambassador.url)}</a>; searchText: ambassador.telegram,
value: (
<a
href={`https://t.me/${(ambassador.telegram.trim().charAt(0) === '@') ? ambassador.telegram.trim().slice(1): ambassador.telegram.trim()}`}
target="_blank"
rel="noopener noreferrer"
>{ambassador.telegram}</a>
)
};
ambassador.map = app.addMapButton(ambassador, ambassador.cities);
ambassador.link = {
searchText: stripProtocol(ambassador.url),
value: (
<a target="_blank" rel="noopener noreferrer"
href={ambassador.url}>{stripProtocol(ambassador.url)}</a>
)
};
}); });
// Once both return, update the state // Once both return, update the state
@ -185,12 +200,16 @@ class AmbassadorsPage extends Component {
}); });
const markers = result.data.map(merchant => { const markers = result.data.map(merchant => {
const infoDescription = <div>
<div><b>Address</b>: {merchant.address}</div>
{(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)}
</div>;
const marker = { const marker = {
lat: merchant.lat, lat: merchant.lat,
lng: merchant.lon, lng: merchant.lon,
withInfo: true, withInfo: true,
infoTitle: merchant.name, infoTitle: merchant.name,
infoDescription: `${merchant.address}, ${merchant.city} - ${merchant.country}`, infoDescription: infoDescription,
}; };
return marker; return marker;
}); });
@ -245,11 +264,28 @@ class AmbassadorsPage extends Component {
); );
} }
addMapButton(nickname, cities){ addMapButton(ambassador, cities){
const app = this; const app = this;
return ( return (
<span> <span>
{cities.map((location, index) => ( {cities.map((location, index) => {
const infoDescription = <div>
<div><b>Location</b>: {(location.name).replace(/(^|\s)\S/g, l => l.toUpperCase())} - {countries.getName(location.country)}</div>
{(ambassador.nickname) && (<div><b>Nickname</b>: {ambassador.nickname}</div>)}
{(ambassador.telegram_original) && (<div><b>Telegram</b>:
<a
href={`https://t.me/${(ambassador.telegram_original.trim().charAt(0) === '@') ? ambassador.telegram_original.trim().slice(1): ambassador.telegram_original.trim()}`}
target="_blank"
rel="noopener noreferrer"
>{ambassador.telegram_original}</a>
</div>)}
{(ambassador.keybase) && (<div><b>Keybase</b>: {ambassador.keybase}</div>)}
{(ambassador.email) && (<div><b>Email</b>: {ambassador.email}</div>)}
{(ambassador.phone) && (<div><b>Phone</b>: {ambassador.phone}</div>)}
{(ambassador.url) && (<div><b>URL:</b>: <a target="_blank" rel="noopener noreferrer"
href={ambassador.url}>{stripProtocol(ambassador.url)}</a></div>)}
</div>;
return (
<div key={index}> <div key={index}>
<Button <Button
className="App-button" className="App-button"
@ -261,15 +297,15 @@ class AmbassadorsPage extends Component {
marginBottom: 5 marginBottom: 5
}} }}
onClick={() => app.openMaps( onClick={() => app.openMaps(
nickname, ambassador.nickname,
`${(location.name).replace(/(^|\s)\S/g, l => l.toUpperCase())} - ${countries.getName(location.country)}`, infoDescription,
location.lat, location.lat,
location.lon location.lon
)} )}
>Show on Map >Show on Map
</Button> </Button>
</div> </div>
))} );})}
</span> </span>
); );
} }
@ -285,12 +321,26 @@ class AmbassadorsPage extends Component {
const ambassadorsMarkers = []; const ambassadorsMarkers = [];
ambassadorsSearch.forEach(ambassador => { ambassadorsSearch.forEach(ambassador => {
ambassador.cities.forEach(function(city) { ambassador.cities.forEach(function(city) {
const infoDescription = <div>
<div><b>Location</b>: {(city.name).replace(/(^|\s)\S/g, l => l.toUpperCase())} - {countries.getName(city.country)}</div>
{(ambassador.nickname) && (<div><b>Nickname</b>: {ambassador.nickname}</div>)}
{(ambassador.telegram_original) && (<div><b>Telegram</b>: <a
href={`https://t.me/${(ambassador.telegram_original.trim().charAt(0) === '@') ? ambassador.telegram_original.trim().slice(1): ambassador.telegram_original.trim()}`}
target="_blank"
rel="noopener noreferrer"
>{ambassador.telegram_original}</a></div>)}
{(ambassador.keybase) && (<div><b>Keybase</b>: {ambassador.keybase}</div>)}
{(ambassador.email) && (<div><b>Email</b>: {ambassador.email}</div>)}
{(ambassador.phone) && (<div><b>Phone</b>: {ambassador.phone}</div>)}
{(ambassador.url) && (<div><b>URL:</b>: <a target="_blank" rel="noopener noreferrer"
href={ambassador.url}>{stripProtocol(ambassador.url)}</a></div>)}
</div>;
const marker = { const marker = {
lat: city.lat, lat: city.lat,
lng: city.lon, lng: city.lon,
withInfo: true, withInfo: true,
infoTitle: ambassador.nickname, infoTitle: ambassador.nickname,
infoDescription: `${city.name} - ${city.country}`, infoDescription: infoDescription,
}; };
ambassadorsMarkers.push(marker); ambassadorsMarkers.push(marker);
}); });
@ -313,7 +363,7 @@ class AmbassadorsPage extends Component {
<img src={LoadingGif} alt="Loading" style={loadingStyle} /> <img src={LoadingGif} alt="Loading" style={loadingStyle} />
): ( ): (
<div> <div>
<p style={{ textAlign: 'left', marginLeft: 20, marginRight: 20 }}> <p style={{ textAlign: 'left', marginRight: 20 }}>
<FormattedHTMLMessage id="ambassadors.description1" /> <FormattedHTMLMessage id="ambassadors.description1" />
<Link to="/merchants"> <Link to="/merchants">
<FormattedMessage id="ambassadors.merchants_link_description" /> <FormattedMessage id="ambassadors.merchants_link_description" />

View file

@ -68,7 +68,3 @@
.margin-5 { .margin-5 {
padding: 3rem; padding: 3rem;
} }
.MuiNotchedOutline-focused-120 {
border-color: rgb(19, 143, 82) !important;
}

View file

@ -6,6 +6,11 @@ import { FormattedMessage, FormattedHTMLMessage } from 'react-intl';
import AppHeader from '../AppHeader'; import AppHeader from '../AppHeader';
import Footer from '../Footer'; import Footer from '../Footer';
const centerStyle = {
marginTop: 20,
marginBottom: 20
};
/** /**
* Marketing page component. * Marketing page component.
*/ */
@ -109,6 +114,7 @@ class MarketingPage extends React.Component {
<div className="containerfix"> <div className="containerfix">
<div className="row"> <div className="row">
<div className="col-md-10 mx-md-auto"> <div className="col-md-10 mx-md-auto">
<h2 className="ambassadorsTitle marketingMargin" style={centerStyle}>Marketing</h2>
<div> <div>
<div> <div>
<Button <Button

View file

@ -1,3 +1,6 @@
.MuiFormLabel-root-82.MuiFormLabel-focused-83 { .MuiFormLabel-root-82.MuiFormLabel-focused-83 {
color: #139657 color: #139657
} }
.merchants_services .MuiNotchedOutline-focused-120 {
border-color: rgb(19, 143, 82) !important;
}

View file

@ -10,6 +10,7 @@ import EnhancedTable from '../EnhancedTable';
import Footer from '../Footer'; import Footer from '../Footer';
import LayerMap from '../LayerMap'; import LayerMap from '../LayerMap';
import PreviewMap from '../PreviewMap'; import PreviewMap from '../PreviewMap';
import { stripProtocol } from '../../utils/url';
// Helpers // Helpers
import Client from '../../utils/feathers'; import Client from '../../utils/feathers';
@ -25,7 +26,6 @@ import "./MerchantsPage.css";
const countries = Countries(); const countries = Countries();
const centerStyle = { const centerStyle = {
textAlign: 'center',
marginTop: 20, marginTop: 20,
marginBottom: 20 marginBottom: 20
}; };
@ -135,12 +135,28 @@ class MerchantsPage extends Component {
const markers = []; const markers = [];
result.data.forEach(ambassador => { result.data.forEach(ambassador => {
ambassador.cities.forEach(function(city) { ambassador.cities.forEach(function(city) {
const infoDescription = <div>
<div><b>Location</b>: {(city.name).replace(/(^|\s)\S/g, l => l.toUpperCase())} - {countries.getName(city.country)}</div>
{(ambassador.nickname) && (<div><b>Nickname</b>: {ambassador.nickname}</div>)}
{(ambassador.telegram) && (<div><b>Telegram</b>:
<a
href={`https://t.me/${(ambassador.telegram.trim().charAt(0) === '@') ? ambassador.telegram.trim().slice(1): ambassador.telegram.trim()}`}
target="_blank"
rel="noopener noreferrer"
>{ambassador.telegram}</a>
</div>)}
{(ambassador.keybase) && (<div><b>Keybase</b>: {ambassador.keybase}</div>)}
{(ambassador.email) && (<div><b>Email</b>: {ambassador.email}</div>)}
{(ambassador.phone) && (<div><b>Phone</b>: {ambassador.phone}</div>)}
{(ambassador.url) && (<div><b>URL:</b>: <a target="_blank" rel="noopener noreferrer"
href={ambassador.url}>{stripProtocol(ambassador.url)}</a></div>)}
</div>;
const marker = { const marker = {
lat: city.lat, lat: city.lat,
lng: city.lon, lng: city.lon,
withInfo: true, withInfo: true,
infoTitle: ambassador.nickname, infoTitle: ambassador.nickname,
infoDescription: `${city.name} - ${city.country}`, infoDescription: infoDescription,
}; };
markers.push(marker); markers.push(marker);
}); });
@ -183,6 +199,10 @@ class MerchantsPage extends Component {
}); });
result.data.map(merchant => { result.data.map(merchant => {
const infoDescription = <div>
<div><b>Address</b>: {merchant.address}</div>
{(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)}
</div>;
merchant.map = <Button merchant.map = <Button
className="App-button" className="App-button"
variant="contained" variant="contained"
@ -192,7 +212,7 @@ class MerchantsPage extends Component {
}} }}
onClick={() => this.openMaps( onClick={() => this.openMaps(
merchant.name, merchant.name,
`${merchant.address}, ${merchant.city} - ${merchant.country}`, infoDescription,
merchant.lat, merchant.lat,
merchant.lon merchant.lon
)} )}
@ -239,12 +259,16 @@ class MerchantsPage extends Component {
const { ambassadorsMarkers, merchantsSearch } = this.state; const { ambassadorsMarkers, merchantsSearch } = this.state;
const merchantMarkers = merchantsSearch.map(merchant => { const merchantMarkers = merchantsSearch.map(merchant => {
const infoDescription = <div>
<div><b>Address</b>: {merchant.address}</div>
{(merchant.phone) && (<div><b>Phone</b>: {merchant.phone}</div>)}
</div>;
const marker = { const marker = {
lat: merchant.lat, lat: merchant.lat,
lng: merchant.lon, lng: merchant.lon,
withInfo: true, withInfo: true,
infoTitle: merchant.name, infoTitle: merchant.name,
infoDescription: `${merchant.address}, ${merchant.city} - ${merchant.country}`, infoDescription: infoDescription,
}; };
return marker; return marker;
}); });
@ -254,18 +278,18 @@ class MerchantsPage extends Component {
<div> <div>
<AppHeader /> <AppHeader />
<section data-spy="scroll" data-target="#mainNav" id="services"> <section data-spy="scroll" data-target="#mainNav" id="services" className="merchants_services" >
<div className="containerfix"> <div className="containerfix">
<div className="row"> <div className="row">
<div className="col-md-10 mx-md-auto"> <div className="col-md-10 mx-md-auto">
<h2 className="ambassadorsTitle" style={centerStyle}><FormattedMessage id="merchants.title" /></h2> <h2 className="ambassadorsTitle merchantsMargin" style={centerStyle}><FormattedMessage id="merchants.title" /></h2>
{ /* Conditional Rendering */} { /* Conditional Rendering */}
{(this.state.loading) ? ( {(this.state.loading) ? (
<img src={LoadingGif} alt="Loading" style={loadingStyle} /> <img src={LoadingGif} alt="Loading" style={loadingStyle} />
): ( ): (
<div> <div>
<p style={{ textAlign: 'left', marginLeft: 20, marginRight: 20 }}> <p style={{ textAlign: 'left', marginRight: 20 }}>
<FormattedHTMLMessage id="merchants.description1" /> <FormattedHTMLMessage id="merchants.description1" />
<Link to="/ambs"> <Link to="/ambs">
<FormattedMessage id="merchants.ambassadors_link_description" /> <FormattedMessage id="merchants.ambassadors_link_description" />

View file

@ -68,7 +68,7 @@ class TestimoniesSection extends React.Component {
render() { render() {
const { activeItem, maxLength } = this.state; const { activeItem, maxLength } = this.state;
const fontSize = (this.state.width > 1000) ? 16 * (1 + (this.state.width/2000)): 16; const fontSize = (this.state.width > 1000) ? 16 * (1 + (this.state.width/4000)): 16;
return ( return (
<span> <span>

View file

@ -3,7 +3,7 @@ import feathers from '@feathersjs/client';
const app = feathers(); const app = feathers();
// Change to your production ambassador web service // Change to your production ambassador web service
//const restClient = feathers.rest('http://localhost:3030'); //const restClient = feathers.rest('http://localhost:3030');
const restClient = feathers.rest('https://palmpaybackend.leticiacamara.com'); const restClient = feathers.rest('https://ambpay.palmpay.io');
// Configure an Fetch AJAX library with that client. For fetch details see https://facebook.github.io/react-native/docs/network.html // Configure an Fetch AJAX library with that client. For fetch details see https://facebook.github.io/react-native/docs/network.html
// For rest details see https://docs.feathersjs.com/api/client/rest.html // For rest details see https://docs.feathersjs.com/api/client/rest.html