Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
another round of comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
bmdalex committed Feb 21, 2019
1 parent 6dadd4f commit 98d36e6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
4 changes: 2 additions & 2 deletions docs/src/prototypes/Prototypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ interface ComponentPrototypeProps extends PrototypeSectionProps {
description?: string
}

export const PrototypeSection: React.SFC<ComponentPrototypeProps> = props => (
export const PrototypeSection: React.FC<ComponentPrototypeProps> = props => (
<Box style={{ margin: 20 }}>
{props.title && <Header as="h1">{props.title}</Header>}
{props.children}
</Box>
)

export const ComponentPrototype: React.SFC<ComponentPrototypeProps> = props => (
export const ComponentPrototype: React.FC<ComponentPrototypeProps> = props => (
<Box style={{ marginTop: 20 }}>
{(props.title || props.description) && (
<Segment>
Expand Down
42 changes: 18 additions & 24 deletions docs/src/prototypes/dropdowns/inputWithDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class InputWithDropdown extends React.Component<{}, InputWithDropdownState> {
state = this.initialState

render() {
const { dropdownOpen, searchQuery } = this.state

return (
<>
<div
Expand All @@ -38,34 +40,26 @@ class InputWithDropdown extends React.Component<{}, InputWithDropdownState> {
onKeyUp={this.handleEditorKeyUp}
style={editorStyle}
/>
{this.renderDropdown()}
<CustomPortal mountNodeId="dropdown-mount-node" open={dropdownOpen}>
<Dropdown
defaultOpen={true}
inline
search
items={atMentionItems}
toggleIndicator={null}
searchInput={{
input: { autoFocus: true, size: searchQuery.length + 1 },
onInputKeyDown: this.handleInputKeyDown,
}}
onSelectedChange={this.handleSelectedChange}
onSearchQueryChange={this.handleSearchQueryChange}
noResultsMessage="We couldn't find any matches."
/>
</CustomPortal>
</>
)
}

private renderDropdown = () => {
const { dropdownOpen, searchQuery } = this.state

return (
<CustomPortal mountNodeId="dropdown-mount-node" open={dropdownOpen}>
<Dropdown
defaultOpen={true}
inline
search
items={atMentionItems}
toggleIndicator={null}
searchInput={{
input: { autoFocus: true, size: searchQuery.length + 1 },
onInputKeyDown: this.handleInputKeyDown,
}}
onSelectedChange={this.handleSelectedChange}
onSearchQueryChange={this.handleSearchQueryChange}
noResultsMessage="We couldn't find any matches."
/>
</CustomPortal>
)
}

private hideDropdownAndRestoreEditor = (cb?: () => void) => {
this.setState(this.initialState, () => {
this.tryFocusEditor()
Expand Down

0 comments on commit 98d36e6

Please sign in to comment.