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

Web-example hotel changes #417

Open
wants to merge 22 commits into
base: web-examples
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b98b21a
re-working the hotel example flow
nicktaras Jan 19, 2021
20016dc
added json flow
nicktaras Jan 19, 2021
90842ea
added logic to further new flow.
nicktaras Jan 19, 2021
b1d85d7
end to end demo ui updated
nicktaras Jan 20, 2021
0674340
code tidy with annotations
nicktaras Jan 20, 2021
b9e6cf1
added most upto date third-party-example. along with the v2 vesion.
nicktaras Jan 20, 2021
2336cab
added heroku endpoint in place of the hotel data
nicktaras Jan 21, 2021
bdbceb7
using demo iframe for now
nicktaras Jan 21, 2021
dd5810f
connected application to new tokenscript.js using heroku data
nicktaras Jan 21, 2021
6372100
added annotations
nicktaras Jan 21, 2021
45c9e1d
updated discount calc
nicktaras Jan 21, 2021
330bd1d
removed lib files. Now working from the heroku lib
nicktaras Jan 21, 2021
4edc40e
updated ui to work with filters. Tidied code naming of components
nicktaras Jan 26, 2021
9f28327
added filter logic to discount tickets defined by webster
nicktaras Jan 28, 2021
aa0a0cf
code tidy
nicktaras Jan 28, 2021
4f316e0
ui adjustments
nicktaras Jan 31, 2021
2ff9db3
added logic for date picker to select date
nicktaras Jan 31, 2021
3ffcb28
updated thirdparty-example
nicktaras Feb 5, 2021
a0dac20
merged the react-thrid-party-examples into a single example
nicktaras Feb 6, 2021
0844c45
removed conditional logic for hotel discount
nicktaras Feb 6, 2021
1b8bdc1
text update
nicktaras Feb 6, 2021
448079b
logic to show ticket instruction to user when there are tickets only
nicktaras Feb 7, 2021
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
Prev Previous commit
Next Next commit
added logic for date picker to select date
nicktaras committed Jan 31, 2021
commit 2ff9db3add8d4f41bc09bb8cb3152765d7c7a1a9
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import React, { useReducer } from "react";
import React, { useState } from "react";
import DatePicker from './../DatePicker';

const BookingDate = () => {

var today = new Date();
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);

// Form state.
const [formInput, setFormInput] = useReducer((state, newState) => ({ ...state, ...newState }), { reference: "" });
const [formInput, setFormInput] = useState({
from: today,
to: tomorrow
});

// Handle date change input
const handleInput = evt => {
const name = evt.target.name;
const newValue = evt.target.value;
setFormInput({ [name]: newValue });
const handleInput = (newValue, label) => {
setFormInput({ [label]: newValue });
};

var today = new Date();
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);

return (
<div style={{ display: 'flex', justifyContent: 'center' }}>
<div style={{ display: 'flex', justifyContent: 'center', width: '80%' }}>
@@ -25,15 +26,15 @@ const BookingDate = () => {
name={'from'}
label={'from'}
handleInput={handleInput}
date={today}
date={formInput.from}
/>
</div>
<div style={{ margin: '10px' }}>
<DatePicker
name={'to'}
label={'to'}
handleInput={handleInput}
date={tomorrow}
date={formInput.to}
/>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -10,12 +10,6 @@ import { MuiPickersUtilsProvider, KeyboardDatePicker } from '@material-ui/picker
// Simply wraps the Date picker material ui component

export default function DatePicker({ label, handleInput, date }) {

const handleDateChange = (date) => {
setSelectedDate(date);
handleInput({ target: { name: label, value: date } });
};

return (
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<Grid container justify="space-around">
@@ -27,7 +21,7 @@ export default function DatePicker({ label, handleInput, date }) {
id="date-picker-inline"
label={label}
value={date}
onChange={handleDateChange}
onChange={e => handleInput(e, label)}
KeyboardButtonProps={{
'aria-label': 'change date',
}}