-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ignore venv directory * Create styled Input component * create search bar * add search bar to robots * add debugger entrance point * use correct ip for debugging * add robots backend search functionality * allow SearchInput to take value and onChange * add robots search to frontend * add search to parts page * add more specificity to search input style * add focus colors for search * trigger search with Enter key * fix search on robots and parts page * remove unused env var * add description for launch.json addition * remove json comment * lint fixes
- Loading branch information
1 parent
29754af
commit 1276119
Showing
14 changed files
with
225 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "FastAPI Debugging", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/store/app/main.py", | ||
"console": "integratedTerminal", | ||
"justMyCode": true, | ||
"args": [], | ||
"jinja": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.input { | ||
display: flex; | ||
height: 3rem; | ||
width: 100%; | ||
border-radius: 0.375rem; | ||
border: 1px solid #e2e8f0; | ||
background-color: #fff; | ||
padding: 0.75rem 0.5rem; | ||
font-size: 0.875rem; | ||
transition: box-shadow 0.2s; | ||
} | ||
|
||
.input[type="file"] { | ||
border: none; | ||
background-color: transparent; | ||
} | ||
|
||
.input:focus { | ||
outline: none; | ||
box-shadow: 0 0 0 2px #3b82f6; | ||
} | ||
|
||
.input:disabled { | ||
cursor: not-allowed; | ||
opacity: 0.5; | ||
} | ||
|
||
.input::placeholder { | ||
color: #9ca3af; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from "react"; | ||
import styles from "./Input.module.css"; | ||
|
||
export interface InputProps | ||
extends React.InputHTMLAttributes<HTMLInputElement> {} | ||
|
||
const Input = React.forwardRef<HTMLInputElement, InputProps>( | ||
({ className, type, ...props }, ref) => { | ||
return ( | ||
<input | ||
type={type} | ||
className={`${styles.input} ${className}`} | ||
ref={ref} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
|
||
Input.displayName = "Input"; | ||
|
||
export { Input }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.SearchInput { | ||
display: flex; | ||
align-items: center; | ||
border: 1px solid gray; | ||
border-radius: 5px; | ||
width: 50%; | ||
} | ||
|
||
.SearchInput:focus-within { | ||
box-shadow: 0 0 0 2px blue; | ||
} | ||
|
||
.Icon { | ||
margin-left: 0.3em; | ||
filter: opacity(50%); | ||
} | ||
|
||
.SearchInput:focus-within .Icon { | ||
filter: opacity(100%); | ||
} | ||
|
||
.SearchInput .Input { | ||
border: none; | ||
overflow: hidden; | ||
} | ||
|
||
.SearchInput .Input:focus { | ||
box-shadow: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as React from "react"; | ||
import { Search } from "react-bootstrap-icons"; | ||
import { Input } from "../Input/Input"; | ||
import styles from "./SearchInput.module.css"; | ||
|
||
export interface SearchInputProps | ||
extends React.InputHTMLAttributes<HTMLInputElement> { | ||
userInput?: string; | ||
onSearch?: (query: string) => void; | ||
} | ||
|
||
const SearchInput = ({ | ||
className, | ||
userInput, | ||
onChange, | ||
onSearch, | ||
}: SearchInputProps) => { | ||
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => { | ||
if (e.key === "Enter" && onSearch && userInput !== undefined) { | ||
onSearch(userInput); // Trigger a new callback onSearch | ||
} | ||
}; | ||
return ( | ||
<div className={`${styles.SearchInput} ${className}`}> | ||
<Search className={styles.Icon} /> | ||
<Input | ||
type="search" | ||
placeholder="Search..." | ||
className={styles.Input} | ||
value={userInput} | ||
onChange={onChange} | ||
onKeyDown={handleKeyDown} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
SearchInput.displayName = "SearchInput"; | ||
|
||
export { SearchInput }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters