diff --git a/.github/img/home.png b/.github/img/home.png index f9ac1e5..96a4c6a 100644 Binary files a/.github/img/home.png and b/.github/img/home.png differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ec14f..8524317 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### v1.4 (TBA) +### v1.4 (2021-10-14) - Added search functionality ([#18](https://github.com/pawelmalak/snippet-box/issues/18)) - Fixed date parsing bug ([#22](https://github.com/pawelmalak/snippet-box/issues/22)) - Minor UI fixes diff --git a/README.md b/README.md index a9dd26d..ee2cc09 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,29 @@ docker buildx build \ docker run -p 5000:5000 -v /path/to/data:/app/data snippet-box ``` +#### Docker Compose + +```yaml +version: '3' +services: + snippet-box: + image: pawelmalak/snippet-box:latest + container_name: snippet-box + volumes: + - /path/to/host/data:/app/data + ports: + - 5000:5000 + restart: unless-stopped +``` + ### Without Docker Follow instructions from wiki - [Installation without Docker](https://github.com/pawelmalak/snippet-box/wiki/Installation-without-Docker) ## Functionality +- Search + - Search your snippets with built-in tags and language filters - Pinned snippets - Pin your favorite / important snippets to home screen for easy and quick access @@ -92,3 +109,9 @@ Follow instructions from wiki - [Installation without Docker](https://github.com - Create and edit your snippets from simple and easy to use editor  + +## Usage + +### Search functionality + +Visit wiki for search functionality and available filters reference: [Search functionality](https://github.com/pawelmalak/snippet-box/wiki/Search-functionality) diff --git a/client/src/components/SearchBar.tsx b/client/src/components/SearchBar.tsx index 0d189fd..450ecb9 100644 --- a/client/src/components/SearchBar.tsx +++ b/client/src/components/SearchBar.tsx @@ -15,6 +15,9 @@ export const SearchBar = (): JSX.Element => { if (e.key === 'Enter') { searchSnippets(query); + } else if (e.key === 'Escape') { + inputRef.current.value = ''; + searchSnippets(searchParser(inputRef.current.value)); } }; @@ -27,8 +30,8 @@ export const SearchBar = (): JSX.Element => { ref={inputRef} onKeyUp={e => inputHandler(e)} /> -