mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
remove
This commit is contained in:
parent
e1b52fb382
commit
f889cd3ed2
@ -1,61 +0,0 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
import "./index.less"
|
||||
|
||||
class Results extends React.Component {
|
||||
state = {
|
||||
results: this.props.results ?? []
|
||||
}
|
||||
|
||||
renderResults = () => {
|
||||
return this.state.results.map(result => {
|
||||
return <div id={result.id}>
|
||||
{result.title}
|
||||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>
|
||||
{this.renderResults()}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
export default class AppSearcher extends React.Component {
|
||||
state = {
|
||||
loading: false,
|
||||
searchResult: null,
|
||||
}
|
||||
|
||||
handleSearch = (value) => {
|
||||
let results = []
|
||||
|
||||
// get results
|
||||
results.push({ id: value, title: value })
|
||||
|
||||
// storage results
|
||||
this.setState({ searchResult: results })
|
||||
|
||||
// open results onlayout drawer
|
||||
this.openResults()
|
||||
}
|
||||
|
||||
openResults = () => {
|
||||
window.app.SidedrawerController.render(() => <Results results={this.state.searchResult} />)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<antd.Input.Search
|
||||
style={{ width: this.props.width }}
|
||||
className="search_bar"
|
||||
placeholder="Search on app..."
|
||||
loading={this.state.loading}
|
||||
onSearch={this.handleSearch}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
@import "theme/index.less";
|
||||
|
||||
.search_bar {
|
||||
user-select: none;
|
||||
--webkit-user-select: none;
|
||||
|
||||
height: fit-content;
|
||||
border: 0;
|
||||
border-radius: 7px !important;
|
||||
vertical-align: middle !important;
|
||||
|
||||
.ant-input {
|
||||
background-color: var(--background-color-accent) !important;
|
||||
border-color: var(--background-color-accent) !important;
|
||||
color: var(--background-color-contrast) !important;
|
||||
}
|
||||
|
||||
.ant-input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.ant-input-group-addon {
|
||||
width: fit-content;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
background-color: var(--background-color-primary) !important;
|
||||
border: 0 !important;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user