File size: 1,910 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
// @flow
import * as React from "react";
import { List, Icon, Media, SocialNetworksList, Tooltip } from "../";
export type Props = {|
+children?: React.Node,
+className?: string,
+name: string,
+workTitle: string,
+facebook?: string,
+twitter?: string,
+phone?: string,
+skype?: string,
|};
function MediaBodySocial({
className,
children,
name,
workTitle,
facebook = "",
twitter = "",
phone = "",
skype = "",
}: Props): React.Node {
let fbIcon;
let twitterIcon;
let phoneIcon;
let skypeIcon;
if (facebook) {
fbIcon = (
<List.Item inline>
<Tooltip content="Facebook" placement="top">
<a href="/Profile">
<Icon prefix="fa" name="facebook" />
</a>
</Tooltip>
</List.Item>
);
}
if (twitter) {
twitterIcon = (
<List.Item inline>
<Tooltip content="Twitter" placement="top">
<a href="/Profile">
<Icon prefix="fa" name="twitter" />
</a>
</Tooltip>
</List.Item>
);
}
if (phone) {
phoneIcon = (
<List.Item inline>
<Tooltip content="+1 234-567-8901" placement="top">
<a href="/Profile">
<Icon prefix="fa" name="phone" />
</a>
</Tooltip>
</List.Item>
);
}
if (skype) {
skypeIcon = (
<List.Item inline>
<Tooltip content="@skypename" placement="top">
<a href="/Profile">
<Icon prefix="fa" name="skype" />
</a>
</Tooltip>
</List.Item>
);
}
return (
<Media.Body>
<h4 className="m-0">{name}</h4>
<p className="text-muted mb-0">{workTitle}</p>
<SocialNetworksList className="mb-0 mt-2">
{fbIcon}
{twitterIcon}
{phoneIcon}
{skypeIcon}
</SocialNetworksList>
{children}
</Media.Body>
);
}
export default MediaBodySocial;
|