-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* User react kit created Almost done -- need to default online status to null * User react kit completed * Multiple users (#443) * multiple-users-wip * multiple-users-wip * added users * progress * multiple_users_wip * Multiple Users Support Branch (#444) * Changed snake-case to camelCase in js files
- Loading branch information
1 parent
442fc77
commit 8cfb850
Showing
9 changed files
with
205 additions
and
18 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 |
---|---|---|
|
@@ -75,4 +75,4 @@ const Avatar = ({ | |
) | ||
} | ||
|
||
export default Avatar | ||
export default Avatar |
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,21 +1,66 @@ | ||
/* @flow */ | ||
|
||
import React from 'react'; | ||
import PropTypes from "prop-types"; | ||
|
||
const propTypes = { | ||
className: PropTypes.string, | ||
id: PropTypes.string | ||
}; | ||
|
||
class User extends React.Component { | ||
render() { | ||
return ( | ||
<div className="pb_user"> | ||
<span>USER CONTENT</span> | ||
</div> | ||
) | ||
} | ||
import classnames from 'classnames'; | ||
|
||
import { | ||
Title, | ||
Body, | ||
Avatar | ||
} from '../' | ||
|
||
type UserProps = { | ||
className?: String, | ||
id?: String, | ||
name: String, | ||
title?: String, | ||
size?: 'sm' | 'md' | 'lg', | ||
align?: 'left' | 'center' | 'right', | ||
orientation?: 'horiztonal' | 'vertical', | ||
avatar?: Boolean, | ||
avatarUrl?: String, | ||
} | ||
|
||
const userSizes = { | ||
sm: 4, | ||
md: 4, | ||
lg: 3, | ||
} | ||
|
||
User.propTypes = propTypes; | ||
const avatarSizes = { | ||
sm: 'sm', | ||
md: 'md', | ||
lg: 'xl', | ||
} | ||
|
||
const User = (props: UserProps) => { | ||
const { | ||
name='Anna Black', | ||
title='', | ||
align='left', | ||
orientation='horizontal', | ||
size='sm', | ||
avatar=false, | ||
avatarUrl, | ||
} = props | ||
|
||
const print_avatar = (avatar, avatarUrl) => { | ||
if (avatar == true | avatarUrl != null ) { | ||
return ( | ||
<Avatar name={name} size={avatarSizes[size]} image_url={avatarUrl}/> | ||
) | ||
} | ||
} | ||
|
||
return ( | ||
<div className={`pb_user_kit_${align}_${orientation}_${size}`}> | ||
{print_avatar(avatar, avatarUrl)} | ||
<div className="content_wrapper"> | ||
<Title size={userSizes[size]} text={`${name}`}/> | ||
<Body color='light'>{`${title}`}</Body> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default User; |
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,31 @@ | ||
import React from "react" | ||
import {User} from "../../" | ||
|
||
function UserDefault() { | ||
return ( | ||
<div class="pb--doc-demo-row"> | ||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
size='sm' | ||
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" | ||
/> | ||
|
||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
size='md' | ||
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" | ||
/> | ||
|
||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
size='lg' | ||
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg" | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default UserDefault; |
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,24 @@ | ||
import React from "react" | ||
import {User} from "../../" | ||
|
||
function UserTextOnly() { | ||
return ( | ||
<div class="pb--doc-demo-row"> | ||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
orientation='horizontal' | ||
align='center' | ||
size='lg' | ||
/> | ||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
orientation='horizontal' | ||
align='left' | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default UserTextOnly; |
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,37 @@ | ||
import React from "react" | ||
import {User} from "../../" | ||
|
||
function UserVerticalSize() { | ||
return ( | ||
<div> | ||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
orientation='vertical' | ||
align='center' | ||
size='sm' | ||
avatarUrl='https://randomuser.me/api/portraits/women/44.jpg' | ||
/> | ||
<br/><br/> | ||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
orientation='vertical' | ||
align='center' | ||
size='md' | ||
avatarUrl='https://randomuser.me/api/portraits/women/44.jpg' | ||
/> | ||
<br/><br/> | ||
<User | ||
name='Anna Black' | ||
title='Remodeling Consultant' | ||
orientation='vertical' | ||
align='center' | ||
size='lg' | ||
avatarUrl='https://randomuser.me/api/portraits/women/44.jpg' | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default UserVerticalSize; |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export {default as UserDefault} from './_user_default.jsx'; | ||
export {default as UserTextOnly} from './_user_text_only.jsx'; | ||
export {default as UserSize} from './_user_size.jsx'; | ||
export {default as UserVerticalSize} from './_user_vertical_size.jsx'; | ||
|