Commit e0490a19 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add fine confirmation message

parent eff5b066
......@@ -15,14 +15,22 @@ import * as eventActions from '../actions/event';
import * as registrationActions from '../actions/registration';
class Event extends Component {
cancelPrompt = pk => Alert.alert(
'Cancel registration?',
'Are you sure you want to cancel your registration?',
[
{ text: 'Dismiss' },
{ text: 'Cancel registration', onPress: () => this.props.cancel(pk) },
],
);
cancelPrompt = (pk) => {
const cancelDeadlineDate = new Date(this.props.data.cancel_deadline);
let message = 'Are you sure you want to cancel your registration?';
if (this.props.data.cancel_deadline !== null && cancelDeadlineDate <= new Date()) {
message = 'The deadline has passed, are you sure you want to cancel your registration and'
+ ` pay the full costs of €${this.props.data.fine}? You will not be able to undo this!`;
}
return Alert.alert(
'Cancel registration?',
message,
[
{ text: 'Dismiss' },
{ text: 'Cancel registration', onPress: () => this.props.cancel(pk) },
],
);
};
eventDesc = (data) => {
const startDate = Moment(data.start).format('D MMM YYYY, HH:mm');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment