-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Choose a date & Time - design update (#31897)
* started a temp data file, and working through some changes. * source temp referral data * added selector and move date selection to redux * added ability to override the default max days and a little house keeping * utilize the new overrideMaxDays prop * added path to choose page * wrapped in fragment to avoid propType error from FormLayout * added pseudo routing * tz string update * switched to generic values.
- Loading branch information
Showing
5 changed files
with
212 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
227 changes: 152 additions & 75 deletions
227
src/applications/vaos/referral-appointments/ChooseDateAndTime.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/applications/vaos/referral-appointments/temp-data/referral.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable no-plusplus */ | ||
const dateFns = require('date-fns'); | ||
|
||
const getAvailableSlots = (number = 2) => { | ||
const slots = []; | ||
const tomorrow = dateFns.addDays(dateFns.startOfDay(new Date()), 1); | ||
let hourFromNow = 12; | ||
for (let i = 0; i < number; i++) { | ||
const startTime = dateFns.addHours(tomorrow, hourFromNow); | ||
slots.push({ | ||
end: dateFns.addMinutes(startTime, 30).toISOString(), | ||
id: Math.floor(Math.random() * 90000) + 10000, | ||
start: startTime.toISOString(), | ||
}); | ||
hourFromNow++; | ||
} | ||
return slots; | ||
}; | ||
const referral = { | ||
providerName: 'Dr. Face', | ||
typeOfCare: 'Dermatology', | ||
orgName: 'New Skin Technologies', | ||
orgAddress: { | ||
street1: '111 Lori Ln.', | ||
street2: '', | ||
street3: '', | ||
city: 'New York', | ||
state: 'New York', | ||
zip: '10016', | ||
}, | ||
orgPhone: '555-867-5309', | ||
driveTime: '7 minute drive', | ||
driveDistance: '8 miles', | ||
slots: getAvailableSlots(), | ||
preferredDate: new Date(), | ||
timezone: 'America/Denver', | ||
}; | ||
|
||
module.exports = { getAvailableSlots, referral }; |