From 7c1577505e734041136fdef630ef5f6ba84eff2a Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Wed, 11 Oct 2023 15:58:06 +0800 Subject: [PATCH 1/2] 00 search result support keyboard --- .../components/search/search-result-item.js | 14 ++++++-- frontend/src/components/search/search.js | 33 ++++++++++++++++++- frontend/src/css/search.css | 4 +-- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/search/search-result-item.js b/frontend/src/components/search/search-result-item.js index 200dcea2e11..e9c4f7a71bf 100644 --- a/frontend/src/components/search/search-result-item.js +++ b/frontend/src/components/search/search-result-item.js @@ -1,10 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; +import classnames from 'classnames'; import { Utils } from '../../utils/utils'; const propTypes = { item: PropTypes.object.isRequired, onItemClickHandler: PropTypes.func.isRequired, + onMouseEnter: PropTypes.func, + onMouseLeave: PropTypes.func, + isHighlight: PropTypes.bool, }; class SearchResultItem extends React.Component { @@ -16,7 +20,6 @@ class SearchResultItem extends React.Component { render() { let item = this.props.item; - let className = item.link_content ? 'item-img' : 'lib-item-img'; let folderIconUrl = item.link_content ? Utils.getFolderIconUrl(false, 192) : Utils.getDefaultLibIconUrl(true); let fileIconUrl = item.is_dir ? folderIconUrl : Utils.getFileIconUrl(item.name, 192); @@ -25,8 +28,13 @@ class SearchResultItem extends React.Component { } return ( -