mirror of
https://github.com/pawelmalak/snippet-box.git
synced 2025-12-21 13:04:59 +01:00
Added shortcut to clear search input. Updated README, CHANGELOG and Home screenshot. Added docker-compose
This commit is contained in:
BIN
.github/img/home.png
vendored
BIN
.github/img/home.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 55 KiB |
@@ -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
|
||||
|
||||
23
README.md
23
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)
|
||||
|
||||
@@ -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)}
|
||||
/>
|
||||
<div className='form-text text-gray'>
|
||||
Submit search query by pressing `Enter`. Read more about available
|
||||
<div className='form-text text-gray ms-1'>
|
||||
Search by pressing `Enter`. Clear with `Esc`. Read more about available
|
||||
filters{' '}
|
||||
<a
|
||||
href='https://github.com/pawelmalak/snippet-box/wiki/Search-filters'
|
||||
|
||||
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
version: '3'
|
||||
services:
|
||||
snippet-box:
|
||||
image: pawelmalak/snippet-box
|
||||
container_name: snippet-box
|
||||
volumes:
|
||||
- /path/to/host/data:/app/data
|
||||
ports:
|
||||
- 5000:5000
|
||||
restart: unless-stopped
|
||||
@@ -121,8 +121,6 @@ export const getSnippet = asyncWrapper(
|
||||
*/
|
||||
export const updateSnippet = asyncWrapper(
|
||||
async (req: Request, res: Response, next: NextFunction): Promise<void> => {
|
||||
console.log(req.body);
|
||||
|
||||
let snippet = await SnippetModel.findOne({
|
||||
where: { id: req.params.id }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user