Skip to content
Snippets Groups Projects
Commit 76e424a7 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Improved search-bar styling

parent eae33d68
No related branches found
No related tags found
1 merge request!3Master into new editor
...@@ -32,12 +32,34 @@ ...@@ -32,12 +32,34 @@
.searchbar-results { .searchbar-results {
overflow: hidden; overflow: hidden;
display: flex;
flex-direction: column;
position: absolute;
left: 10px;
top: 65px;
border-radius: 10px;
}
.searchbar-results-circle {
width: 15px;
height: 15px;
margin: 10px;
border-radius: 50%;
flex-shrink: 0;
} }
.searchbar-result { .searchbar-result {
cursor: pointer; cursor: pointer;
z-index: 99; z-index: 99;
pointer-events: all; pointer-events: all;
background: white;
border: 1px solid gray;
display: flex;
flex-direction: row;
margin-top: -1px ;
padding-left: 10px;
padding-right: 10px;
align-items: center;
} }
.searchbar-result:hover { .searchbar-result:hover {
...@@ -53,4 +75,5 @@ ...@@ -53,4 +75,5 @@
border-radius: 30px; border-radius: 30px;
padding-left: 10px; padding-left: 10px;
padding-right: 5px; padding-right: 5px;
position: relative;
} }
\ No newline at end of file
...@@ -23,10 +23,10 @@ function SearchBar({ minified, nodeSet, onSearch }: SearchBarProps) { ...@@ -23,10 +23,10 @@ function SearchBar({ minified, nodeSet, onSearch }: SearchBarProps) {
if (isMinified) { if (isMinified) {
setWidth(0); setWidth(0);
setInputText(""); setInputText("");
inputField.current.value = ""; // inputField.current.value = "";
} else { } else {
setWidth(100); setWidth(100);
inputField.current.focus(); //inputField.current.focus();
} }
}, [isMinified]); }, [isMinified]);
...@@ -61,40 +61,40 @@ function SearchBar({ minified, nodeSet, onSearch }: SearchBarProps) { ...@@ -61,40 +61,40 @@ function SearchBar({ minified, nodeSet, onSearch }: SearchBarProps) {
<div className={"searchbar-icon"} onClick={toggleMinified}> <div className={"searchbar-icon"} onClick={toggleMinified}>
&#128269; &#128269;
</div> </div>
<div></div>
<div <div
className={"searchbar-text"} className={"searchbar-text"}
style={{ width: width + "%" }} style={{ width: width + "%" }}
> >
<form className={"searchbar-form"} action={"#"}> {width > 0 && (
<input <form className={"searchbar-form"} action={"#"}>
ref={inputField} <input
className={"searchbar-input"} ref={inputField}
type={"search"} className={"searchbar-input"}
placeholder={"Knoten suchen..."} type={"search"}
onInput={handleInput} placeholder={"Knoten suchen..."}
onBlur={toggleMinified} onInput={handleInput}
></input> autoFocus={true}
</form> // onBlur={() => setMinified(true)}
></input>
</form>
)}
</div> </div>
</div> </div>
<div <div className={"searchbar-results"}>
className={"searchbar-results"} {filtered.map((el) => (
style={{ <div
height: inputText.length > 0 ? filtered.length * 30 : 0, key={el}
marginBottom: filtered.length > 0 ? 10 : 0, className={"searchbar-result"}
}} onMouseDown={() => handleNodeClick(el)}
> >
<ul> <div
{filtered.map((el) => ( className={"searchbar-results-circle"}
<li style={{ backgroundColor: "red" }}
key={el} ></div>
className={"searchbar-result"} <div>{el}</div>
onMouseDown={() => handleNodeClick(el)} </div>
> ))}
{el}
</li>
))}
</ul>
</div> </div>
</div> </div>
); );
......
...@@ -32,5 +32,5 @@ ...@@ -32,5 +32,5 @@
cursor: pointer; cursor: pointer;
font-size: 30px; font-size: 30px;
transform: rotate(-45deg); transform: rotate(-45deg);
margin-top: -4px; margin-top: -13px;
} }
\ No newline at end of file
...@@ -115,6 +115,7 @@ class Display extends React.Component< ...@@ -115,6 +115,7 @@ class Display extends React.Component<
ref={this.fullscreenRef} ref={this.fullscreenRef}
> >
<div className={"display-icons"}> <div className={"display-icons"}>
{" "}
<div <div
className={"display-fullscreen-button no-select"} className={"display-fullscreen-button no-select"}
title={"Vollbild"} title={"Vollbild"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment