Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
288aa39
add flow
kru Oct 11, 2017
5331665
add flow dependency
kru Oct 11, 2017
13c6add
change flow version
kru Oct 11, 2017
1b3abf5
fix conflict
kru Oct 11, 2017
6833e82
ignore node modules
kru Oct 12, 2017
e60ae2f
add flow type for state and props
kru Oct 12, 2017
157fb76
update flow config
kru Oct 12, 2017
016904d
change prop type to flow
kru Oct 12, 2017
adeb3ca
fix conflict
rendisaepulb Oct 23, 2017
e387d93
fix error
rendisaepulb Oct 23, 2017
9c6f184
fix conflict
rendisaepulb Oct 30, 2017
a68754e
add flow type on feed
rendisaepulb Oct 30, 2017
4929572
add flow type on attendeeslist
rendisaepulb Oct 30, 2017
c7e23d2
Merge remote-tracking branch 'origin/develop' into flow-integration-init
rendisaepulb Nov 6, 2017
b29ad00
delete unused code
rendisaepulb Nov 6, 2017
5c69696
add flow type on boothinfo
rendisaepulb Nov 6, 2017
221b92d
Merge remote-tracking branch 'origin/develop' into flow-integration-init
rendisaepulb Nov 6, 2017
2dd2689
add flow type on boothlist
rendisaepulb Nov 6, 2017
13a6f32
add flow type on changepassword
rendisaepulb Nov 6, 2017
8fd3af5
add flow type on main
rendisaepulb Nov 6, 2017
bfab9df
add flow type on MainTabs
rendisaepulb Nov 6, 2017
166769c
add flow type on MaterialList
rendisaepulb Nov 6, 2017
3ad827b
add flow type on NewOrder
rendisaepulb Nov 6, 2017
7fde9c8
Merge remote-tracking branch 'origin/develop' into flow-integration-init
rendisaepulb Nov 6, 2017
8d8beef
add flow type on OrderDetail
rendisaepulb Nov 6, 2017
f436e7e
add flow type on OrderList
rendisaepulb Nov 6, 2017
713463c
add flow type on Payment
rendisaepulb Nov 6, 2017
1183496
add flow type on PaymentDetail
rendisaepulb Nov 6, 2017
096eed2
add flow type on Profile
rendisaepulb Nov 6, 2017
79da9b3
add flow type on Redeem
rendisaepulb Nov 6, 2017
7b3c913
add flow on RegisterEmail
rendisaepulb Nov 6, 2017
8b1e1ce
add flow type on RegisterMenu
rendisaepulb Nov 6, 2017
a623a99
hot fix
rendisaepulb Nov 6, 2017
e4c00da
add flow type on RegisterPhone
rendisaepulb Nov 7, 2017
d847579
add flow type on Schedule
rendisaepulb Nov 7, 2017
85387a4
add flow type on ScheduleDetail
rendisaepulb Nov 7, 2017
a678d19
add flow type on Settings
rendisaepulb Nov 7, 2017
70defd4
add flow type on Speaker
rendisaepulb Nov 7, 2017
b72b5a1
add flow type on SponsorInfo
rendisaepulb Nov 7, 2017
e0105bb
add flow type on TicketList
rendisaepulb Nov 7, 2017
b2f5521
fix conflict
rendisaepulb Nov 7, 2017
9dcd5d0
fix conflict
rendisaepulb Nov 9, 2017
ab17aea
fix conflict
rendisaepulb Nov 9, 2017
d38c464
Merge remote-tracking branch 'origin/develop' into flow-integration-init
rendisaepulb Nov 9, 2017
7a8619d
fix conflict package.json
rendisaepulb Nov 9, 2017
738aff8
fix conflict
rendisaepulb Nov 10, 2017
f225186
fix conflict
rendisaepulb Nov 19, 2017
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
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react-native"]
"presets": ["react-native", "flow"]
}
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js
<PROJECT_ROOT>/node_modules/.*

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
Expand Down
33 changes: 16 additions & 17 deletions app/containers/AttendeesList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@ import * as actions from './actions';
import * as selectors from './selectors';
import * as ticketSelectors from '../TicketList/selectors';

