From 8960bba0517a6e114b88a91248aa5bb1f7a3a450 Mon Sep 17 00:00:00 2001 From: cophilot Date: Sat, 9 Mar 2024 09:11:26 +0100 Subject: [PATCH] minor changes --- .husky/commit-msg | 21 ----------- .husky/pre-commit | 1 - README.md | 36 ++++++++++++++++++- package.json | 1 + .../CustomNuggetEditor/CustomNuggetEditor.tsx | 19 ---------- src/views/Home/Home.scss | 2 +- 6 files changed, 37 insertions(+), 43 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index ff9b87a..bc9bf3e 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -3,27 +3,6 @@ echo "Checking commit message..." message="$(cat $1)" -#requiredPattern="^(add|cut|fix|bump|make|start|stop|refactor|reformat|optimise|document|merge|configured) .*$" -#if ! [[ $message =~ $requiredPattern ]]; -#then -# echo "-" -# echo "-" -# echo "-" -# echo "🚨 Wrong commit message! 😕" -# echo "The commit message must have this format:" -# echo " " -# echo "Allowed verbs in imperative mood: add, cut, fix, bump, make, start, stop, refactor, reformat, optimise, document, merge" -# echo "Example: add login button" -# echo "-" -# echo "Your commit message was:" -# echo $message -# echo "-" -# echo "For more information, check script in .husky/commit-msg" -# echo "-" -# exit 1 -#fi - - # Check if the string has at least 9 characters if [ ${#message} -lt 9 ]; then echo "🚨 Wrong commit message! 😕" diff --git a/.husky/pre-commit b/.husky/pre-commit index 9dfddb2..7a6257b 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -15,7 +15,6 @@ npm run lint # check comments npm run comment:check - # run tests npm run test diff --git a/README.md b/README.md index fbce2ec..8bb21a1 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,9 @@ ## Installation -1. Clone the repository with: +### Installation for development + +1. Clone this repository with: ```bash git clone https://github.com/cophilot/wannadbFrontend.git @@ -47,6 +49,35 @@ npm install npm run prepare ``` +5. Check the `.env.development` file and make sure all the variables are set correctly. + +6. [Start the frontend development server](#start). + +### Installation for production + +1. Clone this repository with: + +```bash +git clone https://github.com/cophilot/wannadbFrontend.git +``` + +2. Make sure to have [nodejs](https://nodejs.org/en), [npm](https://www.npmjs.com/) installed. +3. Install the dependencies with: + +```bash +npm install +``` + +4. Check the `.env.production` file and make sure all the variables are set correctly. + +5. Build the frontend wih: + +```bash +npm run build +``` + +6. The built frontend will be in the `dist` folder. + --- ## Start @@ -69,7 +100,10 @@ _Check the console for instructions!_ - **[scripts](scripts)** - Scripts for the project - **[src](src)** - The source code + - **[assets](src/assets)** - The assets + - **[audio](src/audio)** - The audio files - **[components](src/components)** - The React components + - **[data](src/data)** - Some data functions - **[providers](src/providers)** - Custom React providers - **[styles](src/styles)** - The styles - **[types](src/types)** - Typescript types diff --git a/package.json b/package.json index 65441ab..5c8384e 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "test": "vitest run --coverage --mode development", "test:watch": "vitest", "prepare": "husky install", + "setup": "npm install && npm run prepare", "generate": "python scripts/generate.py", "g": "python scripts/generate.py", "comment:check": "python scripts/check_comment.py", diff --git a/src/components/CustomNuggetEditor/CustomNuggetEditor.tsx b/src/components/CustomNuggetEditor/CustomNuggetEditor.tsx index 90af71b..4349cef 100644 --- a/src/components/CustomNuggetEditor/CustomNuggetEditor.tsx +++ b/src/components/CustomNuggetEditor/CustomNuggetEditor.tsx @@ -94,25 +94,6 @@ function CustomNuggetEditor({ doc, docBase }: Props) { textarea.selectionEnd ) ); - - // get mouse position - /* const selection = window.getSelection(); - if (selection) { - console.log('Selection:', selection); - const range = selection.getRangeAt(0); - const rect = range.getBoundingClientRect(); - // set botton position of the confirm button to the top position of the selected text - const confirmButton = document.getElementById( - 'confirm-button' + id - ); - if (confirmButton) { - console.log('Setting confirm button position'); - confirmButton.setAttribute( - 'style', - `top: ${rect.top}px; left: ${rect.right}px; position: absolute;` - ); - } - } */ }; return ( diff --git a/src/views/Home/Home.scss b/src/views/Home/Home.scss index 4f28bb0..0fa595b 100644 --- a/src/views/Home/Home.scss +++ b/src/views/Home/Home.scss @@ -11,7 +11,7 @@ h2 { margin-top: 70px; .db { - color: white; + color: var(--text-color); } } }