diff --git a/example/src/pages/ProfilePage.react.js b/example/src/pages/ProfilePage.react.js
index 9e5796dc..64100326 100644
--- a/example/src/pages/ProfilePage.react.js
+++ b/example/src/pages/ProfilePage.react.js
@@ -28,24 +28,29 @@ function ProfilePage() {
name="Peter Richards"
backgroundURL="demo/photos/eberhard-grossgasteiger-311213-500.jpg"
avatarURL="demo/faces/male/16.jpg"
- socialNetworksObjects={[
- { name: "twitter", to: "test", label: "Follow" },
- ]}
+ twitterURL="test"
>
Big belly rude boy, million dollar hustler. Unemployed.
-
+
+
+
+
+
+
+
+
My Profile
@@ -89,10 +94,11 @@ function ProfilePage() {
- }
- >
+
+
+
+
diff --git a/src/components/Media/MediaBodySocial.react.js b/src/components/Media/MediaBodySocial.react.js
index c4ab009d..39834166 100644
--- a/src/components/Media/MediaBodySocial.react.js
+++ b/src/components/Media/MediaBodySocial.react.js
@@ -1,16 +1,17 @@
// @flow
import * as React from "react";
-import { Media, SocialNetworksList } from "../";
-import type { itemObject } from "../SocialNetworksList/SocialNetworksList.react";
+import { List, Icon, Media, SocialNetworksList, Tooltip } from "../";
export type Props = {|
+children?: React.Node,
+className?: string,
+name: string,
+workTitle: string,
- +itemsObjects?: Array,
- +items?: Array,
+ +facebook?: string,
+ +twitter?: string,
+ +phone?: string,
+ +skype?: string,
|};
function MediaBodySocial({
@@ -18,18 +19,73 @@ function MediaBodySocial({
children,
name,
workTitle,
- itemsObjects,
- items,
+ facebook = "",
+ twitter = "",
+ phone = "",
+ skype = "",
}: Props): React.Node {
+ let fbIcon;
+ let twitterIcon;
+ let phoneIcon;
+ let skypeIcon;
+
+ if (facebook) {
+ fbIcon = (
+
+
+
+
+
+
+
+ );
+ }
+
+ if (twitter) {
+ twitterIcon = (
+
+
+
+
+
+
+
+ );
+ }
+
+ if (phone) {
+ phoneIcon = (
+
+
+
+
+
+
+
+ );
+ }
+
+ if (skype) {
+ skypeIcon = (
+
+
+
+
+
+
+
+ );
+ }
return (
{name}
{workTitle}
-
+
+ {fbIcon}
+ {twitterIcon}
+ {phoneIcon}
+ {skypeIcon}
+
{children}
);
diff --git a/src/components/Profile/Profile.react.js b/src/components/Profile/Profile.react.js
index a0108442..2108102a 100644
--- a/src/components/Profile/Profile.react.js
+++ b/src/components/Profile/Profile.react.js
@@ -3,90 +3,45 @@
import * as React from "react";
import cn from "classnames";
-import {
- Card,
- Header,
- SocialNetworksList,
- Media,
- Avatar,
-} from "../../components";
+import { Card, Header, SocialNetworksList } from "../../components";
import ProfileImage from "./ProfileImage.react";
-import type { itemObject } from "../SocialNetworksList/SocialNetworksList.react";
-
-export type PropsForAll = {|
+export type Props = {|
+children?: React.Node,
+className?: string,
+name: string,
+avatarURL?: string,
+twitterURL?: string,
- +facebookURL?: string,
- +socialNetworksObjects?: Array,
-|};
-
-type layout1 = {|
- ...PropsForAll,
- +layout?: 1,
+backgroundURL?: string,
+bio?: string,
|};
-type layout2 = {|
- ...PropsForAll,
- +layout: 2,
- +jobTitle?: string,
-|};
-
-type Props = layout1 | layout2;
-
-function Profile(props: Props): React.Node {
- const {
- className,
- children,
- name,
- avatarURL = "",
- socialNetworksObjects,
- } = props;
- const classes = cn(
- { "card-profile": !props.layout || props.layout === 1 },
- className
+function Profile({
+ className,
+ children,
+ name,
+ avatarURL = "",
+ twitterURL = "",
+ backgroundURL = "",
+ bio,
+}: Props): React.Node {
+ const classes = cn("card-profile", className);
+ return (
+
+
+
+
+ {name}
+ {bio || children}
+
+
+
);
- if (!props.layout || props.layout === 1) {
- const { bio, backgroundURL = "" } = props;
- return (
-
-
-
-
- {name}
- {bio || children}
-
-
-
- );
- }
- if (props.layout === 2) {
- const { jobTitle = "" } = props;
- return (
-
-
-
-
-
-
-
-
- );
- }
}
Profile.Image = ProfileImage;
diff --git a/src/components/SocialNetworksList/SocialNetworksList.react.js b/src/components/SocialNetworksList/SocialNetworksList.react.js
index c109488e..915ee985 100644
--- a/src/components/SocialNetworksList/SocialNetworksList.react.js
+++ b/src/components/SocialNetworksList/SocialNetworksList.react.js
@@ -2,18 +2,13 @@
import * as React from "react";
import cn from "classnames";
-import { List, Icon, Button, Tooltip } from "../";
-import { Placement } from "react-popper";
+import { List, Icon, Button } from "../";
-export type itemObject = {|
+type itemObject = {|
name: string,
label?: string,
to?: string,
tooltip?: string,
- /**
- * Tooltip placement
- */
- placement?: Placement,
color?: string,
|};
@@ -30,31 +25,17 @@ function listItemFromObjectFactory(
asButtons: boolean = false,
iconPrefix: string
) {
- return ({
- tooltip,
- placement = "top",
- to,
- name,
- label,
- ...item
- }: itemObject) => {
+ return (item: itemObject) => {
const itemContent = asButtons ? (
-