Skip to content

Commit

Permalink
Update EmailHeader docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Oct 21, 2020
1 parent 8393a88 commit c613701
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion src/components/EmailHeader/EmailHeader.md
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}
/>
```

0 comments on commit c613701

Please sign in to comment.