parent
46228c6b18
commit
25111f9de4
7 changed files with 103 additions and 35 deletions
@ -0,0 +1,28 @@ |
|||||||
|
import React from 'react'; |
||||||
|
import PropTypes from 'prop-types'; |
||||||
|
|
||||||
|
const CompletionItem = (props) => { |
||||||
|
let className = 'vimvixen-console-completion-item'; |
||||||
|
if (props.highlight) { |
||||||
|
className += ' vimvixen-completion-selected'; |
||||||
|
} |
||||||
|
return <li |
||||||
|
className={className} |
||||||
|
style={{ backgroundImage: 'url(' + props.icon + ')' }} |
||||||
|
> |
||||||
|
<span |
||||||
|
className='vimvixen-console-completion-item-caption' |
||||||
|
>{props.caption}</span> |
||||||
|
<span |
||||||
|
className='vimvixen-console-completion-item-url' |
||||||
|
>{props.url}</span> |
||||||
|
</li>; |
||||||
|
}; |
||||||
|
|
||||||
|
CompletionItem.propTypes = { |
||||||
|
highlight: PropTypes.bool, |
||||||
|
caption: PropTypes.string, |
||||||
|
url: PropTypes.string, |
||||||
|
}; |
||||||
|
|
||||||
|
export default CompletionItem; |
@ -0,0 +1,14 @@ |
|||||||
|
import React from 'react'; |
||||||
|
import PropTypes from 'prop-types'; |
||||||
|
|
||||||
|
const CompletionTitle = (props) => { |
||||||
|
return <li className='vimvixen-console-completion-title'> |
||||||
|
{props.title} |
||||||
|
</li>; |
||||||
|
}; |
||||||
|
|
||||||
|
CompletionTitle.propTypes = { |
||||||
|
title: PropTypes.string, |
||||||
|
}; |
||||||
|
|
||||||
|
export default CompletionTitle; |
Reference in new issue