class AttendeesList extends Component {
// @flow
type Props = {
listAttendees?: Array<mixed>,
isTransferring: boolean,
isGettingTicket: boolean,
ticketId: number,
isGettingAttendees: boolean,
fetchingAttendeeStat: boolean
};

type State = {
isLoading: boolean
};

class AttendeesList extends Component<Props, State> {
state = {
isLoading: true
}
Expand All @@ -45,7 +59,7 @@ class AttendeesList extends Component {
}
}

handleTransferPressed = (ticketId, receiverId, targetName) => {
handleTransferPressed = (ticketId: number, receiverId: number, targetName: string) => {
Alert.alert(
strings.attendeesList.confirm,
targetName,
Expand Down Expand Up @@ -134,21 +148,6 @@ class AttendeesList extends Component {
}
}

AttendeesList.propTypes = {
listAttendees: PropTypes.oneOfType([
PropTypes.object,
PropTypes.array
]
).isRequired,
isTransferring: PropTypes.bool.isRequired,
isGettingTicket: PropTypes.bool.isRequired,
fetchAttendees: PropTypes.func.isRequired,
transferTicket: PropTypes.func.isRequired,
ticketId: PropTypes.number.isRequired,
isGettingAttendees: PropTypes.bool.isRequired,
fetchingAttendeeStat: PropTypes.bool.isRequired
};

const mapStateToProps = createStructuredSelector({
listAttendees: selectors.getAttendees(),
isTransferring: selectors.getIsTransferring(),
Expand Down
24 changes: 21 additions & 3 deletions app/containers/BoothInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,27 @@ import * as selectors from './selectors';
const background = require('./../../../assets/images/background.png');
const noImage = require('./../../../assets/images/noimage.png');

// @flow
type Props = {
boothGalleries?: Array<mixed>,
boothPhoto: string,
fields: {
photoPic: string
},
isBoothGalleryUpdated: boolean,
isBoothPhotoUpdated: boolean,
summary: string,
title: string,
user: Object
};

class BoothInfo extends Component {
type State = {
imagePreview: string,
modalVisible: boolean,
logged_user?: Object<mixed>
};

class BoothInfo extends Component<Props, State> {
constructor(props) {
super(props);
this.state = {
Expand Down Expand Up @@ -74,7 +93,7 @@ class BoothInfo extends Component {
}).catch(err => console.log(strings.booth.errorImage, err));
}

setModalVisible = (visible, image) => {
setModalVisible = (visible: boolean, image: string) => {
this.setState({ modalVisible: visible, imagePreview: image });
}

Expand All @@ -91,7 +110,6 @@ class BoothInfo extends Component {
}

renderItem = (images) => {
console.log('checking image', images);
return (
<TouchableWithoutFeedback onPress={() => this.setModalVisible(true, images.url)}>
<Image
Expand Down
28 changes: 22 additions & 6 deletions app/containers/BoothList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,26 @@ import AccordionView2 from './Accordion2';
import { PRIMARYCOLOR } from '../../constants';
import { getProfileData } from './../../helpers';

const bgBooth1 = require('./../../../assets/images/bgbooth_1.png');
const bgBooth2 = require('./../../../assets/images/bgbooth_2.png');
// @flow
const bgBooth1: string = require('./../../../assets/images/bgbooth_1.png');
const bgBooth2: string = require('./../../../assets/images/bgbooth_2.png');

class BoothList extends Component {
type Props = {
booth?: Array<mixed>,
hackaton?: Object<mixed>,
isFetching: boolean,
isFetching2: boolean
};

type State = {
accordion: boolean,
accordion2: boolean,
boothFilter?: Array<mixed>,
modalVisible: boolean,
url: string
};

class BoothList extends Component<Props, State> {
state = {
modalVisible: false,
boothFilter: this.props.booth,
Expand Down Expand Up @@ -74,15 +90,15 @@ class BoothList extends Component {
}
}

setAccordion = (visible) => {
setAccordion = (visible: boolean) => {
this.setState({ accordion: visible });
};

setAccordion2 = (visible) => {
setAccordion2 = (visible: boolean) => {
this.setState({ accordion2: visible });
}

setModalVisible(visible) {
setModalVisible(visible: boolean) {
this.setState({ modalVisible: visible });
}

Expand Down
22 changes: 20 additions & 2 deletions app/containers/ChangePassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,25 @@ import * as selectors from './selectors';
// import constants
import { role_option } from '../../constants';

class ChangePassword extends Component {
// @flow
type Props = {
errorFields: {
error_confirm_password: boolean,
error_current_password: boolean,
error_new_password: boolean,
error_password_not_the_same: boolean
},
inputFields: {
confirm_password: string,
current_password: string,
new_password: string
},
isLoading: boolean,
isPasswordUpdated: boolean,
isPasswordWrong: boolean
};

class ChangePassword extends Component<Props> {
/*
* initialize some state
*/
Expand All @@ -34,7 +52,7 @@ class ChangePassword extends Component {
this.props.resetState()
}

handleInputChange = (field, value) => {
handleInputChange = (field: string, value: string) => {
const { errorFields } = this.props || {};
const { error_password_not_the_same } = errorFields || false;

Expand Down
87 changes: 57 additions & 30 deletions app/containers/Feed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ import {
AsyncStorage,
Modal,
Alert,
BackHandler,
KeyboardAvoidingView,
ScrollView,
TouchableHighlight,
WebView,
Platform
} from 'react-native';
import { func, bool, object, array, string } from 'prop-types';
import ImagePicker from 'react-native-image-crop-picker';
import { createStructuredSelector } from 'reselect';
import { connect } from 'react-redux';
Expand All @@ -57,8 +55,7 @@ import * as actions from './actions';
import * as selectors from './selectors';
import OrderList from '../OrderList';
import Redeem from '../Redeem';
import { PRIMARYCOLOR } from '../../constants';
import { API_BASE_URL } from '../../constants';
import { PRIMARYCOLOR, API_BASE_URL } from '../../constants';
import { CONTENT_REPORT, TWITTER_ICON, FACEBOOK_ICON, WHATSAPP_ICON } from './constants';
import { isConfirm } from '../../helpers';
import { getIsConfirmEmail } from '../OrderList/selectors';
Expand All @@ -71,7 +68,7 @@ const noFeeds = require('./../../../assets/images/nofeed.png');
function subscribeToFeeds(cb) {
socket.on('feeds', data => cb(null, data));
}

// @flow
const today = new Date();
const date = `${today.getFullYear()}-${today.getMonth() + 1}-${today.getDate()}`;
const time = `${today.getHours()}:${today.getMinutes()}:${today.getSeconds()}`;
Expand Down Expand Up @@ -142,7 +139,51 @@ const mapStateToProps = () =>
isConfirmEmail: getIsConfirmEmail()
});

class Feed extends Component {
type Links = {
attachment: string
};

type ImageObject = {
path?: string,
sourceURL?: string,
mime: string
};

type Props = {
isFetching: boolean,
feeds?: Array<mixed>,
links?: Links,
isPosting: boolean,
imagesData?: ImageObject,
textData: string,
isRemoving: boolean
};

type ShareObject = {
message: string,
url: string
};

type State = {
userId: Array<number>,
userPostID: string,
postId: string,
firstName: string,
lastName: string,
profileUrl: string,
imagePreview: string,
report: string,
fabActive: boolean,
modalRedeem: boolean,
modalVisible: boolean,
postToFeeds: boolean,
modalReport: boolean,
optionVisible: boolean,
shareOptions: ShareObject,
shareTwitter: ShareObject
};

class Feed extends Component<Props, State> {
constructor(props) {
super(props);
this.state = {
Expand All @@ -168,7 +209,7 @@ class Feed extends Component {
console.ignoredYellowBox = [ 'Setting a timer' ];
subscribeToFeeds((err, data) => this.props.updateFeeds(data));
}

componentWillMount() {
this.props.setTokenHeader(this.props.currentPage);

Expand All @@ -191,19 +232,19 @@ class Feed extends Component {
this.setState({ visible: false });
};

setModalVisible = (visible, image) => {
setModalVisible = (visible: boolean, image: string) => {
this.setState({ modalVisible: visible, imagePreview: image });
};

setModalRedeem = (visible) => {
setModalRedeem = (visible: boolean) => {
this.setState({ modalRedeem: visible });
};

setModalReport = (visible) => {
this.setState({ modalReport: visible });
};

setModalWebView = (visible, link) => {
setModalWebView = (visible: boolean, link: string) => {
this.setState({ modalWebView: visible });
this.state.link = link;
};
Expand All @@ -218,7 +259,7 @@ class Feed extends Component {

_keyExtractor = (item, index) => item.id;

onOpen = (message, attachment) => {
onOpen = (message: string, attachment: string) => {
Share.open({
title: 'Devsummit Indonesia',
message,
Expand All @@ -227,7 +268,7 @@ class Feed extends Component {
});
};

alertRemoveFeed = (postId) => {
alertRemoveFeed = (postId: number) => {
Alert.alert(
'',
'Are you sure you want to delete this post?',
Expand All @@ -239,12 +280,12 @@ class Feed extends Component {
);
};

removeFeed = (postId) => {
removeFeed = (postId: number) => {
this.props.removeFeed(postId);
this.setState({ optionVisible: false });
};

alertReportFeed = (postId) => {
alertReportFeed = (postId: number) => {
Alert.alert(
'',
'Are you sure you want to report this post?',
Expand All @@ -256,12 +297,12 @@ class Feed extends Component {
);
};

reportFeed = (postId) => {
reportFeed = (postId: number) => {
this.props.reportFeed(postId);
this.setState({ optionVisible: false });
};

handleInputChange = (value) => {
handleInputChange = (value: string) => {
this.setState({ report: value });
};

Expand Down Expand Up @@ -609,7 +650,6 @@ class Feed extends Component {
/>
</View>
</Modal>

{/* Modal for picture preview */}
<Modal
animationType={'fade'}
Expand Down Expand Up @@ -696,17 +736,4 @@ class CustomInput extends Component {
}
}

Feed.PropTypes = {
updateFeeds: func,
fetchFeeds: func,
postFeeds: func,
isFetching: bool,
isFetchingMore: bool,
feeds: array,
isRemoving: bool,
removeFeed: func,
reportFeed: func,
link: string
};

export default connect(mapStateToProps, actions)(Feed);
Loading