Skip to content

Commit

Permalink
feat: imporve UI details for search box
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentdchan committed Oct 11, 2022
1 parent 5b33956 commit 9154e52
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/renderer/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
border-width: 1px;
color: var(--button-color);
background-color: var(--button-bg-color);
box-sizing: border-box;

&.primary {
color: white;
Expand All @@ -23,5 +24,9 @@
&[disabled] {
background-color: rgb(175, 175, 175);
border: none;

&:hover {
background-color: rgb(175, 175, 175);
}
}
}
26 changes: 21 additions & 5 deletions src/renderer/components/searchBox/searchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import Button from "@pkg/renderer/components/button";
import { type EditorController, type SearchContext } from "blocky-core";
import { type CursorState, CursorStateUpdateReason } from "blocky-data";
import { debounce } from "lodash-es";
import { FontAwesomeIcon } from "@pkg/renderer/components/fontAwesomeIcon";
import {
faClose,
faArrowLeft,
faArrowRight,
} from "@fortawesome/free-solid-svg-icons";
import "./searchBox.scss";

export interface SearchBoxProps {
Expand Down Expand Up @@ -152,13 +158,23 @@ class SearchBox extends Component<SearchBoxProps, SearchBoxState> {
ref={this.#inputRef}
/>
<div className="result-display">{this.#resultMessage()}</div>
<Button onClick={this.#emitPrev} disabled={this.#prevDisabled()}>
{"<"}
<Button
type="primary"
onClick={this.#emitPrev}
disabled={this.#prevDisabled()}
>
<FontAwesomeIcon icon={faArrowLeft} />
</Button>
<Button onClick={this.#emitNext} disabled={this.#nextDisabled()}>
{">"}
<Button
type="primary"
onClick={this.#emitNext}
disabled={this.#nextDisabled()}
>
<FontAwesomeIcon icon={faArrowRight} />
</Button>
<Button onClick={props.onClose}>
<FontAwesomeIcon icon={faClose} />
</Button>
<Button onClick={props.onClose}>{"X"}</Button>
</div>
);
}
Expand Down

0 comments on commit 9154e52

Please sign in to comment.