-
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.
- Loading branch information
Justin Campbell
committed
Oct 21, 2020
1 parent
8393a88
commit c613701
Showing
1 changed file
with
56 additions
and
1 deletion.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,64 @@ | ||
| Description of EmailHeader. | ||
| Displays an email header with name, email, time sent, and recipients if present. | ||
|
|
||
| --- | ||
|
|
||
| Default usage, without props. | ||
| ```jsx | ||
| import EmailHeader from "./EmailHeader"; | ||
| <EmailHeader /> | ||
| ``` | ||
| ```jsx static | ||
| <EmailHeader /> | ||
| ``` | ||
|
|
||
| With `datetime`, `from_name` and `from_email` props. When `first_name` is passed, the [UserAvatar](/#/Components/UserAvatar) will display the first letter of the name. | ||
| ```jsx | ||
| import EmailHeader from "./EmailHeader"; | ||
|
|
||
| const demo_data = { | ||
| "datetime": "2020-05-11T13:44:12+0000", | ||
| "from_name": "Di Wang", | ||
| "from_email": "wang2039@purdue.edu", | ||
| }; | ||
|
|
||
| <EmailHeader datetime={demo_data.datetime} from_name={demo_data.from_name} from_email={demo_data.from_email} /> | ||
|
|
||
| ``` | ||
| ```jsx static | ||
| <EmailHeader datetime={demo_data.datetime} from_name={demo_data.from_name} from_email={demo_data.from_email} /> | ||
| ``` | ||
|
|
||
| You can add to/cc data by passing `to` and `cc` props. | ||
| ```jsx | ||
| import EmailHeader from "./EmailHeader"; | ||
|
|
||
| const demo_data = { | ||
| "datetime": "2020-05-11T13:44:12+0000", | ||
| "from_name": "Di Wang", | ||
| "from_email": "wang2039@purdue.edu", | ||
| "to": [ | ||
| { | ||
| "name": "'cesite@ecn.purdue.edu'", | ||
| "email": "cesite@ecn.purdue.edu" | ||
| } | ||
| ], | ||
| "cc": [ | ||
| { | ||
| "name": "Zavattieri, Pablo D", | ||
| "email": "zavattie@purdue.edu" | ||
| } | ||
| ] | ||
| }; | ||
|
|
||
| <EmailHeader | ||
| datetime={demo_data.datetime} from_name={demo_data.from_name} from_email={demo_data.from_email} | ||
| to={demo_data.to} cc={demo_data.cc} | ||
| /> | ||
|
|
||
| ``` | ||
| ```jsx static | ||
| <EmailHeader | ||
| datetime={demo_data.datetime} from_name={demo_data.from_name} from_email={demo_data.from_email} | ||
| to={demo_data.to} cc={demo_data.cc} | ||
| /> | ||
| ``` |