-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ add pending state to comment form and user search
- Loading branch information
1 parent
6a49298
commit e7aacb6
Showing
3 changed files
with
44 additions
and
35 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
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,54 +1,61 @@ | ||
import React from 'react'; | ||
import { UserSearch as UserSearchComponent } from '../../lib'; | ||
import StoryItem from '../styleguide/StoryItem'; | ||
import React from "react"; | ||
import { UserSearch as UserSearchComponent } from "../../lib"; | ||
import StoryItem from "../styleguide/StoryItem"; | ||
|
||
const mockUser = { | ||
id: 2, | ||
name: 'Bruce', | ||
name: "Bruce", | ||
avatar: | ||
'https://gathercontent-production-avatars.s3-us-west-2.amazonaws.com/208205_yHGd7vA5HRxsnMQpES4UzjJ7Yxgn6Bp54165gqksRXyDJhuOnW88H6djhLJeE2BZ.jpg', | ||
initials: 'BB', | ||
display: 'brucebanner', | ||
email: '[email protected]' | ||
"https://gathercontent-production-avatars.s3-us-west-2.amazonaws.com/208205_yHGd7vA5HRxsnMQpES4UzjJ7Yxgn6Bp54165gqksRXyDJhuOnW88H6djhLJeE2BZ.jpg", | ||
initials: "BB", | ||
display: "brucebanner", | ||
email: "[email protected]", | ||
}; | ||
|
||
const mockUsers = [ | ||
mockUser, | ||
{ | ||
id: 'saul', | ||
display: 'saulgoodman', | ||
name: 'Saul Goodman', | ||
initials: 'SG', | ||
email: '[email protected]' | ||
id: 1337, | ||
name: "Alan Turing", | ||
initials: "AT", | ||
display: "Alan T.", | ||
email: "[email protected]", | ||
pending: "true", | ||
}, | ||
{ | ||
id: '456', | ||
display: 'jessepinkman', | ||
name: 'Jesse Pinkman', | ||
email: '[email protected]', | ||
initials: 'JP', | ||
url: | ||
'https://d3iw72m71ie81c.cloudfront.net/2eae47ef-6f37-46fe-a02b-52cff401a8f9-me.jpg' | ||
} | ||
id: "saul", | ||
display: "saulgoodman", | ||
name: "Saul Goodman", | ||
initials: "SG", | ||
email: "[email protected]", | ||
}, | ||
{ | ||
id: "456", | ||
display: "jessepinkman", | ||
name: "Jesse Pinkman", | ||
email: "[email protected]", | ||
initials: "JP", | ||
url: "https://d3iw72m71ie81c.cloudfront.net/2eae47ef-6f37-46fe-a02b-52cff401a8f9-me.jpg", | ||
}, | ||
]; | ||
|
||
export default { | ||
title: 'Legacy/User Search', | ||
title: "Legacy/User Search", | ||
component: UserSearchComponent, | ||
args: { | ||
displayEmail: true, | ||
useDisplayToggle: false, | ||
subheading: '', | ||
noUserDisplay: 'Looks like there are no people!', | ||
searchHeading: 'Search...', | ||
minUserLength: 0 | ||
subheading: "", | ||
noUserDisplay: "Looks like there are no people!", | ||
searchHeading: "Search...", | ||
minUserLength: 0, | ||
}, | ||
argTypes: { | ||
addUser: { action: 'User was clicked' } | ||
} | ||
addUser: { action: "User was clicked" }, | ||
}, | ||
}; | ||
|
||
export const UserSearch = (args: any) => { | ||
export function UserSearch(args: any) { | ||
return ( | ||
<div> | ||
<StoryItem | ||
|
@@ -57,10 +64,10 @@ export const UserSearch = (args: any) => { | |
> | ||
<UserSearchComponent | ||
users={mockUsers} | ||
selectedUserIds={['456']} | ||
selectedUserIds={["456"]} | ||
{...args} | ||
/> | ||
</StoryItem> | ||
</div> | ||
); | ||
}; | ||
} |