generated from lighthouse-labs/scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
appointment component added to main application.
- Loading branch information
1 parent
c47c409
commit d482f69
Showing
6 changed files
with
160 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React, { useState } from "react"; | ||
import Button from "components/Button"; | ||
import InterviewerList from "components/InterviewerList"; | ||
|
||
|
||
|
||
export default function Form(props) { | ||
|
||
const [name, setName] = useState(props.name || ""); | ||
const valueChange = (event) => { | ||
return setName(event.target.value); | ||
} | ||
|
||
const [interviewer, setInterviewer] = useState(props.interviewer || null); | ||
|
||
const reset = (event) => { | ||
setName(""); | ||
setInterviewer(null); | ||
} | ||
const cancel = (event) => { | ||
reset(); | ||
props.onCancel() | ||
} | ||
|
||
return ( | ||
<main className="appointment__card appointment__card--create"> | ||
<section className="appointment__card-left"> | ||
<form autoComplete="off" | ||
onSubmit={event => event.preventDefault()}> | ||
<input | ||
value={name} | ||
className="appointment__create-input text--semi-bold" | ||
name="name" | ||
type="text" | ||
placeholder="Enter Student Name" | ||
onChange={valueChange} | ||
/> | ||
</form> | ||
<InterviewerList | ||
interviewers={props.interviewers} | ||
value={interviewer} | ||
onChange={setInterviewer} | ||
/> | ||
</section> | ||
<section className="appointment__card-right"> | ||
<section className="appointment__actions"> | ||
<Button onClick={cancel} danger>Cancel</Button> | ||
<Button onClick={props.onSave} confirm>Save</Button> | ||
</section> | ||
</section> | ||
</main> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import React from "react"; | ||
|
||
import "components/Appointment/styles.scss"; | ||
import Header from "components/Appointment/Header"; | ||
import Show from "components/Appointment/Show"; | ||
import Empty from "components/Appointment/Empty"; | ||
|
||
export default function Appointment(props) { | ||
|
||
return ( | ||
<article className="appointment"></article> | ||
<article className="appointment"> | ||
<Header time={props.time} /> | ||
{props.interview ? | ||
<Show | ||
student={props.interview.student} | ||
interviewer={props.interview.interviewer} | ||
/> : <Empty />} | ||
</article> | ||
) | ||
} |
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