├── .github └── workflows │ └── main.yml ├── .gitignore ├── ISSUE_TEMPLATE ├── Bug_Report.md └── Feature_Request.md ├── LICENSE ├── README.md ├── code_of_conduct.md ├── com-dict-client ├── .env.sample ├── .firebase │ └── hosting.YnVpbGQ.cache ├── .firebaserc ├── .gitignore ├── .vs │ ├── ProjectSettings.json │ ├── VSWorkspaceState.json │ ├── com-dict-client │ │ └── v15 │ │ │ └── .suo │ └── slnx.sqlite ├── firebase.json ├── functions │ ├── .gitignore │ ├── index.js │ ├── package.json │ └── ui-debug.log ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.css │ ├── App.js │ ├── components │ ├── AddWord │ │ ├── RelatedWords.js │ │ ├── WordClass.js │ │ └── index.js │ ├── AlphaIndex │ │ └── index.js │ ├── Categories │ │ ├── catHead.js │ │ └── index.js │ ├── Comments │ │ ├── comment_list.js │ │ ├── index.js │ │ └── reply_editor.js │ ├── DictionaryView │ │ ├── word_dict.js │ │ └── word_summary.js │ ├── Flag │ │ ├── index.js │ │ └── report_cats.js │ ├── Footer │ │ ├── FooterPage.js │ │ └── index.js │ ├── Header │ │ └── index.js │ ├── Home │ │ ├── AlphaIndex.js │ │ ├── AlphaIndexHome.js │ │ ├── DayNew.js │ │ ├── SearchText.js │ │ ├── SelectLang.js │ │ └── WordSearch.js │ ├── Login │ │ ├── index.js │ │ ├── loginForm.js │ │ └── socialLogin.js │ ├── Navbar │ │ └── UserAccount.js │ ├── Search │ │ ├── SearchText.js │ │ ├── SelectLang.js │ │ ├── WordSearch.js │ │ └── index.js │ ├── Signup │ │ ├── SignUp.js │ │ └── index.js │ ├── WordAlpabatical │ │ ├── index.js │ │ ├── letterHead.js │ │ └── word.js │ ├── WordClass.js │ ├── WordHome │ │ ├── Word_new.js │ │ ├── index.js │ │ ├── socialShare.js │ │ ├── word.js │ │ ├── wordCarousel.js │ │ ├── wordDay.js │ │ └── wordSimple.js │ ├── WordSearch │ │ ├── SocialShare.js │ │ ├── Word.js │ │ ├── Word_new.js │ │ ├── book.js │ │ ├── index.js │ │ └── wordSimple.js │ └── index.js │ ├── config │ └── index.js │ ├── constants │ ├── index.js │ └── languages.js │ ├── containers │ ├── App │ │ ├── App.css │ │ ├── App.js │ │ └── App.test.js │ ├── addWord │ │ ├── addWord.css │ │ ├── addWord.js │ │ └── addWord.test.js │ ├── browse │ │ ├── browse.css │ │ ├── browse.js │ │ └── browse.test.js │ ├── categories │ │ ├── categories.css │ │ ├── categories.js │ │ └── categories.test.js │ ├── comment │ │ ├── comment.css │ │ ├── comment.js │ │ └── comment.test.js │ ├── dictionary │ │ ├── letterDict.css │ │ ├── letterDict.js │ │ └── letterDict.test.js │ ├── home │ │ ├── arrow.css │ │ ├── footer.css │ │ ├── home.css │ │ ├── home.js │ │ └── home.test.js │ ├── index.js │ ├── reportWord │ │ ├── reportWord.css │ │ ├── reportWord.js │ │ └── reportWord.test.js │ ├── search │ │ ├── footer.css │ │ ├── home.css │ │ ├── search.js │ │ └── search.test.js │ └── signup │ │ ├── signup.css │ │ ├── signup.js │ │ └── signup.test.js │ ├── functions │ └── index.js │ ├── helpers │ └── readme.txt │ ├── images │ ├── frontdesk.jpg │ ├── icons │ │ └── icons8-male-user.png │ ├── lisa.gif │ ├── login.jpg │ ├── logo │ │ ├── cover.png │ │ ├── default.png │ │ ├── logo.png │ │ ├── logo192.png │ │ ├── logo_2.png │ │ ├── logo_new.png │ │ ├── profile.png │ │ └── vector │ │ │ ├── default-monochrome-black.svg │ │ │ ├── default-monochrome-white.svg │ │ │ ├── default-monochrome.svg │ │ │ ├── default.svg │ │ │ ├── isolated-layout.svg │ │ │ ├── isolated-monochrome-black.svg │ │ │ └── isolated-monochrome-white.svg │ ├── pablo-add-word.png │ ├── pablo-addWord.png │ ├── pablo-chat.png │ ├── pablo-education.png │ ├── pablo-food.png │ ├── pablo-game.png │ ├── pablo-internet.png │ ├── pablo-music.png │ ├── pablo-nature.png │ ├── pablo-politics.png │ ├── pablo-religion.png │ ├── pablo-school.png │ ├── pablo-sign-in.png │ ├── pablo-sign-up.png │ ├── pablo-sports.png │ ├── pablo-word-remove.png │ ├── pablo-work.png │ └── register.gif │ ├── index.css │ ├── index.js │ ├── routes.js │ ├── serviceWorker.js │ ├── setupTests.js │ ├── store │ ├── actions │ │ ├── actionTypes.js │ │ ├── authActions.js │ │ ├── commentActions.js │ │ ├── headTerm.js │ │ ├── index.js │ │ └── wordActions.js │ ├── index.js │ └── reducers │ │ ├── index.js │ │ └── wordReducer.js │ └── utils.js │ ├── dataLoader.js │ └── toTitleCase.js ├── local-firebase-emulators-import-export.md └── rule_sets.md /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy to Firebase Hosting 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | name: Build 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout Repo 14 | uses: actions/checkout@master 15 | - name: Install Dependencies 16 | working-directory: ./com-dict-client 17 | run: npm install 18 | - name: Build 19 | working-directory: ./com-dict-client 20 | run: npm run build 21 | env: 22 | REACT_APP_FIREBASE_API_KEY: ${{ secrets.REACT_APP_FIREBASE_API_KEY }} 23 | REACT_APP_FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_PROJECT_ID }} 24 | REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.REACT_APP_FIREBASE_MESSAGING_SENDER_ID }} 25 | REACT_APP_FIREBASE_APP_ID: ${{ secrets.REACT_APP_FIREBASE_APP_ID }} 26 | - name: Archive Production Artifact 27 | uses: actions/upload-artifact@master 28 | with: 29 | name: build 30 | path: ./com-dict-client/build 31 | deploy: 32 | name: Deploy 33 | needs: build 34 | runs-on: ubuntu-latest 35 | steps: 36 | - name: Checkout Repo 37 | uses: actions/checkout@master 38 | - name: Download Artifact 39 | uses: actions/download-artifact@master 40 | with: 41 | name: build 42 | path: ./com-dict-client/build 43 | - name: Deploy to Firebase 44 | uses: Niweera/firebase-action@master 45 | with: 46 | args: deploy --only hosting 47 | env: 48 | FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} 49 | PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_PROJECT_ID }} 50 | PROJECT_PATH: ./com-dict-client 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/settings.json 2 | .vscode/ 3 | .idea/ 4 | .env 5 | ./package-lock.json 6 | com-dict-client/.env 7 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE/Bug_Report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Device Information (please complete the following information):** 27 | - OS: [e.g. iOS8.1] 28 | - Browser [e.g. stock browser, safari] 29 | - Version [e.g. 22] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE/Feature_Request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /code_of_conduct.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email or any other method with the owners of this repository before making a change. 5 | Please note we have a code of conduct, please follow it in all your interactions with the project. 6 | 7 | ## Pull Request Process 8 | 9 | * Ensure any install or build dependencies are removed before the end of the layer when doing a build. 10 | 11 | * ___Pull request message format: [Fixes done] #[issue number] [Description of the issue]___ 12 | * Wait for the maintainers to review your pull request and do the changes if requested. 13 | 14 | ## Best Contribution Practices 15 | 16 | **Commits** 17 | * Write clear meaningful git commit messages. 18 | * Make sure your PR's description contains GitHub's special keyword references that automatically close the related issue when the PR is merged. (More info at https://github.com/blog/1506-closing-issues-via-pull-requests ) 19 | * When you're submitting a PR for a UI-related issue, it would be really awesome if you add a screenshot of your change or a link to a deployment where it can be tested out along with your PR. This makes it very easy for the reviewers and you'll also get reviews quicker. 20 | 21 | **Feature Requests and Bug Reports** 22 | * When you file a feature request or when you are submitting a bug report, make sure you add steps to reproduce it. Especially if that bug is some weird/rare one. 23 | 24 | * ___Please follow the templates when posting a issue.___ 25 | 26 | * Feature_Request / Bug_Report - [includes in repository] 27 | 28 | * Would you like to work on the issue? 29 | * [X] Yes 30 | * [ ] No 31 | * [ ] Other: 32 | 33 | 34 | **Join the development** 35 | * Before you join development, please set up the project on your local machine, run it and go through the application completely. 36 | * If you would like to work on an issue, drop in a comment at the issue. If it is already assigned to someone, but there is no sign of any work being done, please free to drop in a comment so that the issue can be assigned to you if the previous assignee has dropped it entirely. 37 | * Feel free to Ask Anything! 😎 [Gitter]:https://gitter.im/scorelab/ 38 | [homepage]:https://github.com/scorelab/ 39 | 40 | -------------------------------------------------------------------------------- /com-dict-client/.env.sample: -------------------------------------------------------------------------------- 1 | REACT_APP_FIREBASE_API_KEY = 2 | REACT_APP_FIREBASE_PROJECT_ID = 3 | REACT_APP_FIREBASE_MESSAGING_SENDER_ID = 4 | REACT_APP_FIREBASE_APP_ID = -------------------------------------------------------------------------------- /com-dict-client/.firebase/hosting.YnVpbGQ.cache: -------------------------------------------------------------------------------- 1 | favicon.ico,1597872539344,4df02ad892da3e682cb52eca71997d20e3ded204734ababe1904f2d407b03af0 2 | logo192.png,1597872438584,88a68eb4c2e867b6d22340bdc644158227cad6a0fae924377a8d81030d490b78 3 | logo512.png,1594588130794,ee7e2f3fdb8209c4b6fd7bef6ba50d1b9dba30a25bb5c3126df057e1cb6f5331 4 | manifest.json,1594588130794,5c997de1364b8be939319fa9209abd77f2caf7f8844999a9e2e9173f844e7840 5 | robots.txt,1594588130794,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5 6 | asset-manifest.json,1598106162351,3f08239e74dfb8ca8f96733a9a96940c130262e49a5a73f6a9bf1968422fb7cb 7 | index.html,1598106162341,6702a8bb22b538c5a391d579fb80ac399a958fce568aae8a1e3ab9794e16d864 8 | precache-manifest.c3f4f8c063c25e55d9fe60e61aac5439.js,1598106162343,811cdd35cd737795bba594417be46fef5bc5404cb50fe027d08ae17ee88939cd 9 | service-worker.js,1598106162351,de42bf232026d480ba23a7147f2114bb91411a07780c886626dd23b411acc95a 10 | static/css/main.ca5ad09e.chunk.css,1598106162324,1d42ba6a9655455b61a65ce4278840993d894ee2b50af3a04f7545cca73315cb 11 | static/css/main.ca5ad09e.chunk.css.map,1598106162406,4b6c9e4cb49bd9cc2cd27e79cc3e97150f0ebd7983ae0f40c5bbefaa399e10cd 12 | static/js/2.2381d555.chunk.js.LICENSE.txt,1598106162380,7cb238d6c4c9bec0cb2736c5bd1555e2999032f768893e5981a3fe526dd2f5c9 13 | static/js/runtime-main.fd48c491.js,1598106162323,df0cb592d005373e96a66c1d5403ce903f07a5cfa6888bc38909525a2c2c29a8 14 | static/js/runtime-main.fd48c491.js.map,1598106162406,f29837fa12f7cc5504059168ba9c9c41ef00b4f8910c579baddcb62bc9628b01 15 | static/js/main.37b9b2a2.chunk.js,1598106162330,14b3c9743be87d9f57e5265e5fee9c98809a09d5cd5b80fde906418c282845e1 16 | static/media/cover.2fb8be09.png,1598106162305,6ed02a62d3708cc23fb13c932a01c4e513ecb9ace9823263317d03393923f35f 17 | static/js/main.37b9b2a2.chunk.js.map,1598106162411,1b8363f687413143be7d902c2043bcd3077a9c8ea8fd1e6a9ba011b5fb6a7656 18 | static/media/pablo-religion.e73fb8d0.png,1598106162330,10ace5c972087f81aa2134f98617024daed78c3411493a6626efee9445a0c918 19 | static/media/pablo-music.1f314b22.png,1598106162330,21838a522f29fde001812ad84b38f2ef541be07e3937f350571bcc02e94a452d 20 | static/media/pablo-work.b3a9c39f.png,1598106162329,862eb39366e3cb9ac156d941825b08025732a2813641d05a402509a8c571d546 21 | static/media/pablo-word-remove.45e5eda4.png,1598106162330,6f0f69272c0ba6bb349f6d3e7b17dcbddacb49a69ef6e6a89a1c9100a81c4a2c 22 | static/media/pablo-sports.fdf519bb.png,1598106162330,5e3cc8036bf640ebffde715d8e2f13c0ee668bb1456df06b692ab8800ec33b8b 23 | static/media/pablo-school.6299d10d.png,1598106162330,3ff50e07c6003476655f1520d9af5e9175621a26f729dae6b880c5bfe994728f 24 | static/css/2.fc5a9450.chunk.css,1598106162330,8a2de83dd267e01fbf649ae962a8ff698d521af49520c940ee39580e4105e1e3 25 | static/media/pablo-internet.c0ba5c16.png,1598106162330,cfdf168df17f7d92c526bc1419ae20a3677428f8c9a1d2d37b035747ba2eab12 26 | static/media/pablo-sign-up.5d82ef8a.png,1598106162324,a040fd11682d7d8aa92f392a22f76da5c8ca6234daa99936639ed7b884c63fda 27 | static/media/pablo-sign-in.78d5d6a8.png,1598106162324,55a06557f2618d1721be5931599065a22c4e6364086e34900751d3ce45ed6681 28 | static/media/pablo-food.6ac5fcb3.png,1598106162332,18a430005206cc219a8ecf804d08bc0f79528ae4dfde60fc3ef28b40fc25d94c 29 | static/css/2.fc5a9450.chunk.css.map,1598106162382,e1ea388cc3625e1f9d1c7fc0a41e16b04077779c5091c61e839192c28296dce4 30 | static/js/2.2381d555.chunk.js,1598106162381,06fa65cada866ec3824986e2af90e789e4c2fe16f8b78e3601c1af970c349d8e 31 | static/js/2.2381d555.chunk.js.map,1598106162410,8d6248bdde4ba78563070cce8e4a48b567d17c2e7c2004be56bbede99064af6a 32 | -------------------------------------------------------------------------------- /com-dict-client/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "community-dictionary-dev" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /com-dict-client/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | package-lock.json 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | .env 22 | 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /com-dict-client/.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /com-dict-client/.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "PreviewInSolutionExplorer": false 6 | } -------------------------------------------------------------------------------- /com-dict-client/.vs/com-dict-client/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/.vs/com-dict-client/v15/.suo -------------------------------------------------------------------------------- /com-dict-client/.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/.vs/slnx.sqlite -------------------------------------------------------------------------------- /com-dict-client/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "build", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /com-dict-client/functions/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | serviceAccountKey.json 3 | package-lock.json -------------------------------------------------------------------------------- /com-dict-client/functions/index.js: -------------------------------------------------------------------------------- 1 | const admin = require("firebase-admin"); 2 | const functions = require("firebase-functions"); 3 | const serviceAccount = require("./serviceAccountKey.json"); 4 | const moment = require("moment"); 5 | admin.initializeApp({ 6 | credential: admin.credential.cert(serviceAccount), 7 | databaseURL: "https://community-dictionary-dev.firebaseio.com", 8 | }); 9 | exports.scheduledFunctionCrontab = functions.pubsub 10 | .schedule("10 1 * * *") 11 | .timeZone("Asia/Kolkata") // Users can choose timezone - default is America/Los_Angeles 12 | .onRun((context) => { 13 | admin 14 | .firestore() 15 | .collection("definitions") 16 | .orderBy("trending_factor", "desc") 17 | .limit(1) 18 | .get() 19 | .then((querySnapshot) => { 20 | const defs = querySnapshot.docs.map((doc) => { 21 | return { ...doc.data(), id: doc.id }; 22 | }); 23 | const def = defs[0]; 24 | const the_day = moment().tz("Asia/Kolkata").format("YYYY-MM-DD"); 25 | admin 26 | .firestore() 27 | .collection("definitions") 28 | .doc(def.id) 29 | .update({ word_of_the_day: the_day }); 30 | }) 31 | .catch((err) => { 32 | console.log(err); 33 | }); 34 | return null; 35 | }); 36 | 37 | // exports.updateHeadTerms = functions.https.onRequest(async (req, res) => { 38 | // admin 39 | // .firestore() 40 | // .collection("headTerms") 41 | // .get() 42 | // .then(function (querySnapshot) { 43 | // querySnapshot.forEach(function (doc) { 44 | // doc.ref.update({ trending_factor: 0 }); 45 | // }); 46 | // }); 47 | // }); 48 | -------------------------------------------------------------------------------- /com-dict-client/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "scripts": { 5 | "serve": "firebase emulators:start --only functions", 6 | "shell": "firebase functions:shell", 7 | "start": "npm run shell", 8 | "deploy": "firebase deploy --only functions", 9 | "logs": "firebase functions:log" 10 | }, 11 | "engines": { 12 | "node": "10" 13 | }, 14 | "dependencies": { 15 | "algoliasearch": "^4.3.1", 16 | "firebase-admin": "^8.10.0", 17 | "firebase-functions": "^3.6.1", 18 | "moment": "^2.27.0" 19 | }, 20 | "devDependencies": { 21 | "firebase-functions-test": "^0.2.0" 22 | }, 23 | "private": true 24 | } 25 | -------------------------------------------------------------------------------- /com-dict-client/functions/ui-debug.log: -------------------------------------------------------------------------------- 1 | Web / API server started at http://localhost:4000 2 | -------------------------------------------------------------------------------- /com-dict-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com-dict", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.5.0", 8 | "@testing-library/user-event": "^7.2.1", 9 | "algoliasearch": "^4.3.1", 10 | "antd": "^4.2.5", 11 | "firebase": "^7.13.1", 12 | "firebase-admin": "^11.5.0", 13 | "firebase-functions": "^3.8.0", 14 | "react": "^16.13.1", 15 | "react-dom": "^16.13.1", 16 | "react-redux": "^7.2.0", 17 | "react-redux-firebase": "^3.3.0", 18 | "react-router-dom": "^5.2.0", 19 | "react-scripts": "3.4.1", 20 | "react-share": "^4.2.0", 21 | "redux": "^4.0.5", 22 | "redux-auth-wrapper": "^3.0.0", 23 | "redux-firestore": "^0.13.0", 24 | "redux-thunk": "^2.3.0" 25 | }, 26 | "scripts": { 27 | "start": "react-scripts start", 28 | "build": "react-scripts build", 29 | "test": "react-scripts test", 30 | "eject": "react-scripts eject" 31 | }, 32 | "eslintConfig": { 33 | "extends": "react-app" 34 | }, 35 | "browserslist": { 36 | "production": [ 37 | ">0.2%", 38 | "not dead", 39 | "not op_mini all" 40 | ], 41 | "development": [ 42 | "last 1 chrome version", 43 | "last 1 firefox version", 44 | "last 1 safari version" 45 | ] 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /com-dict-client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/public/favicon.ico -------------------------------------------------------------------------------- /com-dict-client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 23 | 24 | 33 | Community Dictionary 34 | 35 | 36 | 37 |
38 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /com-dict-client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/public/logo192.png -------------------------------------------------------------------------------- /com-dict-client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/public/logo512.png -------------------------------------------------------------------------------- /com-dict-client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /com-dict-client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /com-dict-client/src/App.css: -------------------------------------------------------------------------------- 1 | @import '~antd/dist/antd.css'; 2 | .App { 3 | text-align: center; 4 | } 5 | 6 | .App-logo { 7 | height: 40vmin; 8 | pointer-events: none; 9 | } 10 | 11 | @media (prefers-reduced-motion: no-preference) { 12 | .App-logo { 13 | animation: App-logo-spin infinite 20s linear; 14 | } 15 | } 16 | 17 | .App-header { 18 | background-color: #282c34; 19 | min-height: 100vh; 20 | display: flex; 21 | flex-direction: column; 22 | align-items: center; 23 | justify-content: center; 24 | font-size: calc(10px + 2vmin); 25 | color: white; 26 | } 27 | 28 | .App-link { 29 | color: #61dafb; 30 | } 31 | 32 | @keyframes App-logo-spin { 33 | from { 34 | transform: rotate(0deg); 35 | } 36 | to { 37 | transform: rotate(360deg); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /com-dict-client/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./App.css"; 3 | import Routes from "./routes"; 4 | 5 | export default function App() { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /com-dict-client/src/components/AddWord/RelatedWords.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Tag, Input, Tooltip, Button } from "antd"; 3 | 4 | function EditableTagGroup({ onChange }) { 5 | const [tags, setTags] = useState([]); 6 | const [inputVisible, setInputVisible] = useState(false); 7 | const [inputValue, setInputValue] = useState(""); 8 | const [input, setInput] = useState(""); 9 | console.log(input); 10 | const handleClose = (removedTag) => { 11 | const newTags = tags.filter((tag) => tag !== removedTag); 12 | setTags(newTags); 13 | }; 14 | 15 | const showInput = () => { 16 | setInputVisible(true); 17 | }; 18 | 19 | const handleInputChange = (e) => { 20 | setInputValue(e.target.value); 21 | }; 22 | 23 | const handleInputConfirm = () => { 24 | let allTags = []; 25 | if (inputValue && tags.indexOf(inputValue) === -1) { 26 | allTags = [...tags, inputValue]; 27 | } 28 | console.log(allTags); 29 | onChange(tags); 30 | setTags([]); 31 | setInputValue(""); 32 | setInputVisible(false); 33 | }; 34 | 35 | const saveInputRef = (val) => setInput(val); 36 | 37 | return ( 38 |
39 | {tags.map((tag, index) => { 40 | const isLongTag = tag.length > 20; 41 | const tagElem = ( 42 | handleClose(tag)}> 43 | {isLongTag ? `${tag.slice(0, 20)}...` : tag} 44 | 45 | ); 46 | return isLongTag ? ( 47 | 48 | {tagElem} 49 | 50 | ) : ( 51 | tagElem 52 | ); 53 | })} 54 | {inputVisible && ( 55 | 65 | )} 66 | {!inputVisible && ( 67 | 70 | )} 71 |
72 | ); 73 | } 74 | 75 | export default EditableTagGroup; 76 | -------------------------------------------------------------------------------- /com-dict-client/src/components/AddWord/WordClass.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Tag } from "antd"; 3 | 4 | const CheckableTag = Tag.CheckableTag; 5 | 6 | const tagsWordClass = [ 7 | "Verb", 8 | "Noun", 9 | "Adverb", 10 | "Adjective", 11 | "Determiner", 12 | "Pronoun", 13 | "Conjunction", 14 | "Preposition", 15 | ]; 16 | 17 | function WordClass(props) { 18 | const { onChange } = props; 19 | const [selectedTags, setSelectedTags] = useState([]); 20 | 21 | const handleChange = (tag, checked) => { 22 | const nextSelectedTags = checked 23 | ? [...selectedTags, tag] 24 | : selectedTags.filter((t) => t !== tag); 25 | console.log("Word class: ", nextSelectedTags); 26 | setSelectedTags(nextSelectedTags); 27 | onChange(nextSelectedTags); 28 | // this.setState({ selectedTags: nextSelectedTags }); 29 | }; 30 | 31 | return ( 32 |
33 | {tagsWordClass.map((tag) => ( 34 | -1} 38 | onChange={(checked) => handleChange(tag, checked)} 39 | > 40 | {tag} 41 | 42 | ))} 43 |
44 | ); 45 | } 46 | export default WordClass; 47 | -------------------------------------------------------------------------------- /com-dict-client/src/components/AlphaIndex/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Tabs, Row, Col } from "antd"; 3 | 4 | 5 | const { TabPane } = Tabs; 6 | 7 | function AlphaIndex() { 8 | return ( 9 | 10 | 11 | 12 | 17 | {[...Array(26).keys()].map((i) => ( 18 | 22 | {/* Content of tab {String.fromCharCode(i + 65)} */} 23 | 24 | ))} 25 | 26 | 27 | 28 | 29 | ); 30 | } 31 | 32 | export default AlphaIndex; 33 | -------------------------------------------------------------------------------- /com-dict-client/src/components/Categories/catHead.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Row, Col} from 'antd'; 3 | import { Typography } from "antd"; 4 | 5 | 6 | const { Title } = Typography; 7 | 8 | function CatHead() { 9 | return ( 10 | 11 | 12 |
13 | Sports 14 |
15 | 16 |
17 | ); 18 | } 19 | 20 | export default CatHead; 21 | -------------------------------------------------------------------------------- /com-dict-client/src/components/Comments/comment_list.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { Comment, List, Row } from "antd"; 3 | import { useFirestore } from "react-redux-firebase"; 4 | import moment from "moment"; 5 | 6 | function CommentList({ data }) { 7 | const firestore = useFirestore(); 8 | const [comments, setComments] = useState([]); 9 | console.log(data.id); 10 | useEffect(() => { 11 | firestore 12 | .collection("comments") 13 | .orderBy("createdAt") 14 | .where("definition_id", "==", data.id) 15 | .onSnapshot( 16 | (querySnapshot) => { 17 | console.log(querySnapshot.docs); 18 | const defs = querySnapshot.docs.map((doc) => { 19 | console.log( 20 | doc.data().definition_id, 21 | data.id, 22 | doc.data().definition_id.toString() === data.id.toString() 23 | ); 24 | return doc.data(); 25 | }); 26 | setComments(defs); 27 | }, 28 | (err) => { 29 | console.log(err); 30 | } 31 | ); 32 | // eslint-disable-next-line 33 | }, []); 34 | return ( 35 | 36 | ( 42 |
  • 43 | 52 |
  • 53 | )} 54 | /> 55 |
    56 | ); 57 | } 58 | export default CommentList; 59 | -------------------------------------------------------------------------------- /com-dict-client/src/components/Comments/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | // Typography, 4 | // Card, 5 | Row, 6 | Col, 7 | // Divider, 8 | // Button, 9 | } from "antd"; 10 | import Word from "../DictionaryView/word_summary"; 11 | import Reply from "./reply_editor"; 12 | import CommentDisplay from "./comment_list"; 13 | // const { Title } = Typography; 14 | 15 | function comment_section(props) { 16 | console.log(props.data); 17 | return ( 18 |
    19 | 20 | 21 | 22 | 23 | 24 |
    25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
    39 |
    40 | ); 41 | } 42 | 43 | export default comment_section; 44 | -------------------------------------------------------------------------------- /com-dict-client/src/components/Comments/reply_editor.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Comment, Avatar, Form, Button, Input, Row, Col } from "antd"; 3 | import moment from "moment"; 4 | import { addComment } from "../../store/actions"; 5 | import { useFirestore } from "react-redux-firebase"; 6 | import { useSelector } from "react-redux"; 7 | 8 | const { TextArea } = Input; 9 | 10 | const Editor = ({ onChange, onSubmit, submitting, value }) => ( 11 | <> 12 | 13 |