From 1027a22c3dddeae13b1d48ef9506f11c852a7c73 Mon Sep 17 00:00:00 2001 From: yedidya rashi Date: Fri, 24 Jun 2022 11:45:22 +0300 Subject: [PATCH 01/15] feat: add Yedidya Rashi profile (#220) --- people/YedidyaRashi.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 people/YedidyaRashi.json diff --git a/people/YedidyaRashi.json b/people/YedidyaRashi.json new file mode 100644 index 0000000..ee332ee --- /dev/null +++ b/people/YedidyaRashi.json @@ -0,0 +1,8 @@ +{ + "name": "ידידיה ראשי", + "github": "Yedidyar", + "facebook": "https://www.facebook.com/yedidyarashi", + "linkedin": "https://www.linkedin.com/in/yedidya-rashi-398296224/", + "stackoverflow": "https://stackoverflow.com/users/8276765/yedidya-rashi", + "description": "מתכנת fullstack בחיל האוויר.אוהב לתכנת בtypesript ולשחק במשחקי מחשב מתעניין בכלכלה ובקריפטו" +} From 554b82dd2c437c93906e79079e48097e63f96c82 Mon Sep 17 00:00:00 2001 From: Omri Bar-Zik Date: Sat, 2 Jul 2022 10:06:50 +0300 Subject: [PATCH 02/15] chore: remove idea folder (#236) --- .gitignore | 10 ++++++++++ .idea/.gitignore | 8 -------- .idea/checkstyle-idea.xml | 16 ---------------- .idea/codeStyles/codeStyleConfig.xml | 5 ----- .idea/misc.xml | 6 ------ .idea/modules.xml | 8 -------- .idea/pull-request-community.iml | 9 --------- .idea/vcs.xml | 6 ------ 8 files changed, 10 insertions(+), 58 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/checkstyle-idea.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/pull-request-community.iml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index 1437c53..0a7ad7a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,13 @@ yarn-error.log* # vercel .vercel + +## IDE's +.idea/ + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 73f69e0..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml deleted file mode 100644 index bfcfff7..0000000 --- a/.idea/checkstyle-idea.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index a55e7a1..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index ad03785..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 8020e3a..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/pull-request-community.iml b/.idea/pull-request-community.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/pull-request-community.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 5e9ea19b45a6da2d8d0ce3479485dd489cb6276a Mon Sep 17 00:00:00 2001 From: shir22 <33841818+shir22@users.noreply.github.com> Date: Sat, 2 Jul 2022 10:07:57 +0300 Subject: [PATCH 03/15] updating readme: custom image (#239) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8edef0a..2ac25a2 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,11 @@ You can add / update your personal profile by creating a Pull Request to this re and anything that you are passionate about. Are you an architect? Do you speak Chinese? Studied amusement park and roller coaster engineering? This is the place to brag! -2. By default, we'll use your GitHub photo. There's currently an [open issue](https://github.com/urish/pull-request-community/issues/78) to allow custom profile photos. +2. By default, we'll use your GitHub photo. If you don't have a GitHub profile photo, + or want to use a different one, add it under [public/images/people](public/images/people) in jpeg format. + Use your GitHub username for the image, e.g. `MichalPorag.jpg`. + + Then, add `"customImage": true` to your profile JSON that you created in the previous step. 3. Create a pull request with new files. From 365afa68fd85ac20086b36c5eed0cdad999c16f1 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Sat, 2 Jul 2022 10:09:56 +0300 Subject: [PATCH 04/15] test: add e2e infra with playwright and a sample test (#235) * test: add e2e infra with playwright and a sample test * test: add github action for e2e test * test: add config for framework spin-up --- .github/workflows/e2e-ci.yml | 15 ++++++++++++ e2e/home.spec.ts | 8 +++++++ package-lock.json | 45 ++++++++++++++++++++++++++++++++++++ package.json | 6 +++-- playwright.config.ts | 10 ++++++++ 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/e2e-ci.yml create mode 100644 e2e/home.spec.ts create mode 100644 playwright.config.ts diff --git a/.github/workflows/e2e-ci.yml b/.github/workflows/e2e-ci.yml new file mode 100644 index 0000000..d5bb769 --- /dev/null +++ b/.github/workflows/e2e-ci.yml @@ -0,0 +1,15 @@ +name: "Tests: E2E" +on: [pull_request] +jobs: + tests_e2e: + name: Run end-to-end tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + - name: install dependencies + run: npm ci + - name: install playwright browsers + run: npx playwright install --with-deps + - name: npm run test:e2e + run: npm run test:e2e diff --git a/e2e/home.spec.ts b/e2e/home.spec.ts new file mode 100644 index 0000000..7362739 --- /dev/null +++ b/e2e/home.spec.ts @@ -0,0 +1,8 @@ +import { test, expect } from '@playwright/test' + +test('page should have title of "קהילת Pull Request"', async ({page}) => { + await page.goto('http://localhost:3000/') + const title = await page.title() + expect(title).toBe('קהילת Pull Request') +}); + diff --git a/package-lock.json b/package-lock.json index b9f3ad7..ccda812 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "uuid": "^8.3.2" }, "devDependencies": { + "@playwright/test": "^1.22.2", "@types/node": "^14.11.2", "@types/react": "^16.9.50", "eslint": "^7.32.0", @@ -1006,6 +1007,22 @@ "node": ">= 8" } }, + "node_modules/@playwright/test": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz", + "integrity": "sha512-cCl96BEBGPtptFz7C2FOSN3PrTnJ3rPpENe+gYCMx4GNNDlN4tmo2D89y13feGKTMMAIVrXfSQ/UmaQKLy1XLA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "playwright-core": "1.22.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@rushstack/eslint-patch": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz", @@ -5280,6 +5297,18 @@ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==" }, + "node_modules/playwright-core": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.22.2.tgz", + "integrity": "sha512-w/hc/Ld0RM4pmsNeE6aL/fPNWw8BWit2tg+TfqJ3+p59c6s3B6C8mXvXrIPmfQEobkcFDc+4KirNzOQ+uBSP1Q==", + "dev": true, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", @@ -7532,6 +7561,16 @@ "fastq": "^1.6.0" } }, + "@playwright/test": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.22.2.tgz", + "integrity": "sha512-cCl96BEBGPtptFz7C2FOSN3PrTnJ3rPpENe+gYCMx4GNNDlN4tmo2D89y13feGKTMMAIVrXfSQ/UmaQKLy1XLA==", + "dev": true, + "requires": { + "@types/node": "*", + "playwright-core": "1.22.2" + } + }, "@rushstack/eslint-patch": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz", @@ -10766,6 +10805,12 @@ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==" }, + "playwright-core": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.22.2.tgz", + "integrity": "sha512-w/hc/Ld0RM4pmsNeE6aL/fPNWw8BWit2tg+TfqJ3+p59c6s3B6C8mXvXrIPmfQEobkcFDc+4KirNzOQ+uBSP1Q==", + "dev": true + }, "please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", diff --git a/package.json b/package.json index 667f33c..c77f7a9 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "dev": "npm run open-browser && next dev", "open-browser": "node ./scripts/open-browser.js", "build": "next build", - "start": "next start", + "start": "npm run build && next start", "prepare": "husky install", - "lint": "next lint" + "lint": "next lint", + "test:e2e": "playwright test" }, "dependencies": { "@mdi/js": "^5.6.55", @@ -22,6 +23,7 @@ "uuid": "^8.3.2" }, "devDependencies": { + "@playwright/test": "^1.22.2", "@types/node": "^14.11.2", "@types/react": "^16.9.50", "eslint": "^7.32.0", diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..1a927d3 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,10 @@ +import { PlaywrightTestConfig } from "@playwright/test"; + +const config: PlaywrightTestConfig = { + webServer: { + command: "npm run start", + url: "http://localhost:3000", + } +}; + +export default config; \ No newline at end of file From b4525768587cee210660aa540aaca22ebcf7b706 Mon Sep 17 00:00:00 2001 From: yedidya rashi Date: Sat, 2 Jul 2022 10:11:20 +0300 Subject: [PATCH 05/15] Yedidyar/issue167 (#240) * feat: add Yedidya Rashi profile (#220) * fix: randomShuffle isn't working correctly (#167) --- pages/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/index.tsx b/pages/index.tsx index 94e8949..b53a2b8 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -30,5 +30,6 @@ export const getStaticProps: GetStaticProps = async () => { props: { people: randomShuffle(getPeople()), }, + revalidate: true, }; }; From d7e85d9817cabfc8270519fab08dbaae29b745a5 Mon Sep 17 00:00:00 2001 From: yedidya rashi Date: Sat, 2 Jul 2022 10:12:54 +0300 Subject: [PATCH 06/15] fix(Description): wrap descriptionHeight with useEffect (#243) see more about the issue: https://stackoverflow.com/questions/62336340/cannot-update-a-component-while-rendering-a-different-component-warning --- components/description/Description.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/description/Description.tsx b/components/description/Description.tsx index f6d063e..58b1515 100644 --- a/components/description/Description.tsx +++ b/components/description/Description.tsx @@ -6,7 +6,9 @@ const Description = ({ descriptionOutput, descriptionHeight }) => { const myRef = useRef(null); const [height, setHeight] = useState(0); - descriptionHeight(height); + useEffect(() => { + descriptionHeight(height); + }, [descriptionHeight, height]); useEffect(() => { const handleResize = () => { From 70aaa86e9cc361aa71b097555ea0fc6a7d7307f4 Mon Sep 17 00:00:00 2001 From: yedidya rashi Date: Mon, 4 Jul 2022 08:25:58 +0300 Subject: [PATCH 07/15] There is no background for the role of Former admin label Fixes #241 --- components/label/label.module.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/label/label.module.scss b/components/label/label.module.scss index 54bcc46..45c737f 100644 --- a/components/label/label.module.scss +++ b/components/label/label.module.scss @@ -11,6 +11,9 @@ &[role="Admin"] { background: cornflowerblue; } + &[role="Former admin"] { + background: cadetblue; + } @media screen and (max-width: 600px) { font-size: 10px; From 6b90aa788f214edba7f64d0396417d6048805287 Mon Sep 17 00:00:00 2001 From: Noamili <105313965+Noamili@users.noreply.github.com> Date: Tue, 28 Jun 2022 18:59:40 +0300 Subject: [PATCH 08/15] Test (#238) * inital commit * revert change Co-authored-by: noa From 8098f995af81305f42fe8a3bfe9881a99145c193 Mon Sep 17 00:00:00 2001 From: noa Date: Sat, 18 Jun 2022 22:14:12 +0300 Subject: [PATCH 09/15] create serach bar component --- components/searchBar/SearchBar.module.scss | 20 ++++++++++ components/searchBar/SearchBar.tsx | 46 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 components/searchBar/SearchBar.module.scss create mode 100644 components/searchBar/SearchBar.tsx diff --git a/components/searchBar/SearchBar.module.scss b/components/searchBar/SearchBar.module.scss new file mode 100644 index 0000000..fc5433f --- /dev/null +++ b/components/searchBar/SearchBar.module.scss @@ -0,0 +1,20 @@ +.textBoxContainer { + display: flex; + border: solid 1px #bfc0c3; + max-width: 313px; + height: 40px; + border-radius: 8px; + background-color: white; + margin: 100px; + svg { + margin: 10px 16px; + } +} + +.textBox { + border: none; + width: 100%; + border-radius: 8px; + padding-right: 10px; + direction: ltr; +} diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx new file mode 100644 index 0000000..88e828d --- /dev/null +++ b/components/searchBar/SearchBar.tsx @@ -0,0 +1,46 @@ +import React, { useCallback, ReactElement } from 'react'; +import styles from './SearchBar.module.scss'; + +interface Props { + handelSearch: (searchTerm: string) => void; +} + +const debounce = (callback, delay) => { + let timer; + return (...args) => { + clearTimeout(timer); + timer = setTimeout(() => callback(...args), delay); + }; +}; + +const SearchBar = (props: Props): ReactElement => { + const { handelSearch } = props; + + const debounceHandler = useCallback(debounce(handelSearch, 1000), []); + + const handleOnChange = async (event) => { + const { value } = event.currentTarget; + debounceHandler(value); + }; + + return ( +
+ + + + +
+ ); +}; + +export default SearchBar; From cfe3c873a5d1a08e8a4a1792976b8e5ccd4141e8 Mon Sep 17 00:00:00 2001 From: noa Date: Sun, 3 Jul 2022 20:51:14 +0300 Subject: [PATCH 10/15] add the option to send a placeholder prop --- .../MainPageDescription.language.json | 1 + components/searchBar/SearchBar.tsx | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/main-page-description/MainPageDescription.language.json b/components/main-page-description/MainPageDescription.language.json index 4574729..28843db 100644 --- a/components/main-page-description/MainPageDescription.language.json +++ b/components/main-page-description/MainPageDescription.language.json @@ -1,5 +1,6 @@ { "title": "Pull Request ", + "searchPlaceholder": "Search", "description": "עוזרת לכם להיכנס לפרוייקטי קוד פתוח ולתרום להם ע\"י יצירת סביבה תומכת ובטוחה וחיבור עם מנטורים בעלי ניסיון שאכפת להם שתצליחו", "contribute": "מוזמנים לתרום לפרויקט של הקהילה או לפרויקטים שרצים תחתיה בסדנאות שרצות אחת לחודש לתרומה לקוד פתוח.\nבנוסף מוזמנים להצטרף להרצאות העשרה, לשתף שאלות ובקשות לעזרה ולשתף מהידע שלכם בקבוצה שלנו בפייסבוק.\nאם אתם רוצים להצטרף כמנטורים של פרויקט,\nמוזמנים למלא את הטופס הבא:" } diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx index 88e828d..4709028 100644 --- a/components/searchBar/SearchBar.tsx +++ b/components/searchBar/SearchBar.tsx @@ -1,8 +1,11 @@ import React, { useCallback, ReactElement } from 'react'; +import { useTranslator } from '../language/useTranslator'; +import languageFile from '../main-page-description/MainPageDescription.language.json'; import styles from './SearchBar.module.scss'; interface Props { handelSearch: (searchTerm: string) => void; + placeholder?: string; } const debounce = (callback, delay) => { @@ -14,7 +17,7 @@ const debounce = (callback, delay) => { }; const SearchBar = (props: Props): ReactElement => { - const { handelSearch } = props; + const { handelSearch, placeholder } = props; const debounceHandler = useCallback(debounce(handelSearch, 1000), []); @@ -25,9 +28,13 @@ const SearchBar = (props: Props): ReactElement => { return (
- + Date: Sun, 3 Jul 2022 20:51:39 +0300 Subject: [PATCH 11/15] fix style --- components/searchBar/SearchBar.module.scss | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/searchBar/SearchBar.module.scss b/components/searchBar/SearchBar.module.scss index fc5433f..d48470b 100644 --- a/components/searchBar/SearchBar.module.scss +++ b/components/searchBar/SearchBar.module.scss @@ -1,20 +1,22 @@ .textBoxContainer { display: flex; + align-items: center; + padding: 0 16px; + gap: 8px; border: solid 1px #bfc0c3; max-width: 313px; height: 40px; border-radius: 8px; background-color: white; margin: 100px; - svg { - margin: 10px 16px; - } } .textBox { border: none; width: 100%; - border-radius: 8px; - padding-right: 10px; direction: ltr; + color: #bfc0c2; + font-size: 2rem; + font-weight: 400; + line-height: 26.16px; } From 113e92582d92ca583a72cfc7dc550a0633e5121e Mon Sep 17 00:00:00 2001 From: noa Date: Sun, 3 Jul 2022 21:12:57 +0300 Subject: [PATCH 12/15] use a const for translation --- components/searchBar/SearchBar.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx index 4709028..c675790 100644 --- a/components/searchBar/SearchBar.tsx +++ b/components/searchBar/SearchBar.tsx @@ -20,6 +20,9 @@ const SearchBar = (props: Props): ReactElement => { const { handelSearch, placeholder } = props; const debounceHandler = useCallback(debounce(handelSearch, 1000), []); + const placeholderText = placeholder + ? placeholder + : useTranslator('searchPlaceholder', languageFile); const handleOnChange = async (event) => { const { value } = event.currentTarget; @@ -31,7 +34,7 @@ const SearchBar = (props: Props): ReactElement => { Date: Sun, 3 Jul 2022 21:18:20 +0300 Subject: [PATCH 13/15] revert useTranslator --- .../MainPageDescription.language.json | 1 - components/searchBar/SearchBar.tsx | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/components/main-page-description/MainPageDescription.language.json b/components/main-page-description/MainPageDescription.language.json index 28843db..4574729 100644 --- a/components/main-page-description/MainPageDescription.language.json +++ b/components/main-page-description/MainPageDescription.language.json @@ -1,6 +1,5 @@ { "title": "Pull Request ", - "searchPlaceholder": "Search", "description": "עוזרת לכם להיכנס לפרוייקטי קוד פתוח ולתרום להם ע\"י יצירת סביבה תומכת ובטוחה וחיבור עם מנטורים בעלי ניסיון שאכפת להם שתצליחו", "contribute": "מוזמנים לתרום לפרויקט של הקהילה או לפרויקטים שרצים תחתיה בסדנאות שרצות אחת לחודש לתרומה לקוד פתוח.\nבנוסף מוזמנים להצטרף להרצאות העשרה, לשתף שאלות ובקשות לעזרה ולשתף מהידע שלכם בקבוצה שלנו בפייסבוק.\nאם אתם רוצים להצטרף כמנטורים של פרויקט,\nמוזמנים למלא את הטופס הבא:" } diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx index c675790..fee603f 100644 --- a/components/searchBar/SearchBar.tsx +++ b/components/searchBar/SearchBar.tsx @@ -1,6 +1,4 @@ import React, { useCallback, ReactElement } from 'react'; -import { useTranslator } from '../language/useTranslator'; -import languageFile from '../main-page-description/MainPageDescription.language.json'; import styles from './SearchBar.module.scss'; interface Props { @@ -20,9 +18,6 @@ const SearchBar = (props: Props): ReactElement => { const { handelSearch, placeholder } = props; const debounceHandler = useCallback(debounce(handelSearch, 1000), []); - const placeholderText = placeholder - ? placeholder - : useTranslator('searchPlaceholder', languageFile); const handleOnChange = async (event) => { const { value } = event.currentTarget; @@ -34,7 +29,7 @@ const SearchBar = (props: Props): ReactElement => { Date: Sun, 10 Jul 2022 11:50:56 +0300 Subject: [PATCH 14/15] revert changes in useTranslator --- components/searchBar/SearchBar.language.json | 3 +++ components/searchBar/SearchBar.tsx | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 components/searchBar/SearchBar.language.json diff --git a/components/searchBar/SearchBar.language.json b/components/searchBar/SearchBar.language.json new file mode 100644 index 0000000..c5d3be0 --- /dev/null +++ b/components/searchBar/SearchBar.language.json @@ -0,0 +1,3 @@ +{ + "searchBarPlaceholder": "Search" +} diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx index fee603f..f42de20 100644 --- a/components/searchBar/SearchBar.tsx +++ b/components/searchBar/SearchBar.tsx @@ -1,4 +1,6 @@ import React, { useCallback, ReactElement } from 'react'; +import { useTranslator } from '../language/useTranslator'; +import languageFile from './SearchBar.language.json'; import styles from './SearchBar.module.scss'; interface Props { @@ -16,6 +18,7 @@ const debounce = (callback, delay) => { const SearchBar = (props: Props): ReactElement => { const { handelSearch, placeholder } = props; + const searchPlaceholder = useTranslator('searchBarPlaceholder', languageFile); const debounceHandler = useCallback(debounce(handelSearch, 1000), []); @@ -29,7 +32,7 @@ const SearchBar = (props: Props): ReactElement => { Date: Sun, 10 Jul 2022 11:53:23 +0300 Subject: [PATCH 15/15] fix font size --- components/searchBar/SearchBar.module.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/searchBar/SearchBar.module.scss b/components/searchBar/SearchBar.module.scss index d48470b..86ab810 100644 --- a/components/searchBar/SearchBar.module.scss +++ b/components/searchBar/SearchBar.module.scss @@ -16,7 +16,7 @@ width: 100%; direction: ltr; color: #bfc0c2; - font-size: 2rem; + font-size: 1.25rem; font-weight: 400; line-height: 26.16px; }