Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show large version of trash photos when a thumbnail is clicked/tapped. #142

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1c6f0d7
Add base functionality and components, etc. for realize teams.
oboz Oct 19, 2017
a03443e
Add endpoint to change team
Oct 19, 2017
20c8ddc
Add new button component. Change team screen layout.
oboz Oct 20, 2017
8abdc6c
Implement teams in backend-db
oboz Oct 22, 2017
945644b
Implement teams in backend-db
oboz Oct 22, 2017
fa15cb6
Add new button component. Change team screen layout.
oboz Oct 23, 2017
6783ac0
Fix loading teams when app is started
oboz Oct 25, 2017
7582327
Pre-final implementation of teams functionality
oboz Oct 25, 2017
4a76e2c
Predefined teams added
oboz Oct 26, 2017
91330ee
Add predefined teams list to DB
oboz Oct 26, 2017
dd4608f
Add images for profile features list
oboz Oct 26, 2017
63869db
Final version of implementation of teams functionality
oboz Oct 27, 2017
d9b1330
Sorting of commands was transferred from the mobile app to the backend
oboz Oct 28, 2017
29c9d0a
Base for implement "trashpoint by teams" functionality.
oboz Oct 31, 2017
d95b316
Update gitignore
oboz Nov 2, 2017
e77dc1b
Rewrite Profile screen without react-native-elements
oboz Nov 2, 2017
77bf5fc
Change gitignore files
oboz Nov 2, 2017
3af2039
Remove .idea/ and yarn-error.log files from git
Nov 2, 2017
d96dbd4
Remove .idea folder from root of project
Nov 2, 2017
8309b29
Add preloader and filter to teams screen
Nov 2, 2017
f6ca72f
Code review. Remove teamtrashpoints db and api endpoints. Add data ab…
oboz Nov 4, 2017
8133359
Code review
oboz Nov 4, 2017
ce90a2c
Code review
oboz Nov 4, 2017
45c0002
Fix team in account in API yaml
oboz Nov 4, 2017
1186663
Add translations for Team screen
oboz Nov 5, 2017
68d13d1
Add team screen to admin interface
oboz Nov 5, 2017
537bc0d
Removed forgotten console.log
oboz Nov 5, 2017
679e2b7
Removed forgotten console.log
oboz Nov 5, 2017
8622948
Count users by team
oboz Nov 7, 2017
eb30fcb
Merge remote-tracking branch 'origin/master'
Nov 7, 2017
bcfc76a
Show a photo modal with medium sized photo version of thumbnail
mihaisaru Dec 28, 2017
7912558
Add styling to PhotoModal (limit photo size on screen)
mihaisaru Dec 28, 2017
a40e768
Add PropTypes to PhotoModal component
mihaisaru Dec 28, 2017
29fa20d
Update components to provide data for full screen photo modal
mihaisaru Jan 3, 2018
6c1a0d6
Show full screen modal with the medium size photo
mihaisaru Jan 4, 2018
ca4df71
Add button to close the full screen photo modal
mihaisaru Jan 4, 2018
726522d
Create a separate PhotoModal component
mihaisaru Jan 4, 2018
22407b2
Update volunteer count
krishaamer Feb 27, 2018
14dc65a
Home: fixed add trashpoint button width #168
lynxlynxlynx Mar 2, 2018
2ed5e84
CONTRIBUTING: added TOC for clarity
lynxlynxlynx Mar 7, 2018
d180ed8
web-app: replaced default readme
lynxlynxlynx Mar 7, 2018
4fce1bc
GETTING_STARTED: added
lynxlynxlynx Mar 7, 2018
2fe340d
CONTRIBUTING: added intro with link to getting started guide
lynxlynxlynx Mar 7, 2018
0df5af3
Update gitignore
oboz Mar 8, 2018
2a4ed94
Update to last version
oboz Mar 8, 2018
cd99423
Functionality for save trashpoints in offline mode and sync it after
Mar 8, 2018
ed100d7
MapView: enable google map's inbuilt scale component
lynxlynxlynx Mar 10, 2018
748f50f
Merge branch 'master' of https://github.com/letsdoitworld/World-Clean…
Mar 13, 2018
eecf9c8
Merge branch 'letsdoitworld-master' into OfflineTrashpoint
Mar 13, 2018
85fb587
little fix after problems with conflicts
oboz Mar 13, 2018
93c1d2e
Merge pull request #176 from oboz/OfflineTrashpoint
KucherenkoIhor Mar 13, 2018
17556e8
Add link to wcd translation hub
krishaamer Mar 13, 2018
6f8a17c
google maps: use current release version 3.31
lynxlynxlynx Mar 17, 2018
a867aec
Fix merge bugs and network message output if user know that he in
oboz Mar 18, 2018
ea8d2cc
Merge pull request #187 from oboz/OfflineTrashpoint
KucherenkoIhor Mar 19, 2018
30ff9d3
mobile-app: make use translated trash types #156
lynxlynxlynx Mar 21, 2018
a498b36
removed stale vim temporary file
lynxlynxlynx Mar 21, 2018
744ea98
web-app: enable map type control
lynxlynxlynx Mar 21, 2018
b2d8b92
Fixed the problem of doubling the trash points created in offline mode
oboz Mar 22, 2018
437ba00
Fix marker click in offline mode and 'where in' clause for temp. DB
oboz Mar 22, 2018
894010c
Remove 'OR REPLACE' from insert query to temporary DB for new markers
oboz Mar 22, 2018
a23ec1c
Merge pull request #197 from oboz/OfflineTrashpoint
KucherenkoIhor Mar 22, 2018
1fd3b9f
New Crowdin translations (#150)
krishaamer Mar 22, 2018
93174d3
i18n: remove redundant js files from crowdin sync
lynxlynxlynx Mar 22, 2018
b63cf08
i18n: enable more LTR languages that reached 100%
lynxlynxlynx Mar 22, 2018
df4a91a
i18n: turkish and norwegian (which?) is also 100%
lynxlynxlynx Mar 22, 2018
68df76b
New translations ui-strings.json (Polish)
krishaamer Mar 22, 2018
c09468c
Add Slack link
krishaamer Mar 22, 2018
5586f6f
New translations ui-strings.json
lynxlynxlynx Mar 22, 2018
af1dc52
New Crowdin translations (#201)
krishaamer Mar 26, 2018
203b379
CountryModal: fixed untranslatable strings
lynxlynxlynx Mar 27, 2018
85ed0ff
Merge pull request #196 from letsdoitworld/fix156
lynxlynxlynx Mar 27, 2018
d861a3d
Add to screens loaders if app in offline mode
Mar 28, 2018
d181d23
Add redirect user to home screen if user in offline mode
Mar 28, 2018
6720690
popoverInitialState: use translated string
lynxlynxlynx Mar 28, 2018
54d14ef
AlertModal: increased height a bit
lynxlynxlynx Mar 28, 2018
5590148
CongratsModal: increase header size, for longer translations
lynxlynxlynx Mar 28, 2018
f551bfb
New Crowdin translations (#203)
krishaamer Mar 28, 2018
2f87be8
Fix code after review
oboz Mar 29, 2018
ede1588
Save profile with redux-persist
oboz Mar 29, 2018
a855955
Merge branch 'master' into OfflineTrashpoint
lynxlynxlynx Mar 29, 2018
9c21d5d
Merge pull request #205 from oboz/OfflineTrashpoint
lynxlynxlynx Mar 29, 2018
435dfcc
Api.js: enable BASE_URL override without modifying the file
lynxlynxlynx Mar 29, 2018
40d42d4
web-app: added instructions for running vs local api server
lynxlynxlynx Mar 29, 2018
0cf7954
Merge pull request #186 from letsdoitworld/fix185
lynxlynxlynx Mar 30, 2018
c05ddb3
Merge branch 'master' into bug-fix/issue-95
lynxlynxlynx Mar 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Contributing to World Cleanup Day App and Platform

Not sure how to start? Read on for the general process or [jump right in](GETTING_STARTED.md).

- [Code of Conduct](#code-of-conduct)
- [How can you contribute?](#how-you-can-contribute)
- [Issue Contributions](#issue-contributions)
- [Code Contributions](#code-contributions)
- [Additional Notes](#additional-notes)
- [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11)

## Code of Conduct

* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
Expand All @@ -13,7 +22,7 @@
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
* Avoid the use of personal pronouns in code comments or documentation. There is no need to address persons when explaining code (e.g. "When the developer").

## How you can contribute?
## How you can contribute?
Do you like to design?

* Create art for social media banners to promote the project
Expand Down
38 changes: 38 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Getting started

This document will help you set up the project for development.

## Basic dependencies
Install git, docker, docker-compose, node and yarn.


## Backend services
Consult the dedicated [readme](devops/dev/README.md) to set them up, run
them and verify they work.

### Adding dummy data
This repository comes without trashpoint data. You will need some to work
on the related APIS or marker related functionality.

**TODO:** expand with wcd_dummy instructions


## Web-app (admin backend)
Consult the dedicated [readme](web-app/README.md), but in essence:

```bash
npm install # the first time
npm start
```

## Mobile-apps
Consult the dedicated [readme](mobile-app/README.md).


## Extra reading

* [Contributing](./CONTRIBUTING.md) to World Cleanup Day App and Platform
* [Code of Conduct](./CODE_OF_CONDUCT.md)
* [Governance](./GOVERNANCE.md)
* [Roadmap](./ROADMAP.md)
* Issues marked [good first issue](https://github.com/letsdoitworld/World-Cleanup-Day/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Join the chat at https://gitter.im/letsdoitworld/World-Cleanup-Day](https://badges.gitter.im/letsdoitworld/World-Cleanup-Day.svg)](https://gitter.im/letsdoitworld/World-Cleanup-Day?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Over 17 million trash heroes have already cleaned up more than 500 000 tonnes of trash in over 100 countries! The movement against pollution is growing fast and we're now building the World Cleanup App and Platform for the hundreds of millions of people people joining the World Cleanup Day on **15th of September 2018**.
Over 20 million trash heroes have already cleaned up more than 500 000 tonnes of trash in over 100 countries! The movement against pollution is growing fast and we're now building the World Cleanup App and Platform for the hundreds of millions of people people joining the World Cleanup Day on **15th of September 2018**.

Together we will get rid of trash once and for all, save lives, improve health & reduce costs. Read below on how you can participate! Let's do it! 😃

Expand Down Expand Up @@ -43,6 +43,12 @@ Join the movement and let's clean up the World together!
## API
See the [API docs](http://ldiw-api.s3-website.eu-central-1.amazonaws.com/)

## Translations
See [translate.worldcleanupday.org](https://translate.worldcleanupday.org/ )

## Chat
Join our [Slack chatroom](https://join.slack.com/t/worldcleanupday/shared_invite/enQtMzM0NDQ0MTE5NDI3LThmYTUxNGRiYmQ2ZGVkODJmMDAwN2U3YWVhMTI2ZmU4ZjBlMzk0YjM2YjU0MjNhNmE4ZWEwNDJkN2U0ZjMyZWY)

## Roadmap
See [Roadmap.md](https://github.com/letsdoitworld/World-Cleanup-Day/blob/master/ROADMAP.md)

Expand Down
4 changes: 2 additions & 2 deletions mobile-app/src/components/AlertModal/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { getHeightPercentage, getWidthPercentage } from '../../shared/helpers';
export default EStyleSheet.create({
container: {
backgroundColor: '$white',
marginVertical: getHeightPercentage(178),
marginVertical: getHeightPercentage(168),
marginHorizontal: getWidthPercentage(20),
borderRadius: 8,
height: getHeightPercentage(212),
height: getHeightPercentage(232),
width: getWidthPercentage(280),
alignItems: 'center',
},
Expand Down
47 changes: 47 additions & 0 deletions mobile-app/src/components/PhotoModal/PhotoModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
Image,
Modal,
TouchableOpacity,
} from 'react-native';
import { Ionicons } from '@expo/vector-icons';

import styles from './styles';

const PhotoModal = ({ visible, onRequestClose, photoUrl }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use "Reformat code" option

return (
<Modal
visible={visible}
onRequestClose={onRequestClose}
style={styles.modal}
>
<Image
style={{
flex: 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract to consts

}}
resizeMode="contain"
source={{ uri: photoUrl }}
>
<TouchableOpacity
onPress={onRequestClose}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.onRequestClose.bind(this)

style={styles.buttonBody}
>
<Ionicons
size={styles.$iconSize}
name="md-close"
style={styles.buttonIcon}
/>
</TouchableOpacity>
</Image>
</Modal>
);
};

PhotoModal.propTypes = {
visible: PropTypes.bool.isRequired,
onRequestClose: PropTypes.func.isRequired,
photoUrl: PropTypes.string.isRequired,
};

export default PhotoModal;
1 change: 1 addition & 0 deletions mobile-app/src/components/PhotoModal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as PhotoModal } from './PhotoModal.js';
25 changes: 25 additions & 0 deletions mobile-app/src/components/PhotoModal/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import EStyleSheet from 'react-native-extended-stylesheet';
import { getHeightPercentage, getWidthPercentage } from '../../shared/helpers';

const styles = EStyleSheet.create({
$iconSize: getWidthPercentage(20),
buttonIcon: {
textAlign: 'center',
color: 'white',
},
buttonBody: {
width: getWidthPercentage(30),
height: getHeightPercentage(30),
marginLeft: getWidthPercentage(265),
marginTop: getHeightPercentage(20),
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#fe6669',
borderRadius: 4,
},
modal: {
backgroundColor: '#d8d8d8',
},
});

export default styles;
123 changes: 85 additions & 38 deletions mobile-app/src/components/PhotoPicker/PhotoPicker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Image, View, Text, TouchableOpacity, ScrollView } from 'react-native';
import {
View,
Text,
TouchableOpacity,
ScrollView,
} from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import _ from 'lodash';
import { translate } from 'react-i18next';

import { AlertModal } from '../AlertModal';
import { PhotoModal } from '../PhotoModal';
import { LazyImage } from './components/LazyImage';

import styles from './styles';
Expand Down Expand Up @@ -35,6 +40,7 @@ class Photo extends React.Component {
super(props);
this.state = {
showingConfirm: false,
showZoomedPhoto: false,
};

this.buttons = [
Expand All @@ -49,57 +55,92 @@ class Photo extends React.Component {
},
];
}

setConfirmState = (showingConfirm) => {
this.setState({
showingConfirm,
});
};
}

handlePhotoDeletePress = () => {
this.setConfirmState(true);
};
}

handleModalClosed = () => {
this.setConfirmState(false);
};
}

handleModalConfirmed = () => {
this.setConfirmState(false);
this.props.onPress();
};
this.props.onDeletePress();
}

openZoomedPhoto = () => {
const { photo } = this.props;
this.setState({
zoomedPhotoUrl: photo.mediumPhotoUrl,
showZoomedPhoto: true,
});
}

closeZoomedPhoto = () => {
this.setState({
showZoomedPhoto: false,
});
}

render() {
const { photo, onPress } = this.props;
const { photo, onDeletePress } = this.props;
const { showingConfirm } = this.state;
return (
<LazyImage key={photo} style={[styles.photo]} source={{ uri: photo }}>
<View>
{onPress &&
<TouchableOpacity
onPress={this.handlePhotoDeletePress}
style={styles.photoButtonContainer}
>
<Ionicons
size={styles.$photoSize}
name="md-close"
style={styles.photoButton}
/>
</TouchableOpacity>}

<AlertModal
visible={showingConfirm}
buttons={this.buttons}
onOverlayPress={this.handleModalClosed}
title={this.props.t('label_delete_photo_title')}
subtitle={this.props.t('label_delete_photo_subtitle')}
<TouchableOpacity onPress={this.openZoomedPhoto}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.openZoomedPhoto.bind(this) to prevent losing of this

<LazyImage
key={photo}
style={[styles.photo]}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to create an array whenever the render() method is invoked

source={{ uri: photo.thumbnailUrl }}
>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use "Reformat code" option

<PhotoModal
visible={this.state.showZoomedPhoto}
onRequestClose={this.closeZoomedPhoto}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.bind(this)

photoUrl={this.state.zoomedPhotoUrl}
/>
</View>
</LazyImage>
<View>
{onDeletePress &&
<TouchableOpacity
onPress={this.handlePhotoDeletePress}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.bind(this)

style={styles.photoButtonContainer}
>
<Ionicons
size={styles.$photoSize}
name="md-close"
style={styles.photoButton}
/>
</TouchableOpacity>}

<AlertModal
visible={showingConfirm}
buttons={this.buttons}
onOverlayPress={this.handleModalClosed}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.bind(this)

title={this.props.t('label_delete_photo_title')}
subtitle={this.props.t('label_delete_photo_subtitle')}
/>
</View>
</LazyImage>
</TouchableOpacity>
);
}
}

Photo.defaultProps = {
onPress: undefined,
onDeletePress: undefined,
};

Photo.propTypes = {
photo: PropTypes.string.isRequired,
onPress: PropTypes.func,
photo: PropTypes.shape({
thumbnailUrl: PropTypes.string.isRequired,
mediumPhotoUrl: PropTypes.string.isRequired,
}).isRequired,
onDeletePress: PropTypes.func,
};

const PhotoComponent = translate()(Photo);
Expand Down Expand Up @@ -131,15 +172,15 @@ const PhotoPicker = ({
style={styles.photoContainer}
>
{hasPhotos &&
photos.map((uri, index) => {
photos.map((photo, index) => {
const onDeletePhotoPress = hasDelete
? () => onDeletePress(index)
: undefined;
return (
<PhotoComponent
key={uri}
photo={uri}
onPress={onDeletePhotoPress}
key={photo.thumbnailUrl}
photo={photo}
onDeletePress={onDeletePhotoPress}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.onDeletePhotoPress.bind(this)

/>
);
})}
Expand All @@ -152,15 +193,21 @@ const PhotoPicker = ({
</View>
);
};

PhotoPicker.defaultProps = {
maxPhotos: undefined,
onDeletePress: undefined,
onAddPress: undefined,
};

PhotoPicker.propTypes = {
photos: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
photos: PropTypes.arrayOf(PropTypes.shape({
thumbnailUrl: PropTypes.string.isRequired,
mediumPhotoUrl: PropTypes.string.isRequired,
}).isRequired).isRequired,
onDeletePress: PropTypes.func,
onAddPress: PropTypes.func,
maxPhotos: PropTypes.number,
};

export default translate()(PhotoPicker);
Loading