├── .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 | You need to enable JavaScript to run this app.
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 |
68 | + New Word
69 |
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 |
14 |
15 |
16 |
22 | Add Comment
23 |
24 |
25 | >
26 | );
27 |
28 | function ReplyEditor({ data }) {
29 | const [value, setValue] = useState("");
30 | const firestore = useFirestore();
31 | const handleSubmit = () => {
32 | if (!value) {
33 | return;
34 | }
35 | let tempComment = {
36 | comment: value,
37 | createdAt: moment().format(),
38 | definition_id: data.id,
39 | uid: user.uid,
40 | uname: user.displayName,
41 | uphoto: user.photoURL,
42 | };
43 | addComment(tempComment)(firestore);
44 | };
45 |
46 | const handleChange = (e) => {
47 | setValue(e.target.value);
48 | };
49 |
50 | const user = useSelector((state) => state.firebase.auth);
51 | return (
52 |
53 |
54 |
55 | }
57 | content={
58 |
63 | }
64 | />
65 |
66 |
67 | );
68 | }
69 |
70 | // }
71 |
72 | // ReactDOM.render( , mountNode);
73 |
74 | export default ReplyEditor;
75 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/DictionaryView/word_dict.js:
--------------------------------------------------------------------------------
1 | // import React from "./node_modules/react";
2 | import React from "./node_modules/react";
3 | import {
4 | Typography,
5 | Card,
6 | Row,
7 | Col,
8 | Divider,
9 | Button,
10 | } from "./node_modules/antd";
11 |
12 | import {
13 | SoundOutlined,
14 | LikeOutlined,
15 | DislikeOutlined,
16 | PlusCircleOutlined,
17 | } from "./node_modules/@ant-design/icons";
18 |
19 | import SelectLang from "../Home/SelectLang";
20 | import SocialShare from "../WordAlpabatical/socialShare";
21 |
22 | const { Title, Text } = Typography;
23 |
24 | function Word() {
25 | return (
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
42 | Word
43 |
44 |
45 |
53 |
54 |
55 |
56 |
64 |
65 |
66 |
67 |
68 | English
69 |
74 | Noun
75 |
80 |
81 |
82 |
83 |
84 | Definition
85 |
86 |
87 | Example on usage
88 |
89 |
90 |
91 | Created by "user" on "date"
92 |
93 |
94 |
95 |
96 |
104 | #_Likes
105 |
106 |
115 |
116 | #_Dislikes
117 |
118 |
119 |
127 |
128 | Comment
129 |
130 |
131 | Report inappropriate
132 |
133 |
134 |
135 |
136 |
137 | Related Words
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | Available translations
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | Language
162 |
163 |
164 | Link to translation
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 | );
175 | }
176 |
177 | export default Word;
178 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/DictionaryView/word_summary.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Typography, Card, Row, Col, Divider } from "antd";
3 |
4 | // import { SoundOutlined } from "@ant-design/icons";
5 | // import moment from "moment";
6 |
7 | const { Title, Text } = Typography;
8 |
9 | function Word({ data }) {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {data.head_term}
19 |
20 |
21 |
22 |
30 |
31 | {data.head_term}
32 |
33 |
34 |
35 |
36 | {data.other_language}
37 |
42 | {data.word_classes.map((val, i) => (
43 | {val}
44 | ))}
45 |
50 | {/* */}
51 |
52 |
53 |
54 |
55 | {data.other_language_def}
56 |
57 |
58 |
59 |
60 | {data.example}
61 |
62 |
63 |
64 |
65 | Created by{" "}
66 | {data.uname}
67 | {/*
68 | {moment(data.createdAt).format("dddd, MMMM Do YYYY")}
69 | */}
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | );
79 | }
80 |
81 | export default Word;
82 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Flag/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Row, Col, Typography, List } from "antd";
3 | import report from "../../images/pablo-word-remove.png";
4 | import Word from "../DictionaryView/word_summary";
5 | import ReportWord from "./report_cats";
6 |
7 | const { Text } = Typography;
8 |
9 | const dataLines = [
10 | "Are inside jokes with no context",
11 | "Include terms that don’t actually seem real",
12 | "Include full names or other personal information",
13 | "Include hate speech, bullying, or any other statements meant to discriminate or incite violence against others",
14 | "Go against any of our other content guidelines",
15 | ];
16 |
17 | function FlagWord({ data }) {
18 | console.log(data);
19 | return (
20 |
21 |
22 |
23 |
24 |
27 | Report inappropriate definitions
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 | You can report words that....
39 |
40 |
41 |
42 |
43 |
44 |
45 | (
54 | {item}
55 | )}
56 | />
57 |
58 |
59 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
78 |
79 |
80 |
83 | You chose to report....
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
97 | Why should this content be removed?
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | );
108 | }
109 |
110 | export default FlagWord;
111 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Flag/report_cats.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import {
3 | Radio,
4 | // Input,
5 | Typography,
6 | Button,
7 | Row,
8 | Col,
9 | } from "antd";
10 | import { addReport } from "../../store/actions";
11 | import { useFirestore } from "react-redux-firebase";
12 | import moment from "moment";
13 | import { useSelector } from "react-redux";
14 | import { useHistory } from "react-router-dom";
15 |
16 | const { Text } = Typography;
17 | function ReportWord({ data, reasons }) {
18 | const [value, setValue] = useState(0);
19 | const firestore = useFirestore();
20 | const onChange = (e) => {
21 | setValue(e.target.value);
22 | };
23 | const radioStyle = {
24 | display: "block",
25 | // height: "6vmin",
26 | lineHeight: "5vmin",
27 | };
28 | const handleSubmit = () => {
29 | let tempReport = {
30 | reason: reasons[value],
31 | createdAt: moment().format(),
32 | definition_id: data.id,
33 | uid: user.uid,
34 | uname: user.displayName,
35 | };
36 | addReport(tempReport)(firestore, history);
37 | };
38 | const user = useSelector((state) => state.firebase.auth);
39 | const history = useHistory();
40 | return (
41 |
42 |
43 |
44 |
45 |
51 | {reasons.map((val, i) => (
52 |
53 |
54 | {val}
55 |
56 |
57 | ))}
58 |
59 |
60 |
61 |
62 |
63 |
64 |
77 | Submit your report here... Our team will look into it
78 |
79 |
80 |
81 |
82 | );
83 | }
84 | export default ReportWord;
85 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Footer/FooterPage.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Row, Col } from "antd";
3 | import { Link } from "react-router-dom";
4 | import { Typography } from "antd";
5 | import {
6 | InfoCircleOutlined,
7 | LockOutlined,
8 | FileTextOutlined,
9 | BugOutlined,
10 | GithubOutlined,
11 | ExclamationCircleOutlined,
12 | PhoneOutlined,
13 | UnorderedListOutlined,
14 | MailOutlined,
15 | EnvironmentOutlined,
16 | } from "@ant-design/icons";
17 | import "../../containers/home/footer.css";
18 |
19 | const { Title } = Typography;
20 |
21 | function Footer() {
22 | return (
23 |
24 |
25 |
26 |
27 | Community Dictionary
28 | Your everyday online dictionary
29 |
30 |
31 |
32 |
About
33 |
34 |
35 |
36 |
37 |
38 |
39 | About Community Dictionary
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Privacy and Security
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Terms and Conditions
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
Help
68 |
69 |
70 |
71 |
72 |
73 |
74 | FAQ
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | Bug Report
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | GitHub
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | Issues
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
Contact Us
113 |
114 |
115 |
116 |
117 |
118 |
119 | +94 XXXXXXXXX
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 | XXXXXXXX@gmail.com
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 | Location
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | Copyright © SCoReLab
150 |
151 |
152 |
153 | );
154 | }
155 |
156 | export default Footer;
157 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Footer/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Row , Col} from 'antd';
3 | import {Link} from 'react-router-dom';
4 | import { Typography } from 'antd';
5 | import {InfoCircleOutlined, LockOutlined, FileTextOutlined, BugOutlined,
6 | GithubOutlined, ExclamationCircleOutlined, PhoneOutlined,
7 | UnorderedListOutlined,MailOutlined, EnvironmentOutlined}
8 | from '/@ant-design/icons';
9 | import "../../containers/home/footer.css";
10 |
11 |
12 | const { Title } = Typography;
13 |
14 | function Footer() {
15 | return (
16 |
17 |
18 |
19 |
20 | Community Dictionary
21 | Your everyday online dictionary
22 |
23 |
24 |
25 |
26 |
About
27 |
28 |
29 |
30 |
31 |
32 |
33 | About Community Dictionary
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | Privacy and Security
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | Terms and Conditions
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
Help
60 |
61 |
62 |
63 |
64 |
65 |
66 | FAQ
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Bug Report
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | GitHub
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | Issues
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | Contact Us
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | +94 XXXXXXXXX
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | XXXXXXXX@gmail.com
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 | Location
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | Copyright © SCoReLab
138 |
139 |
140 |
141 | );
142 | }
143 |
144 | export default Footer;
145 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Header/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Row, Col } from "antd";
3 | import { Link, useHistory } from "react-router-dom";
4 | import { Menu, Typography } from "antd";
5 | import { MenuOutlined } from "@ant-design/icons";
6 | import UserAccount from "../Login/index";
7 | import SearchText from "../Search/SearchText";
8 | import cover from "../../images/logo/cover.png";
9 | import { useSelector } from "react-redux";
10 | import { signOut } from "../../store/actions";
11 | import { useFirebase } from "react-redux-firebase";
12 | import { useLocation } from "react-router-dom";
13 |
14 | const { SubMenu } = Menu;
15 |
16 | function TitleBar() {
17 | const firebase = useFirebase();
18 | const history = useHistory();
19 | const user = useSelector((state) => state.firebase.auth);
20 | console.log(user);
21 | const location = useLocation();
22 | console.log(location.pathname);
23 |
24 | return (
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
41 | }
42 | >
43 |
44 | Dictionary
45 |
46 |
47 | All categories
48 |
49 |
50 | {/*
51 | Vote
52 | */}
53 |
54 |
55 |
56 |
57 |
58 |
59 | {/*
63 |
64 |
65 | }
66 | > */}
67 | {user.uid ? (
68 | }
70 | key="profile"
71 | >
72 |
73 | {user.displayName}
74 |
75 |
76 | signOut()(firebase, history)}>
77 | Logout
78 |
79 |
80 |
81 | ) : (
82 |
86 |
87 |
88 | }
89 | >
90 | )}
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | );
99 | }
100 |
101 | export default TitleBar;
102 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Home/AlphaIndex.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Tabs } from "antd";
3 | import { useHistory } from "react-router-dom";
4 |
5 | const { TabPane } = Tabs;
6 |
7 | function AlphaIndex() {
8 | const history = useHistory();
9 | return (
10 |
11 |
13 | history.push("/letter", { activeKey: activeKey })
14 | }
15 | defaultActiveKey="A"
16 | tabBarGutter="6px"
17 | type="card"
18 | size="large"
19 | className="index"
20 | >
21 | {[...Array(26).keys()].map((i) => (
22 |
26 | ))}
27 |
28 |
29 | );
30 | }
31 |
32 | export default AlphaIndex;
33 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Home/AlphaIndexHome.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Tabs } from "antd";
3 | import { useHistory } from "react-router-dom";
4 |
5 | const { TabPane } = Tabs;
6 |
7 | function AlphaIndexHome() {
8 | const history = useHistory();
9 | return (
10 |
11 |
13 | history.push("/letter", { activeKey: activeKey })
14 | }
15 | defaultActiveKey="A"
16 | tabBarGutter="2vmin"
17 | type="card"
18 | size="large"
19 | tabPosition='top'
20 | className="index_home"
21 | style={{fontSize:'3vmin',fontWeight:'800',display:'block'}}
22 | >
23 | {[...Array(26).keys()].map((i) => (
24 |
28 | ))}
29 |
30 |
31 | );
32 | }
33 |
34 | export default AlphaIndexHome;
35 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Home/DayNew.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Row, Col, Card, Divider, Typography} from 'antd';
3 |
4 | const { Title } = Typography;
5 |
6 | function DayNew()
7 | {
8 | return(
9 |
10 |
11 |
12 |
13 | Word of the Day
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | Word
22 |
23 |
24 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. "
25 |
26 |
27 |
28 |
29 |
30 |
31 |
37 |
38 | Word 1
39 | Word 2
40 |
41 |
42 | Word 3
43 | Word 4
44 |
45 |
46 | Word 5
47 | Word 6
48 |
49 |
50 | Word 7
51 | Word 8
52 |
53 |
54 |
55 |
56 |
57 |
58 | )
59 | }
60 |
61 | export default DayNew
--------------------------------------------------------------------------------
/com-dict-client/src/components/Home/SearchText.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Input } from 'antd';
3 |
4 |
5 | const { Search } = Input;
6 |
7 | function SearchText()
8 | {
9 | return(
10 |
11 | console.log(value)}
15 | className="search_style"
16 | />
17 |
18 | )
19 | }
20 |
21 |
22 | export default SearchText
--------------------------------------------------------------------------------
/com-dict-client/src/components/Home/SelectLang.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Select } from "antd";
3 |
4 | const { Option } = Select;
5 | var optionText;
6 |
7 | function onChange(value) {
8 | optionText = value;
9 | console.log(optionText);
10 | }
11 |
12 | function onBlur() {
13 | console.log("blur");
14 | }
15 |
16 | function onFocus() {
17 | console.log("focus");
18 | }
19 |
20 | function onSearch(val) {
21 | console.log("search:", val);
22 | }
23 |
24 | function SelectLang() {
25 | return (
26 |
38 | option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
39 | }
40 | >
41 | English
42 | French
43 | Spanish
44 |
45 | );
46 | }
47 |
48 | export default SelectLang;
49 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Home/WordSearch.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Row, Col} from 'antd';
3 | import SelectLang from "./SelectLang"
4 | import SearchText from "./SearchText"
5 |
6 |
7 |
8 | function WordSearch()
9 | {
10 | return(
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | )
22 | }
23 |
24 |
25 | export default WordSearch
--------------------------------------------------------------------------------
/com-dict-client/src/components/Login/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import {
3 | Modal,
4 | // Avatar,
5 | Button,
6 | Card,
7 | Divider,
8 | Typography,
9 | Row,
10 | Col,
11 | } from "antd";
12 | import NormalLoginForm from "./loginForm";
13 | import SocialLogin from "./socialLogin";
14 | import login from "../../images/pablo-sign-in.png";
15 |
16 | const { Text } = Typography;
17 | // const { Meta } = Card;
18 |
19 | function App(props) {
20 | const [state, setState] = useState({
21 | visible: false,
22 | confirmLoading: false,
23 | });
24 | const showModal = () => {
25 | setState({
26 | ...state,
27 | visible: true,
28 | });
29 | };
30 |
31 | const handleOk = () => {
32 | setState({
33 | ...state,
34 | confirmLoading: true,
35 | });
36 | setTimeout(() => {
37 | setState({
38 | visible: false,
39 | confirmLoading: false,
40 | });
41 | }, 2000);
42 | };
43 |
44 | const handleCancel = () => {
45 | console.log("Clicked cancel button");
46 | setState({
47 | ...state,
48 | visible: false,
49 | });
50 | };
51 |
52 | const { visible, confirmLoading } = state;
53 | return (
54 |
55 |
56 |
57 |
58 |
66 |
67 |
75 |
76 |
86 |
87 |
88 |
89 |
106 |
107 |
108 | OR
109 |
110 |
111 |
112 |
113 |
117 |
118 |
119 |
120 |
121 | );
122 | }
123 |
124 | export default App;
125 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Login/loginForm.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Form, Input, Button, Checkbox } from "antd";
3 | import { MailOutlined, LockOutlined } from "@ant-design/icons";
4 | import { useFirebase } from "react-redux-firebase";
5 | import { useHistory } from "react-router-dom";
6 | import { signIn } from "../../store/actions";
7 |
8 | const NormalLoginForm = () => {
9 | const firebase = useFirebase();
10 | const history = useHistory();
11 |
12 | const onSubmit = (values) => {
13 | console.log("Received values of form: ", values);
14 | signIn(values)(firebase, history);
15 | };
16 |
17 | return (
18 |
36 | }
38 | placeholder="Email"
39 | />
40 |
41 |
50 | }
52 | type="password"
53 | placeholder="Password"
54 | />
55 |
56 |
57 |
58 | Remember me
59 |
60 |
61 |
62 | Forgot password
63 |
64 |
65 |
66 |
67 |
68 | Sign in
69 |
70 |
71 |
72 | );
73 | };
74 |
75 | export default NormalLoginForm;
76 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Login/socialLogin.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Typography, Button, Row, Col } from "antd";
3 | import {
4 | FacebookFilled,
5 | TwitterOutlined,
6 | GoogleOutlined,
7 | } from "@ant-design/icons";
8 | // import { useSelector } from "react-redux";
9 | import { useFirebase } from "react-redux-firebase";
10 | import { signInWithGoogle, signInWithProviderID } from "../../store/actions";
11 | import { useHistory } from "react-router-dom";
12 | const { Text } = Typography;
13 |
14 | function SocialLogin() {
15 | const firebase = useFirebase();
16 | const history = useHistory;
17 | // const auth = useSelector((state) => state.firebase.auth);
18 |
19 | const loginWithGoogle = async () => {
20 | await signInWithGoogle()(firebase, history);
21 | };
22 |
23 | const loginWithProviderID = async (provider) => {
24 | await signInWithProviderID(provider)(firebase, history);
25 | };
26 | return (
27 |
28 |
29 |
30 | Login using your social media account
31 |
32 |
33 |
34 |
35 |
43 | }
47 | // size="large"
48 | onClick={() => loginWithProviderID("facebook")}
49 | >
50 | Facebook
51 |
52 |
53 |
61 | }
65 | // size="large"
66 | onClick={() => loginWithProviderID("twitter")}
67 | >
68 | Twitter
69 |
70 |
71 |
79 | }
83 | onClick={loginWithGoogle}
84 | // size="large"
85 | >
86 | Google
87 |
88 |
89 |
90 |
91 | );
92 | }
93 |
94 | export default SocialLogin;
95 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Navbar/UserAccount.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Modal, Button, Card, Divider, Typography } from "antd";
3 | import { UserOutlined } from "@ant-design/icons";
4 | import NormalLoginForm from "../Login/loginForm";
5 | import SocialLogin from "../Login/socialLogin";
6 |
7 | const { Text } = Typography;
8 |
9 | class App extends React.Component {
10 | state = {
11 | visible: false,
12 | confirmLoading: false,
13 | };
14 |
15 | showModal = () => {
16 | this.setState({
17 | visible: true,
18 | });
19 | };
20 |
21 | handleOk = () => {
22 | this.setState({
23 | confirmLoading: true,
24 | });
25 | setTimeout(() => {
26 | this.setState({
27 | visible: false,
28 | confirmLoading: false,
29 | });
30 | }, 2000);
31 | };
32 |
33 | handleCancel = () => {
34 | console.log("Clicked cancel button");
35 | this.setState({
36 | visible: false,
37 | });
38 | };
39 |
40 | render() {
41 | const { visible, confirmLoading } = this.state;
42 | return (
43 |
44 |
55 | }
56 | onClick={this.showModal}
57 | >
58 |
66 |
82 |
83 |
84 | OR
85 |
86 |
87 |
88 |
89 |
93 |
94 |
95 | );
96 | }
97 | }
98 |
99 | export default App;
100 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Search/SearchText.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import { Input, Col } from "antd";
3 | import { useHistory } from "react-router-dom";
4 | import SelectLang from "./SelectLang";
5 | import { toTitleCase } from "../../utils.js/toTitleCase";
6 |
7 | const { Search } = Input;
8 |
9 | function SearchText(props) {
10 | const history = useHistory();
11 | const [language, setLanguage] = useState("English");
12 | // keyWord, handleSearch,
13 |
14 | const { setKeyWord } = props;
15 | return (
16 | <>
17 |
18 | setLanguage(value)} />
19 |
20 |
21 |
22 |
30 | history.push(`/search/${language}/${toTitleCase(value)}`)
31 | }
32 | className="search_style"
33 | onChange={setKeyWord}
34 | />
35 |
36 | >
37 | );
38 | }
39 |
40 | export default SearchText;
41 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Search/SelectLang.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Select } from "antd";
3 | import { languages } from "../../constants";
4 |
5 | const { Option } = Select;
6 |
7 | function SelectLang({ value, onChange }) {
8 | return (
9 |
21 | {languages.map((val, i) => (
22 |
23 | {val}
24 |
25 | ))}
26 |
27 | );
28 | }
29 |
30 | export default SelectLang;
31 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/Search/index.js:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 | import { Row, Col, Typography } from "antd";
3 | import { useFirestore } from "react-redux-firebase";
4 | import WordSearch from "./WordSearch";
5 | import { updateWord } from "../../store/actions";
6 | const { Title } = Typography;
7 |
8 | export default function FullTextSearch({ params }) {
9 | const firestore = useFirestore();
10 | const [words, setWords] = useState(undefined);
11 |
12 | useEffect(() => {
13 | firestore
14 | .collection("definitions")
15 | .orderBy("likes", "desc")
16 | .where("head_term", "==", params.keyword)
17 | .where("other_language", "==", params.language)
18 | .limit(10)
19 | .get()
20 | .then((querySnapshot) => {
21 | const defs = querySnapshot.docs.map((doc) => {
22 | let tempObj = {};
23 | tempObj = doc.data();
24 | tempObj["id"] = doc.id;
25 | return tempObj;
26 | });
27 | console.log(defs);
28 | if (defs.length > 0) {
29 | const topDef = defs[0];
30 | const newTrendingFactor = parseInt(topDef.trending_factor) + 1;
31 | updateWord(topDef.id, { trending_factor: newTrendingFactor })(
32 | firestore
33 | );
34 | }
35 | setWords(defs);
36 | })
37 | .catch((err) => {
38 | console.log(err);
39 | });
40 | // eslint-disable-next-line
41 | }, [params]);
42 | return (
43 | <>
44 |
45 |
46 |
47 | Search results for "{params.keyword}" in "{params.language}"
48 |
49 |
50 |
51 |
52 | {words && words.map((val, i) => )}
53 |
54 | >
55 | );
56 | }
57 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordAlpabatical/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from "react";
2 | import {
3 | // Typography,
4 | // Card,
5 | Row,
6 | Col,
7 | // Divider,
8 | // Button,
9 | // Pagination,
10 | Tabs,
11 | } from "antd";
12 | // import { useSelector } from "react-redux";
13 | import { useFirestore } from "react-redux-firebase";
14 | import LetterHead from "./letterHead";
15 | import WordCutom from "./word";
16 |
17 | // const { Title, Text } = Typography;
18 | const { TabPane } = Tabs;
19 | function WordHome(props) {
20 | const defaultKey = props.activeKey || "A";
21 | const [activeKey, setActiveKey] = useState(defaultKey);
22 | // const [headTerms, setHeadTerms] = useState([]);
23 | const [words, setWords] = useState([]);
24 |
25 | const firestore = useFirestore();
26 |
27 | useEffect(() => {
28 | firestore
29 | .collection("definitions")
30 | .orderBy("createdAt")
31 | .where("alphabatical", "==", activeKey)
32 | .limit(10)
33 | .get()
34 | .then((querySnapshot) => {
35 | console.log(querySnapshot.docs);
36 | // let lastItem = "";
37 | const defs = querySnapshot.docs.map((doc) => {
38 | let tempObj = {};
39 | tempObj = doc.data();
40 | tempObj["id"] = doc.id;
41 | return tempObj;
42 | });
43 | setWords(defs);
44 | // setEndAt(lastItem);
45 | })
46 | .catch((err) => {
47 | console.log(err);
48 | });
49 | }, [activeKey, firestore]);
50 |
51 | console.log(words);
52 |
53 | return (
54 | <>
55 | setActiveKey(key)}
57 | defaultActiveKey={activeKey}
58 | type="card"
59 | size="large"
60 | className="index"
61 | >
62 | {[...Array(26).keys()].map((i) => (
63 |
67 |
68 |
69 | {words.length > 0
70 | ? words.map((val, j) => (
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | ))
79 | : ""}
80 |
81 | ))}
82 |
83 | >
84 | );
85 | }
86 |
87 | export default WordHome;
88 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordAlpabatical/letterHead.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Typography } from "antd";
3 |
4 | const { Title } = Typography;
5 |
6 | function LetterHead(props) {
7 | const { letter } = props;
8 | return (
9 |
10 |
18 | {letter}
19 |
20 |
21 | );
22 | }
23 |
24 | export default LetterHead;
25 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordClass.js:
--------------------------------------------------------------------------------
1 | import React 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 | class WordClass extends React.Component {
18 | state = {
19 | selectedTags: [],
20 | };
21 |
22 | handleChange(tag, checked) {
23 | const { selectedTags } = this.state;
24 | const nextSelectedTags = checked
25 | ? [...selectedTags, tag]
26 | : selectedTags.filter((t) => t !== tag);
27 | console.log("Word class: ", nextSelectedTags);
28 | this.setState({ selectedTags: nextSelectedTags });
29 | }
30 |
31 | render() {
32 | const { selectedTags } = this.state;
33 | return (
34 |
35 | {tagsWordClass.map((tag) => (
36 | -1}
40 | onChange={(checked) => this.handleChange(tag, checked)}
41 | >
42 | {tag}
43 |
44 | ))}
45 |
46 | );
47 | }
48 | }
49 | export default WordClass;
50 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordHome/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from "react";
2 | import { Typography, Row, Col } from "antd";
3 | import { useFirestore } from "react-redux-firebase";
4 | import WordSimple from "./wordSimple";
5 | import WordDay from "./wordDay";
6 | import IndexHome from "../Home/AlphaIndexHome";
7 | import moment from "moment";
8 | import WordCarousel from "./wordCarousel";
9 | const { Text } = Typography;
10 |
11 | function WordHome() {
12 | const firestore = useFirestore();
13 | const [words, setWords] = useState([]);
14 | // const [endAt, setEndAt] = useState("");
15 | const [wordOfTheDay, setWordOfTheDay] = useState({ word_classes: [] });
16 | const [trending, setTrending] = useState([{}]);
17 |
18 | useEffect(() => {
19 | firestore
20 | .collection("definitions")
21 | .orderBy("word_of_the_day", "desc")
22 | .limit(10)
23 | .onSnapshot(
24 | (querySnapshot) => {
25 | console.log(querySnapshot.docs);
26 | // let lastItem = "";
27 | const defs = [];
28 | querySnapshot.docs.filter((doc) => {
29 | if (doc.data().word_of_the_day) {
30 | // lastItem = doc.id;
31 | let tempObj = {};
32 | tempObj = doc.data();
33 | tempObj["id"] = doc.id;
34 | defs.push(tempObj);
35 | }
36 | return null;
37 | });
38 | console.log(defs);
39 | setWords(defs);
40 | // setEndAt(lastItem);
41 | },
42 | (err) => {
43 | console.log(err);
44 | }
45 | );
46 |
47 | firestore
48 | .collection("definitions")
49 | .orderBy("trending_factor", "desc")
50 | .limit(10)
51 | .onSnapshot(
52 | (querySnapshot) => {
53 | const defs = [];
54 | querySnapshot.docs.map((doc) => {
55 | defs.push(doc.data());
56 | return null;
57 | });
58 | setTrending(defs);
59 | },
60 | (err) => {
61 | console.log(err);
62 | }
63 | );
64 |
65 | const today = moment().format("YYYY-MM-DD");
66 | console.log(today);
67 | firestore
68 | .collection("definitions")
69 | .where("word_of_the_day", "==", today)
70 | .limit(1)
71 | .onSnapshot(
72 | (querySnapshot) => {
73 | const defs = [];
74 | querySnapshot.docs.map((doc) => {
75 | defs.push(doc.data());
76 | return null;
77 | });
78 | console.log(defs[0]);
79 | setWordOfTheDay(defs[0]);
80 | },
81 | (err) => {
82 | console.log(err);
83 | }
84 | );
85 | // eslint-disable-next-line
86 | }, []);
87 |
88 | // const loadMore = (event) => {
89 | // const target = event.target;
90 | // console.log("hello");
91 | // if (target.scrollHeight - target.scrollTop === target.clientHeight) {
92 | // alert("Bottom");
93 | // }
94 | // };
95 |
96 | // document.getElementById("root").onscroll = loadMore;
97 |
98 | return (
99 | <>
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | {words.length > 0
109 | ? words.map((val, i) => )
110 | : ""}
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
132 | Browse Community Dictionary
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 | >
143 | );
144 | }
145 |
146 | export default WordHome;
147 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordHome/socialShare.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | // import { Button } from "antd";
3 | // import { ShareAltOutlined } from "@ant-design/icons";
4 |
5 | import {
6 | TwitterShareButton,
7 | FacebookShareButton,
8 | FacebookIcon,
9 | TwitterIcon,
10 | } from "react-share";
11 | function SocialShare({ other_language, head_term }) {
12 | const siteUrl = `https://community-dictionary-dev.firebaseapp.com/search/${other_language}/${encodeURIComponent(
13 | head_term
14 | )}`;
15 | return (
16 |
17 |
21 |
22 |
23 |
27 |
28 |
29 |
30 | {/*
36 | }
37 | size="large"
38 | > */}
39 |
40 | );
41 | }
42 |
43 | export default SocialShare;
44 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordHome/word.js:
--------------------------------------------------------------------------------
1 | // import React from "./node_modules/react";
2 | import React from "react";
3 | import { Typography, Card, Row, Col, Divider, Button } from "antd";
4 | // } from "./node_modules/antd";
5 | // import SocialShare from "./SocialShare";
6 | import {
7 | SoundOutlined,
8 | LikeOutlined,
9 | DislikeOutlined,
10 | PlusCircleOutlined,
11 | } from "@ant-design/icons";
12 | // } from "./node_modules/@ant-design/icons";
13 | import SelectLang from "../Search/SelectLang";
14 | import SocialShare from "./socialShare";
15 |
16 | const { Title, Text } = Typography;
17 |
18 | function Word({ data }) {
19 | return (
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Word
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | English
41 |
46 | Noun
47 |
52 |
53 |
54 |
55 | Definition
56 |
57 |
58 | Example on usage
59 |
60 |
61 |
62 | Created by "user" on "date"
63 |
64 |
65 |
66 |
67 |
68 | #_Likes
69 |
70 |
79 |
80 | #_Dislikes
81 |
82 |
83 |
84 |
85 | Comment
86 |
87 |
88 | Report inappropriate
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | Related Words
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | Available translations
108 |
111 |
112 |
113 |
114 |
115 | Language
116 |
117 |
118 | Link to translation
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | );
128 | }
129 |
130 | export default Word;
131 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordHome/wordCarousel.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Carousel, Typography, Row, Col } from "antd";
3 | import { toTitleCase } from "../../utils.js/toTitleCase";
4 | import { useHistory } from "react-router-dom";
5 | // import "./home.css";
6 |
7 | const { Text } = Typography;
8 |
9 | function WordCarousel({ data }) {
10 | const history = useHistory();
11 | return (
12 |
13 |
14 |
15 |
23 | Trending Words
24 |
25 |
26 |
27 |
28 |
29 |
30 | {data &&
31 | data.slice(0, 4).map((val, i) => (
32 |
33 |
40 |
42 | history.push(
43 | `/search/English/${toTitleCase(val.head_term)}`
44 | )
45 | }
46 | >
47 | {val.head_term}
48 |
49 |
50 |
51 | ))}
52 |
53 |
54 |
55 |
56 | {data &&
57 | data.slice(4, 10).map((val, i) => (
58 |
59 |
66 |
68 | history.push(
69 | `/search/English/${toTitleCase(val.head_term)}`
70 | )
71 | }
72 | >
73 | {val.head_term}
74 |
75 |
76 |
77 | ))}
78 |
79 |
80 |
81 |
82 |
83 |
84 | );
85 | }
86 |
87 | export default WordCarousel;
88 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordSearch/SocialShare.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Button } from "antd";
3 | import { ShareAltOutlined } from "@ant-design/icons";
4 |
5 | import {
6 | TwitterShareButton,
7 | FacebookShareButton,
8 | FacebookIcon,
9 | TwitterIcon,
10 | } from "react-share";
11 |
12 | function SocialShare() {
13 | return (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
28 | }
29 | size="large"
30 | >
31 |
32 | );
33 | }
34 |
35 | export default SocialShare;
36 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordSearch/Word.js:
--------------------------------------------------------------------------------
1 | // import React from "./node_modules/react";
2 | import React from "react";
3 | import { Typography, Card, Row, Col, Divider, Button } from "antd";
4 | // } from "./node_modules/antd";
5 | // import SocialShare from "./SocialShare";
6 | import {
7 | SoundOutlined,
8 | LikeOutlined,
9 | DislikeOutlined,
10 | PlusCircleOutlined,
11 | } from "@ant-design/icons";
12 | // } from "./node_modules/@ant-design/icons";
13 | import SelectLang from "../Search/SelectLang";
14 | import SocialShare from "./SocialShare";
15 |
16 | const { Title, Text } = Typography;
17 |
18 | function Word() {
19 | return (
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Word
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | English
41 |
46 | Noun
47 |
52 |
53 |
54 |
55 | Definition
56 |
57 |
58 | Example on usage
59 |
60 |
61 |
62 | Created by "user" on "date"
63 |
64 |
65 |
66 |
67 |
68 | #_Likes
69 |
70 |
79 |
80 | #_Dislikes
81 |
82 |
83 |
84 |
85 | Comment
86 |
87 |
88 | Report inappropriate
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | Related Words
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | Available translations
108 |
111 |
112 |
113 |
114 |
115 | Language
116 |
117 |
118 | Link to translation
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | );
128 | }
129 |
130 | export default Word;
131 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordSearch/book.js:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import { Typography, Card, Row, Col, Divider, Button } from "antd";
3 | import {
4 | SoundOutlined,
5 | LikeOutlined,
6 | DislikeOutlined,
7 | } from "@ant-design/icons";
8 | import SelectLang from "../Search/SelectLang";
9 | import SocialShare from "./SocialShare";
10 | import HTMLFlipBook from "react-pageflip";
11 | import WordHome from "./index";
12 | import { useSelector } from "react-redux";
13 | import { useFirestoreConnect } from "react-redux-firebase";
14 | const { Title, Text } = Typography;
15 |
16 | const Page = React.forwardRef((props, ref) => {
17 | return (
18 | /* ref required */
19 |
Page Header
20 |
{props.children}
21 |
Page number: {props.number}
22 |
23 | );
24 | });
25 |
26 | function WordBook(props) {
27 | return (
28 |
42 |
43 |
44 | Page text
45 | Page text
46 |
47 | );
48 | }
49 |
50 | export default WordBook;
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordSearch/index.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from "react";
2 | import { Typography, Card, Row, Col, Divider, Button, Pagination } from "antd";
3 | import { useFirestore, isLoaded, isEmpty } from "react-redux-firebase";
4 | import WordSimple from "./wordSimple";
5 |
6 | const { Title, Text } = Typography;
7 |
8 | function WordSearch(props) {
9 | const firestore = useFirestore();
10 | const [words, setWords] = useState([]);
11 | const [trending, setTrending] = useState([]);
12 | const { keyword } = props;
13 |
14 | useEffect(() => {
15 | firestore
16 | .collection("definitions")
17 | .orderBy("createdAt")
18 | .where("head_term", "==", keyword)
19 | .startAfter(new Date().getTime())
20 | .limit(10)
21 | .onSnapshot(
22 | (querySnapshot) => {
23 | console.log(querySnapshot.docs);
24 | setWords(
25 | querySnapshot.docs.map((doc) => {
26 | return doc.data();
27 | })
28 | );
29 | },
30 | (err) => {
31 | console.log(err);
32 | }
33 | );
34 |
35 | firestore
36 | .collection("definitions")
37 | .orderBy("likes")
38 | .onSnapshot(
39 | (querySnapshot) => {
40 | const defs = querySnapshot.docs.map((doc) => {
41 | return doc.data();
42 | });
43 | setTrending(defs);
44 | },
45 | (err) => {
46 | console.log(err);
47 | }
48 | );
49 | }, []);
50 |
51 | return (
52 | <>
53 |
54 |
55 |
56 | {words.length > 0
57 | ? words.map((val, i) => )
58 | : "Nothing to show here"}
59 |
60 |
61 |
62 |
63 |
64 |
65 | Trending Words
66 |
67 |
68 |
69 |
70 | {trending.map((val) => val.other_language_term)}
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | {/*
79 | setPage(page)}
83 | />
84 | */}
85 | {/* */}
86 |
87 | >
88 | );
89 | }
90 |
91 | export default WordSearch;
92 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/WordSearch/wordSimple.js:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from "react";
2 | import { Typography, Card, Row, Col, Divider, Button } from "antd";
3 | import {
4 | SoundOutlined,
5 | LikeOutlined,
6 | DislikeOutlined,
7 | } from "@ant-design/icons";
8 | // import SelectLang from "../Search/SelectLang";
9 | import SocialShare from "./SocialShare";
10 | // import { useSelector } from "react-redux";
11 | import { useFirestore } from "react-redux-firebase";
12 | const { Title, Text } = Typography;
13 |
14 | function WordSimple(props) {
15 | const firestore = useFirestore();
16 | const {
17 | head_term_id,
18 | likes,
19 | dislikes,
20 | other_language_id,
21 | other_language_def,
22 | other_language_term,
23 | example,
24 | // tags,
25 | createdAt,
26 | user_id,
27 | pronunciation,
28 | } = props.data;
29 |
30 | const [headTerms, setHeadTerms] = useState(undefined);
31 | const [otherLanguages, setOtherLanguages] = useState(undefined);
32 | const [otherLanguage, setOtherLanguage] = useState(undefined);
33 | console.log(props.data);
34 | useEffect(() => {
35 | firestore
36 | .collection("headTerms")
37 | .where("head_term_id", "==", `${head_term_id}`)
38 | .get()
39 | .then((result) => {
40 | result.forEach((doc) => {
41 | console.log(doc.data());
42 | setHeadTerms(doc.data());
43 | });
44 | });
45 | firestore
46 | .collection("languages")
47 | .where("language_id", "==", `${other_language_id}`)
48 | .get()
49 | .then((result) => {
50 | result.forEach((doc) => {
51 | console.log(doc.data());
52 | setOtherLanguage(doc.data());
53 | });
54 | });
55 | firestore
56 | .collection("languages")
57 | .where("language_id", "in", headTerms ? headTerms.available_langs : ["1"])
58 | .get()
59 | .then((result) => {
60 | result.forEach((doc) => {
61 | console.log(doc.data());
62 | setOtherLanguages(doc.data());
63 | });
64 | });
65 | }, []);
66 |
67 | return (
68 |
69 |
70 |
71 | Word of the Day - 13 of June 2020
72 |
73 |
74 |
75 |
76 |
77 |
78 | {headTerms && headTerms.head_term}
79 |
80 |
81 |
82 | {/* {other_language_id} */}
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | {otherLanguage && otherLanguage.language}
91 |
92 | Noun
93 |
94 | new Audio(pronunciation).play()}
96 | style={{ fontSize: "14pt" }}
97 | />
98 |
99 |
100 |
101 | {other_language_term}
102 |
103 |
104 |
105 | {other_language_def}
106 |
107 |
108 | {example}
109 |
110 |
111 | Available language:
112 | {otherLanguages &&
113 | otherLanguages.map((val, i) => (
114 |
118 | {val.language + " "}
119 |
120 | ))}
121 |
122 |
123 |
124 | Created by {user_id} on{" "}
125 | {moment(createdAt).format("dddd, MMMM Do YYYY")}
126 |
127 |
128 |
129 |
130 |
131 |
132 | {likes}
133 |
134 |
135 |
141 |
142 |
143 |
144 | {dislikes}
145 |
146 |
147 |
148 | {/*
149 | Comment
150 | */}
151 |
152 | Report inappropriate
153 |
154 |
155 |
156 |
157 | );
158 | }
159 |
160 | export default WordSimple;
161 |
--------------------------------------------------------------------------------
/com-dict-client/src/components/index.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/components/index.js
--------------------------------------------------------------------------------
/com-dict-client/src/config/index.js:
--------------------------------------------------------------------------------
1 | import firebase from "firebase/app";
2 | import "firebase/auth";
3 | import "firebase/database"; // <- needed if using firebase rtdb
4 | import "firebase/firestore"; // <- needed if using firestore
5 |
6 | console.log(process.env);
7 | const firebaseConfig = {
8 | apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
9 | authDomain: `${process.env.REACT_APP_FIREBASE_PROJECT_ID}.firebaseapp.com`,
10 | databaseURL: `https://${process.env.REACT_APP_FIREBASE_PROJECT_ID}.firebaseio.com`,
11 | projectId: `${process.env.REACT_APP_FIREBASE_PROJECT_ID}`,
12 | storageBucket: `${process.env.REACT_APP_FIREBASE_PROJECT_ID}.appspot.com`,
13 | messagingSenderId: `${process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID}`,
14 | appId: `${process.env.REACT_APP_FIREBASE_APP_ID}`,
15 | };
16 |
17 | // Initialize firebase instance
18 | firebase.initializeApp(firebaseConfig);
19 |
20 | if (window.location.hostname === "localhost") {
21 | firebase.firestore().useEmulator("localhost", 8080);
22 | firebase.auth().useEmulator("http://localhost:9099", {
23 | disableWarnings: true,
24 | });
25 | firebase.database().useEmulator("localhost", 9000);
26 | // firebase.functions().useEmulator("localhost", 5001);
27 | }
28 |
29 | // Initialize other services on firebase instance
30 | // firebase.firestore(); // <- needed if using firestore
31 |
32 | export const auth = firebase.auth();
33 |
34 | export const firestore = firebase.firestore();
35 |
36 | export default firebase;
37 |
--------------------------------------------------------------------------------
/com-dict-client/src/constants/index.js:
--------------------------------------------------------------------------------
1 | export { languages } from "./languages";
2 |
--------------------------------------------------------------------------------
/com-dict-client/src/constants/languages.js:
--------------------------------------------------------------------------------
1 | export const languages = [
2 | "Afrikaans",
3 | "Albanian",
4 | "Arabic",
5 | "Armenian",
6 | "Basque",
7 | "Bengali",
8 | "Bulgarian",
9 | "Catalan",
10 | "Cambodian",
11 | "Chinese (Mandarin)",
12 | "Croatian",
13 | "Czech",
14 | "Danish",
15 | "Dutch",
16 | "English",
17 | "Estonian",
18 | "Fiji",
19 | "Finnish",
20 | "French",
21 | "Georgian",
22 | "German",
23 | "Greek",
24 | "Gujarati",
25 | "Hebrew",
26 | "Hindi",
27 | "Hungarian",
28 | "Icelandic",
29 | "Indonesian",
30 | "Irish",
31 | "Italian",
32 | "Japanese",
33 | "Javanese",
34 | "Korean",
35 | "Latin",
36 | "Latvian",
37 | "Lithuanian",
38 | "Macedonian",
39 | "Malay",
40 | "Malayalam",
41 | "Maltese",
42 | "Maori",
43 | "Marathi",
44 | "Mongolian",
45 | "Nepali",
46 | "Norwegian",
47 | "Persian",
48 | "Polish",
49 | "Portuguese",
50 | "Punjabi",
51 | "Quechua",
52 | "Romanian",
53 | "Russian",
54 | "Samoan",
55 | "Serbian",
56 | "Slovak",
57 | "Slovenian",
58 | "Spanish",
59 | "Swahili",
60 | "Swedish ",
61 | "Tamil",
62 | "Tatar",
63 | "Telugu",
64 | "Thai",
65 | "Tibetan",
66 | "Tonga",
67 | "Turkish",
68 | "Ukrainian",
69 | "Urdu",
70 | "Uzbek",
71 | "Vietnamese",
72 | "Welsh",
73 | "Xhosa",
74 | ];
75 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/App/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/containers/App/App.js:
--------------------------------------------------------------------------------
1 | import React , { Component } from 'react'
2 | import {
3 | BrowserRouter as Router,
4 | Route
5 | } from "react-router-dom"
6 | import './App.css'
7 |
8 |
9 | import HomePage from "../home/home"
10 | import SignUp from "../signup/signup";
11 | import AddWord from "../addWord/addWord";
12 | import categories from "../categories/categories";
13 |
14 | class App extends Component {
15 | render() {
16 | return (
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 | }
26 | }
27 |
28 | export default App;
29 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/App/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render( );
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/addWord/addWord.css:
--------------------------------------------------------------------------------
1 | .submit_btn
2 | {
3 | background-color:#DCD9D9;
4 | width: 40%;
5 | border-radius: 20px;
6 | color:#4CBDD5;
7 | text-align: center;
8 | font-weight: bold;
9 | margin-left: 30%;
10 | margin-right: 30%;
11 | }
12 |
13 | .word_class
14 | {
15 | font-size: small;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/addWord/addWord.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "../home/home.css";
3 | import "./addWord.css";
4 | import { Layout } from "antd";
5 | import TitleBar from "../../components/Header";
6 | import WordForm from "../../components/AddWord";
7 | import FooterPage from "../../components/Footer/FooterPage";
8 |
9 | const { Header, Footer, Content } = Layout;
10 |
11 | function AddWord() {
12 | return (
13 |
14 |
17 |
18 |
19 |
20 |
23 |
24 | );
25 | }
26 |
27 | export default AddWord;
28 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/addWord/addWord.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/addWord/addWord.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/browse/browse.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/browse/browse.css
--------------------------------------------------------------------------------
/com-dict-client/src/containers/browse/browse.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Layout } from "antd";
3 | import TitleBar from "../../components/Header";
4 | import FooterPage from "../../components/Footer/FooterPage";
5 |
6 | // import AlphaIndex from "../../components/AlphaIndex";
7 | const { Header, Footer, Content } = Layout;
8 |
9 | function Browse() {
10 | return (
11 |
12 |
15 | {/* */}
16 |
19 |
20 | );
21 | }
22 |
23 | export default Browse;
24 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/browse/browse.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/browse/browse.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/categories/categories.css:
--------------------------------------------------------------------------------
1 | .cat_title
2 | {
3 | text-align: center;
4 | }
5 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/categories/categories.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Layout } from "antd";
3 | import "./categories.css";
4 | import TitleBar from "../../components/Header";
5 | import FooterPage from "../../components/Footer/FooterPage";
6 | import AllCats from "../../components/Categories";
7 |
8 |
9 |
10 | const { Header, Footer, Content } = Layout;
11 |
12 | function Categories() {
13 | return (
14 |
15 |
18 |
19 |
20 |
21 |
24 |
25 | );
26 | }
27 |
28 | export default Categories;
29 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/categories/categories.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/categories/categories.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/comment/comment.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/comment/comment.css
--------------------------------------------------------------------------------
/com-dict-client/src/containers/comment/comment.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "../home/home.css";
3 | import { Layout } from "antd";
4 | import TitleBar from "../../components/Header";
5 | import Comments from "../../components/Comments";
6 | import FooterPage from "../../components/Footer/FooterPage";
7 |
8 | const { Header, Footer, Content } = Layout;
9 |
10 | function CommentWord(props) {
11 | console.log(props);
12 | return (
13 |
14 |
17 |
18 |
19 |
20 |
23 |
24 | );
25 | }
26 |
27 | export default CommentWord;
28 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/comment/comment.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/comment/comment.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/dictionary/letterDict.css:
--------------------------------------------------------------------------------
1 | .letter_div
2 | {
3 | /* margin-top: 3vmin; */
4 | text-align: center;
5 | /* background-color:black; */
6 | }
7 |
8 |
9 | .word_card
10 | {
11 | /* width:80%; */
12 | /* margin-left:10%; */
13 | /* padding:0px; */
14 |
15 | }
16 |
17 | .word_index
18 | {
19 | /* width:50%; */
20 | /* margin-left:10%; */
21 | /* padding:0px; */
22 | /* margin-top:4%; */
23 |
24 | }
25 |
26 |
27 | .word_title
28 | {
29 | color: #639bb4;
30 | filter: contrast(100%);
31 |
32 | }
33 |
34 |
35 | .language_span
36 | {
37 | font-weight: bold;
38 | background-color: #e7ca52;
39 | padding: 4px;
40 | }
41 |
42 | .type_span
43 | {
44 | font-weight: bold;
45 | background-color: #7dbf94;
46 | padding: 4px;
47 |
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/dictionary/letterDict.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "../home/home.css";
3 | import "./letterDict.css";
4 | import { Layout } from "antd";
5 | import TitleBar from "../../components/Header";
6 | // import LetterHead from "../../components/WordAlpabatical/letterHead";
7 | import AlphaIndex from "../../components/WordAlpabatical";
8 | import FooterPage from "../../components/Footer/FooterPage";
9 | // import Word from "../../components/dictionaryView/word_dict";
10 |
11 | const { Header, Footer, Content } = Layout;
12 |
13 | function LetterBased(props) {
14 | const activeKey =
15 | props.history.location.state && props.history.location.state.activeKey;
16 | return (
17 |
18 |
21 |
22 |
23 |
24 |
27 |
28 | );
29 | }
30 |
31 | export default LetterBased;
32 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/dictionary/letterDict.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/dictionary/letterDict.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/home/arrow.css:
--------------------------------------------------------------------------------
1 | .arrows {
2 | position: relative;
3 | width: 12vmin;
4 | height: 12vmin;
5 | transform: translate(-50%, -50%);
6 | }
7 |
8 | .arrows:before {
9 | content: '';
10 | position: absolute;
11 | margin-top: 10vmin;
12 | width: 100%;
13 | height: 100%;
14 | border-left: 26.66667px solid rgba(0, 0, 0, 0.7);
15 | border-bottom: 26.66667px solid rgba(0, 0, 0, 0.7);
16 | transform: translate(26.66667px, 106.66667px) rotate(-45deg);
17 | animation: arrows 2s linear infinite;
18 | }
19 |
20 | .arrows:after {
21 | content: '';
22 | position: absolute;
23 | margin-top: 10vmin;
24 | width: 100%;
25 | height: 100%;
26 | border-left: 26.66667px solid rgba(0, 0, 0, 0.7);
27 | border-bottom: 26.66667px solid rgba(0, 0, 0, 0.7);
28 | transform: translate(53.33333px, 0px) rotate(-45deg);
29 | animation: arrows 2s linear infinite -1s;
30 | }
31 |
32 | @keyframes arrows {
33 | 0% {
34 | border-left: 26.66667px solid transparent;
35 | border-bottom: 26.66667px solid transparent;
36 | transform: translate(-13.33333px, -53.33333px) rotate(-45deg);
37 | }
38 | 10%, 90% {
39 | border-left: 26.66667px solid transparent;
40 | border-bottom: 26.66667px solid transparent;
41 | }
42 | 50% {
43 | border-left: 26.66667px solid rgba(0, 0, 0, 0.7);
44 | border-bottom: 26.66667px solid rgba(0, 0, 0, 0.7);
45 | transform: translate(-13.33333px, 0px) rotate(-45deg);
46 | }
47 | 100% {
48 | border-left: 26.66667px solid transparent;
49 | border-bottom: 26.66667px solid transparent;
50 | transform: translate(-13.33333px, 53.33333px) rotate(-45deg);
51 | }
52 | }
53 |
54 | #rotate-text {
55 | padding-top: 20vmin;
56 | margin-left: -30vmin;
57 | line-height: 2vmin;
58 | width: 40vmin;
59 | /* display:block; */
60 | transform: rotate(-90deg);
61 | transform: rotate(-90deg);
62 | }
63 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/home/footer.css:
--------------------------------------------------------------------------------
1 | /* .footer
2 | {
3 | /* background-color: transparent; */
4 | /* text-align: center; */
5 | /* height: 4vmin; */
6 | /* } */ */
7 |
8 | .footer {
9 | border-top: 1px solid;
10 | /* clear: both; */
11 | /* font-size: 16px; */
12 | background-color : black;
13 | position: relative;
14 | z-index: 100;
15 | /* box-shadow: 0 1000px 0 1000px #fff; */
16 | text-align: left;
17 | /* color: black; */
18 |
19 | }
20 |
21 | .footer-wrap
22 | {
23 | display: grid;
24 | background-color :transparent;
25 | width:100%;
26 | }
27 |
28 | .footer-center {
29 | /* display: inline-block; */
30 | display:inline;
31 | text-align: left;
32 | justify-content: center;
33 | font-size: medium;
34 | }
35 |
36 | .bottom-bar
37 | {
38 | text-align: center;
39 | font-weight: bold;
40 | }
41 |
42 | .link
43 | {
44 | color:black;
45 | }
--------------------------------------------------------------------------------
/com-dict-client/src/containers/home/home.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css?family=Montserrat');
2 |
3 | .body
4 | {
5 | padding-top: 6vmin;
6 | /* background-color: #e9e9e9; */
7 | background-color: white;
8 | padding-bottom: 8vmin;
9 | font-family: 'Montserrat';
10 | }
11 |
12 | .title_bar
13 | {
14 | background-color:#f2f2f2 !important;
15 | padding-top: 1vmin;
16 | padding-bottom: 1.5vmin;
17 | position: 'fixed';
18 | z-index: 100;
19 | width: 100%;
20 | height: 100%;
21 | font-family: 'Montserrat';
22 | }
23 |
24 |
25 | .title
26 | {
27 | /* float: left;
28 | resize: both; */
29 | max-width: 100%;
30 | background-color: #f2f2f2 !important;
31 | max-height: 100vh;
32 | width:100% !important;
33 | height: 100% !important;
34 | /* display: grid; */
35 |
36 | }
37 |
38 | #date-rotate
39 | {
40 |
41 | display: block;
42 | transform: rotate(270deg);
43 | line-height: 8vh;
44 | width: 50vh;
45 | text-align: center;
46 | margin-left: -20vmin;
47 | margin-top: 14vmin;
48 |
49 | /* background-color: aquamarine; */
50 |
51 | }
52 |
53 |
54 | .navbar
55 | {
56 | align-self: stretch;
57 | background-color: transparent;
58 | border: none;
59 | font-size: large;
60 | font-weight: bold;
61 | /* height: 20vmin; */
62 | text-align: right;
63 | /* float: right; */
64 | display:block;
65 | }
66 |
67 |
68 | .search_word
69 | {
70 | float: right;
71 | }
72 |
73 |
74 | .search_text
75 | {
76 | /* border: solid gray; */
77 | float: left;
78 | }
79 |
80 |
81 | .word_index
82 | {
83 | background-color:white;
84 | color: black;
85 | /* border-color: #A9A9A9; */
86 | padding-top: 2vmin;
87 | margin-top: 4vmin;
88 | border-width: 2vmin;
89 | border-color: #639bb4;
90 | }
91 |
92 | .search_style
93 | {
94 | font-size: small;
95 | outline: none;
96 | float:left;
97 | width: calc(100%);
98 | /* background-color: black; */
99 | height: auto;
100 | }
101 |
102 | /* .ant-input-search .search_style
103 | {
104 | background-color: turquoise;
105 | } */
106 |
107 | .select_style
108 | {
109 | float: right;
110 | font-size: large;
111 | width:auto;
112 |
113 | }
114 |
115 | .trending
116 | {
117 | /* text-align: center; */
118 | width: 100%;
119 | }
120 |
121 | .social_btn
122 | {
123 | width: 18vmin;
124 | color: white;
125 | }
126 |
127 |
128 | .login-form {
129 | align-self: center;
130 | }
131 | .login-form-forgot {
132 | float: right;
133 | }
134 | .ant-col-rtl .login-form-forgot {
135 | float: left;
136 | }
137 |
138 | .login-form-button {
139 | width: 100%;
140 | }
141 |
142 |
143 | .icons8-customer {
144 | vertical-align: middle;
145 | display: inline-block;
146 | margin: 0;
147 | padding: 0;
148 | width: 40px;
149 | height: 40px;
150 | background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjBweCIgeT0iMHB4Igp3aWR0aD0iNDgiIGhlaWdodD0iNDgiCnZpZXdCb3g9IjAgMCAxNzIgMTcyIgpzdHlsZT0iIGZpbGw6IzAwMDAwMDsiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIHN0cm9rZS1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjAiIGZvbnQtZmFtaWx5PSJub25lIiBmb250LXdlaWdodD0ibm9uZSIgZm9udC1zaXplPSJub25lIiB0ZXh0LWFuY2hvcj0ibm9uZSIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBub3JtYWwiPjxwYXRoIGQ9Ik0wLDE3MnYtMTcyaDE3MnYxNzJ6IiBmaWxsPSJub25lIj48L3BhdGg+PGcgZmlsbD0iI2NhNmI2NyI+PHBhdGggZD0iTTExOC4yNSw1MC4xNjY2N2MwLDE3LjkxNjY3IC0xNC4zMzMzMywzMi4yNSAtMzIuMjUsMzIuMjVjLTE3LjkxNjY3LDAgLTMyLjI1LC0xNC4zMzMzMyAtMzIuMjUsLTMyLjI1YzAsLTE3LjkxNjY3IDE0LjMzMzMzLC0zMi4yNSAzMi4yNSwtMzIuMjVjMTcuOTE2NjcsMCAzMi4yNSwxNC4zMzMzMyAzMi4yNSwzMi4yNSI+PC9wYXRoPjxwYXRoIGQ9Ik0xNTAuNSwxMjkuMzU4MzNjMCwwIC0xNy45MTY2NywtMzYuMTkxNjcgLTY0LjUsLTM2LjE5MTY3Yy00Ni41ODMzMywwIC02NC41LDM2LjE5MTY3IC02NC41LDM2LjE5MTY3djIxLjE0MTY3aDEyOXoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==') 50% 50% no-repeat;
151 | background-size: 100%; }
152 |
153 |
154 | .icons8-add {
155 | vertical-align: middle;
156 | display: inline-block;
157 | margin: 0;
158 | padding: 0;
159 | width: 40px;
160 | height: 40px;
161 | background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjBweCIgeT0iMHB4Igp3aWR0aD0iNDgiIGhlaWdodD0iNDgiCnZpZXdCb3g9IjAgMCAxNzIgMTcyIgpzdHlsZT0iIGZpbGw6IzAwMDAwMDsiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0ibm9uemVybyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIHN0cm9rZS1saW5lY2FwPSJidXR0IiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1kYXNoYXJyYXk9IiIgc3Ryb2tlLWRhc2hvZmZzZXQ9IjAiIGZvbnQtZmFtaWx5PSJub25lIiBmb250LXdlaWdodD0ibm9uZSIgZm9udC1zaXplPSJub25lIiB0ZXh0LWFuY2hvcj0ibm9uZSIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBub3JtYWwiPjxwYXRoIGQ9Ik0wLDE3MnYtMTcyaDE3MnYxNzJ6IiBmaWxsPSJub25lIj48L3BhdGg+PGc+PHBhdGggZD0iTTE1Ny42NjY2Nyw4NmMwLDM5LjU3NzkyIC0zMi4wODg3NSw3MS42NjY2NyAtNzEuNjY2NjcsNzEuNjY2NjdjLTM5LjU3NzkyLDAgLTcxLjY2NjY3LC0zMi4wODg3NSAtNzEuNjY2NjcsLTcxLjY2NjY3YzAsLTM5LjU3NzkyIDMyLjA4ODc1LC03MS42NjY2NyA3MS42NjY2NywtNzEuNjY2NjdjMzkuNTc3OTIsMCA3MS42NjY2NywzMi4wODg3NSA3MS42NjY2Nyw3MS42NjY2N3oiIGZpbGw9IiNjYTZiNjciPjwvcGF0aD48cGF0aCBkPSJNNzguODMzMzMsNTMuNzVoMTQuMzMzMzN2NjQuNWgtMTQuMzMzMzN6IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PHBhdGggZD0iTTUzLjc1LDc4LjgzMzMzaDY0LjV2MTQuMzMzMzNoLTY0LjV6IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9nPjwvZz48L3N2Zz4=') 50% 50% no-repeat;
162 | background-size: 100%; }
163 |
164 | .ant-carousel .slick-slide {
165 | text-align: center;
166 | height: 12vmin;
167 | line-height: 6vmin;
168 | background: white;
169 | overflow: hidden;
170 | }
171 |
172 | .ant-carousel .slick-slide h2 {
173 | color:#639bb4;
174 | background-color: #f2f2f2;
175 | }
176 |
177 | .index_home
178 | {
179 | position: relative;
180 | margin-top: 2vmin;
181 | width:80%;
182 | margin-left: 10%;
183 | color :#df815a;
184 |
185 | }
186 |
187 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/home/home.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "./home.css";
3 | import "./arrow.css";
4 | import { Layout } from "antd";
5 | import TitleBar from "../../components/Header";
6 | import WordHome from "../../components/WordHome";
7 | import FooterPage from "../../components/Footer/FooterPage";
8 |
9 | const { Header, Footer, Content } = Layout;
10 |
11 | function HomePage() {
12 | return (
13 |
14 |
17 |
18 |
19 |
20 |
23 |
24 | );
25 | }
26 |
27 | export default HomePage;
28 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/home/home.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/home/home.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/index.js:
--------------------------------------------------------------------------------
1 | import App from "./App/App";
2 | export default App;
3 | // export default nof;
4 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/reportWord/reportWord.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/reportWord/reportWord.css
--------------------------------------------------------------------------------
/com-dict-client/src/containers/reportWord/reportWord.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "../home/home.css";
3 | import { Layout } from "antd";
4 | import TitleBar from "../../components/Header";
5 | import FlagWord from "../../components/Flag";
6 | import FooterPage from "../../components/Footer/FooterPage";
7 |
8 | const { Header, Footer, Content } = Layout;
9 |
10 | function reportWord(props) {
11 | return (
12 |
13 |
16 |
17 |
18 |
19 |
22 |
23 | );
24 | }
25 |
26 | export default reportWord;
27 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/reportWord/reportWord.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/reportWord/reportWord.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/search/footer.css:
--------------------------------------------------------------------------------
1 | /* .footer
2 | {
3 | /* background-color: transparent; */
4 | /* text-align: center; */
5 | /* height: 4vmin; */
6 | /* } */ */
7 |
8 | .footer {
9 | border-top: 1px solid;
10 | /* clear: both; */
11 | /* font-size: 16px; */
12 | background-color : black;
13 | position: relative;
14 | z-index: 100;
15 | /* box-shadow: 0 1000px 0 1000px #fff; */
16 | text-align: left;
17 | /* color: black; */
18 |
19 | }
20 |
21 | .footer-wrap
22 | {
23 | display: grid;
24 | background-color :transparent;
25 | width:100%;
26 | }
27 |
28 | .footer-center {
29 | /* display: inline-block; */
30 | display:inline;
31 | text-align: left;
32 | justify-content: center;
33 | font-size: medium;
34 | }
35 |
36 | .bottom-bar
37 | {
38 | text-align: center;
39 | font-weight: bold;
40 | }
41 |
42 | .link
43 | {
44 | color:black;
45 | }
--------------------------------------------------------------------------------
/com-dict-client/src/containers/search/home.css:
--------------------------------------------------------------------------------
1 | .body
2 | {
3 | padding-top: 6vmin;
4 | background-color: white;
5 | padding-bottom: 8vmin;
6 | }
7 |
8 | .title_bar
9 | {
10 | background-color: white ;
11 | padding-top: 1vmin;
12 | padding-bottom: 1vmin;
13 | position: 'fixed';
14 | z-index: 1;
15 | width: '100%';
16 | height: 100%;
17 |
18 | }
19 |
20 |
21 | .title
22 | {
23 | width:80%;
24 | height: 6vmin;
25 | background-color: #d8ab4e;
26 | float: left;
27 | font-size: x-large;
28 | }
29 |
30 |
31 | .navbar
32 | {
33 | background-color: transparent;
34 | border: none;
35 | font-size: large;
36 | /* height: 20vmin; */
37 | text-align: right;
38 | /* float: right; */
39 | }
40 |
41 |
42 |
43 | .search_word
44 | {
45 | float: right;
46 | }
47 |
48 |
49 | .search_text
50 | {
51 | border: solid gray;
52 | float: left;
53 | }
54 |
55 | .index
56 | {
57 | position: relative;
58 | margin-top: 8vmin;
59 | width:80%;
60 | margin-left: 10%;
61 | color : #12aad4;
62 |
63 | }
64 |
65 | .day
66 | {
67 | border: none;
68 | margin-top: 2vmin;
69 | margin-left: 14vmin;
70 | }
71 |
72 | .new_card
73 | {
74 | width:60%;
75 | margin-right: 20%;
76 | margin-left: 20%;
77 | }
78 |
79 | .search_style
80 | {
81 | border : 0px 0px 0px 1px;
82 | font-size: large;
83 | width:100%;
84 | /* background-color: transparent; */
85 | }
86 |
87 |
88 | .select_style
89 | {
90 | float: right;
91 | font-size: medium;
92 |
93 | }
94 |
95 | .trending
96 | {
97 | /* text-align: center; */
98 | width: 100%;
99 | }
100 |
101 | .social_btn
102 | {
103 | width: 18vmin;
104 | color: white;
105 | }
106 |
107 |
108 | .login-form {
109 | align-self: center;
110 | }
111 | .login-form-forgot {
112 | float: right;
113 | }
114 | .ant-col-rtl .login-form-forgot {
115 | float: left;
116 | }
117 |
118 | .login-form-button {
119 | width: 100%;
120 | }
--------------------------------------------------------------------------------
/com-dict-client/src/containers/search/search.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "./home.css";
3 | import { Layout } from "antd";
4 | import TitleBar from "../../components/Header";
5 | import FooterPage from "../../components/Footer/FooterPage";
6 | import FullTextSearch from "../../components/Search";
7 | const { Header, Footer, Content } = Layout;
8 |
9 | function HomePage(props) {
10 | console.log(props);
11 | return (
12 |
13 |
16 |
17 |
18 |
19 |
22 |
23 | );
24 | }
25 |
26 | export default HomePage;
27 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/search/search.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/search/search.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/containers/signup/signup.css:
--------------------------------------------------------------------------------
1 | .register-form-button {
2 | width: 60%;
3 | }
--------------------------------------------------------------------------------
/com-dict-client/src/containers/signup/signup.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import "../home/home.css";
3 | import "./signup.css";
4 | import { Layout } from "antd";
5 | import TitleBar from "../../components/Header";
6 | import Signup from "../../components/Signup/SignUp";
7 | import FooterPage from "../../components/Footer/FooterPage";
8 |
9 | const { Header, Footer, Content } = Layout;
10 |
11 | function SignUp() {
12 | return (
13 |
14 |
17 |
18 |
19 |
20 |
23 |
24 | );
25 | }
26 |
27 | export default SignUp;
28 |
--------------------------------------------------------------------------------
/com-dict-client/src/containers/signup/signup.test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/containers/signup/signup.test.js
--------------------------------------------------------------------------------
/com-dict-client/src/functions/index.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/functions/index.js
--------------------------------------------------------------------------------
/com-dict-client/src/helpers/readme.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/helpers/readme.txt
--------------------------------------------------------------------------------
/com-dict-client/src/images/frontdesk.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/frontdesk.jpg
--------------------------------------------------------------------------------
/com-dict-client/src/images/icons/icons8-male-user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/icons/icons8-male-user.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/lisa.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/lisa.gif
--------------------------------------------------------------------------------
/com-dict-client/src/images/login.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/login.jpg
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/cover.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/default.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/logo.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/logo192.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/logo_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/logo_2.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/logo_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/logo_new.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/logo/profile.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/default-monochrome-black.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/default-monochrome-white.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/default-monochrome.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/default.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/isolated-layout.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/isolated-monochrome-black.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/logo/vector/isolated-monochrome-white.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-add-word.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-add-word.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-addWord.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-addWord.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-chat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-chat.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-education.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-education.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-food.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-food.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-game.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-internet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-internet.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-music.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-nature.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-nature.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-politics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-politics.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-religion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-religion.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-school.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-school.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-sign-in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-sign-in.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-sign-up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-sign-up.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-sports.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-sports.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-word-remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-word-remove.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/pablo-work.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/pablo-work.png
--------------------------------------------------------------------------------
/com-dict-client/src/images/register.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/images/register.gif
--------------------------------------------------------------------------------
/com-dict-client/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/com-dict-client/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import "./index.css";
4 | import App from "./App";
5 | import * as serviceWorker from "./serviceWorker";
6 | import store, { rrfProps } from "./store";
7 | import { ReactReduxFirebaseProvider } from "react-redux-firebase";
8 | import { Provider } from "react-redux";
9 | // import { useSelector } from "react-redux";
10 | // import { isLoaded } from "react-redux-firebase";
11 |
12 | // function AuthIsLoaded({ children }) {
13 | // const auth = useSelector((state) => state.firebase.auth);
14 | // if (!isLoaded(auth)) return splash screen...
;
15 | // return children;
16 | // }
17 |
18 | ReactDOM.render(
19 |
20 |
21 |
22 |
23 | ,
24 | document.getElementById("root")
25 | );
26 |
27 | // If you want your app to work offline and load faster, you can change
28 | // unregister() to register() below. Note this comes with some pitfalls.
29 | // Learn more about service workers: https://bit.ly/CRA-PWA
30 | serviceWorker.unregister();
31 |
--------------------------------------------------------------------------------
/com-dict-client/src/routes.js:
--------------------------------------------------------------------------------
1 | // App routes
2 | import React from "react";
3 | import { BrowserRouter as Router, Route, Redirect } from "react-router-dom";
4 | import HomePage from "./containers/home/home";
5 | import SignUp from "./containers/signup/signup";
6 | import AddWord from "./containers/addWord/addWord";
7 | import LetterBased from "./containers/dictionary/letterDict";
8 | import Browse from "./containers/browse/browse";
9 | import Categories from "./containers/categories/categories";
10 | import CommentWord from "./containers/comment/comment";
11 | import Report from "./containers/reportWord/reportWord";
12 | import Search from "./containers/search/search";
13 | import { useSelector } from "react-redux";
14 | // import { auth } from "./config";
15 |
16 | export default function Routes() {
17 | return (
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | );
32 | }
33 |
34 | function PrivateRoute({ children, ...rest }) {
35 | const auth = useSelector((state) => state.firebase.auth); // isLoaded(auth) && !isEmpty(auth)
36 | console.log(auth);
37 | return (
38 |
41 | auth.uid ? (
42 | children
43 | ) : (
44 |
50 | )
51 | }
52 | />
53 | );
54 | }
55 |
--------------------------------------------------------------------------------
/com-dict-client/src/serviceWorker.js:
--------------------------------------------------------------------------------
1 | // This optional code is used to register a service worker.
2 | // register() is not called by default.
3 |
4 | // This lets the app load faster on subsequent visits in production, and gives
5 | // it offline capabilities. However, it also means that developers (and users)
6 | // will only see deployed updates on subsequent visits to a page, after all the
7 | // existing tabs open on the page have been closed, since previously cached
8 | // resources are updated in the background.
9 |
10 | // To learn more about the benefits of this model and instructions on how to
11 | // opt-in, read https://bit.ly/CRA-PWA
12 |
13 | const isLocalhost = Boolean(
14 | window.location.hostname === 'localhost' ||
15 | // [::1] is the IPv6 localhost address.
16 | window.location.hostname === '[::1]' ||
17 | // 127.0.0.0/8 are considered localhost for IPv4.
18 | window.location.hostname.match(
19 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
20 | )
21 | );
22 |
23 | export function register(config) {
24 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
25 | // The URL constructor is available in all browsers that support SW.
26 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
27 | if (publicUrl.origin !== window.location.origin) {
28 | // Our service worker won't work if PUBLIC_URL is on a different origin
29 | // from what our page is served on. This might happen if a CDN is used to
30 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
31 | return;
32 | }
33 |
34 | window.addEventListener('load', () => {
35 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
36 |
37 | if (isLocalhost) {
38 | // This is running on localhost. Let's check if a service worker still exists or not.
39 | checkValidServiceWorker(swUrl, config);
40 |
41 | // Add some additional logging to localhost, pointing developers to the
42 | // service worker/PWA documentation.
43 | navigator.serviceWorker.ready.then(() => {
44 | console.log(
45 | 'This web app is being served cache-first by a service ' +
46 | 'worker. To learn more, visit https://bit.ly/CRA-PWA'
47 | );
48 | });
49 | } else {
50 | // Is not localhost. Just register service worker
51 | registerValidSW(swUrl, config);
52 | }
53 | });
54 | }
55 | }
56 |
57 | function registerValidSW(swUrl, config) {
58 | navigator.serviceWorker
59 | .register(swUrl)
60 | .then(registration => {
61 | registration.onupdatefound = () => {
62 | const installingWorker = registration.installing;
63 | if (installingWorker == null) {
64 | return;
65 | }
66 | installingWorker.onstatechange = () => {
67 | if (installingWorker.state === 'installed') {
68 | if (navigator.serviceWorker.controller) {
69 | // At this point, the updated precached content has been fetched,
70 | // but the previous service worker will still serve the older
71 | // content until all client tabs are closed.
72 | console.log(
73 | 'New content is available and will be used when all ' +
74 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
75 | );
76 |
77 | // Execute callback
78 | if (config && config.onUpdate) {
79 | config.onUpdate(registration);
80 | }
81 | } else {
82 | // At this point, everything has been precached.
83 | // It's the perfect time to display a
84 | // "Content is cached for offline use." message.
85 | console.log('Content is cached for offline use.');
86 |
87 | // Execute callback
88 | if (config && config.onSuccess) {
89 | config.onSuccess(registration);
90 | }
91 | }
92 | }
93 | };
94 | };
95 | })
96 | .catch(error => {
97 | console.error('Error during service worker registration:', error);
98 | });
99 | }
100 |
101 | function checkValidServiceWorker(swUrl, config) {
102 | // Check if the service worker can be found. If it can't reload the page.
103 | fetch(swUrl, {
104 | headers: { 'Service-Worker': 'script' },
105 | })
106 | .then(response => {
107 | // Ensure service worker exists, and that we really are getting a JS file.
108 | const contentType = response.headers.get('content-type');
109 | if (
110 | response.status === 404 ||
111 | (contentType != null && contentType.indexOf('javascript') === -1)
112 | ) {
113 | // No service worker found. Probably a different app. Reload the page.
114 | navigator.serviceWorker.ready.then(registration => {
115 | registration.unregister().then(() => {
116 | window.location.reload();
117 | });
118 | });
119 | } else {
120 | // Service worker found. Proceed as normal.
121 | registerValidSW(swUrl, config);
122 | }
123 | })
124 | .catch(() => {
125 | console.log(
126 | 'No internet connection found. App is running in offline mode.'
127 | );
128 | });
129 | }
130 |
131 | export function unregister() {
132 | if ('serviceWorker' in navigator) {
133 | navigator.serviceWorker.ready
134 | .then(registration => {
135 | registration.unregister();
136 | })
137 | .catch(error => {
138 | console.error(error.message);
139 | });
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/com-dict-client/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/actions/actionTypes.js:
--------------------------------------------------------------------------------
1 | export const ADD_WORD_START = "ADD_WORD_START";
2 | export const ADD_WORD_SUCCESS = "ADD_WORD_SUCCESS";
3 | export const ADD_WORD_ERROR = "ADD_WORD_ERROR";
4 |
5 | export const ADD_COMMENT_START = "ADD_COMMENT_START";
6 | export const ADD_COMMENT_SUCCESS = "ADD_COMMENT_START";
7 | export const ADD_COMMENT_ERROR = "ADD_COMMENT_START";
8 |
9 | export const REPORT_WORD_START = "REPORT_WORD_START";
10 | export const REPORT_WORD_SUCCESS = "REPORT_WORD_SUCCESS";
11 | export const REPORT_WORD_ERROR = "REPORT_WORD_ERROR";
12 |
13 | export const SEARCH_WORD_START = "SEARCH_WORD_START";
14 | export const SEARCH_WORD_SUCCESS = "SEARCH_WORD_SUCCESS";
15 | export const SEARCH_WORD_ERROR = "SEARCH_WORD_ERROR";
16 |
17 | export const ADD_WORD_PRONUNCIATION_START = "ADD_WORD_PRONUNCIATION_START";
18 | export const ADD_WORD_PRONUNCIATION_SUCCESS = "ADD_WORD_PRONUNCIATION_SUCCESS";
19 | export const ADD_WORD_PRONUNCIATION_ERROR = "ADD_WORD_PRONUNCIATION_ERROR";
20 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/actions/authActions.js:
--------------------------------------------------------------------------------
1 | import { message } from "antd";
2 | export const signIn = (credentials) => async (firebase, history) => {
3 | try {
4 | await firebase.login(credentials);
5 | console.log("Success");
6 | message.success("Login success");
7 | history.goBack();
8 | } catch (e) {
9 | console.log(e.message);
10 | }
11 | };
12 |
13 | export const signInWithGoogle = () => async (firebase, history) => {
14 | try {
15 | await firebase.login({
16 | provider: "google",
17 | type: "popup",
18 | });
19 | console.log("Success");
20 | message.success("Login success");
21 | history.goBack();
22 | } catch (e) {
23 | console.log(e.message);
24 | }
25 | };
26 |
27 | export const signInWithProviderID = (providerID) => async (
28 | firebase,
29 | history
30 | ) => {
31 | try {
32 | if (!["github", "twitter", "facebook"].includes(providerID)) {
33 | return;
34 | }
35 | await firebase.login({
36 | provider: providerID,
37 | type: "popup",
38 | });
39 | message.success("Login success");
40 | } catch (e) {
41 | if (e.code === "auth/account-exists-with-different-credential") {
42 | // const methods = await firebase.auth().fetchSignInMethodsForEmail(e.email);
43 | console.log(e);
44 | message.error(e.message);
45 | } else {
46 | // dispatch({ type: actions.SIGN_IN_FAIL, payload: e });
47 | }
48 | }
49 | };
50 |
51 | export const signOut = () => async (firebase, history) => {
52 | try {
53 | await firebase.logout();
54 | history.push("/");
55 | } catch (e) {
56 | console.log(e.message);
57 | }
58 | };
59 |
60 | export const createNewUser = (email, password, username) => async (
61 | firebase,
62 | history
63 | ) => {
64 | try {
65 | console.log(email, password, username);
66 | await firebase.createUser({ email, password }, { username, email });
67 | history.goBack();
68 | console.log(history);
69 | message.success("User registraion successfull!");
70 | } catch (e) {
71 | console.log(e.message);
72 | alert(e.message);
73 | return e.message;
74 | }
75 | };
76 |
77 | export const addNewUser = (user) => async (firestore, history) => {
78 | try {
79 | const { email, username, phone_number } = user;
80 | await firestore.add("users", { email, username, phone_number });
81 | console.log("success");
82 | message.success("User registraion successfull!");
83 | } catch (e) {
84 | console.log(e.message);
85 | }
86 | };
87 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/actions/commentActions.js:
--------------------------------------------------------------------------------
1 | export const addComment = (comment) => async (firestore) => {
2 | try {
3 | await firestore.add("comments", comment);
4 | console.log("success");
5 | } catch (e) {
6 | console.log(e.message);
7 | }
8 | };
9 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/actions/headTerm.js:
--------------------------------------------------------------------------------
1 | import { message } from "antd";
2 |
3 | export const addHeadTerm = (term) => async (firestore, callback) => {
4 | try {
5 | await firestore.add("headTerms", term);
6 | callback(term.head_term);
7 | message.success("Head term added");
8 | console.log("success");
9 | } catch (e) {
10 | console.log(e.message);
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/actions/index.js:
--------------------------------------------------------------------------------
1 | export {
2 | signIn,
3 | signOut,
4 | createNewUser,
5 | addNewUser,
6 | signInWithGoogle,
7 | signInWithProviderID,
8 | } from "./authActions";
9 | export {
10 | addWord,
11 | updateWord,
12 | getWords,
13 | addReport,
14 | addLikes,
15 | addDislikes,
16 | deleteDislikes,
17 | deleteLikes,
18 | } from "./wordActions";
19 | export { addComment } from "./commentActions";
20 | export { addHeadTerm } from "./headTerm";
21 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/actions/wordActions.js:
--------------------------------------------------------------------------------
1 | import { message } from "antd";
2 | export const addWord = (definition) => async (firestore) => {
3 | try {
4 | await firestore.add("definitions", definition);
5 | console.log("success");
6 | message.success("Definition added");
7 | } catch (e) {
8 | console.log(e.message);
9 | }
10 | };
11 |
12 | export const addLikes = (like) => async (firestore) => {
13 | try {
14 | await firestore.add("likes", like);
15 | console.log("success");
16 | } catch (e) {
17 | console.log(e.message);
18 | }
19 | };
20 |
21 | export const addDislikes = (like) => async (firestore) => {
22 | try {
23 | await firestore.add("dislikes", like);
24 | console.log("success");
25 | } catch (e) {
26 | console.log(e.message);
27 | }
28 | };
29 |
30 | export const addReport = (report) => async (firestore, history) => {
31 | try {
32 | await firestore.add("reports", report);
33 | console.log("success");
34 | message.success("Definition reported");
35 | history.push("/");
36 | } catch (e) {
37 | console.log(e.message);
38 | }
39 | };
40 |
41 | export const getWords = (start, size) => async (firestore) => {
42 | try {
43 | return await firestore.get({
44 | collection: "definitions",
45 | orderBy: "createdAt",
46 | startAfter: start,
47 | limit: size,
48 | });
49 | } catch (e) {
50 | console.log(e.message);
51 | }
52 | };
53 |
54 | export const updateWord = (key, data) => async (firestore) => {
55 | try {
56 | await firestore.update({ collection: "definitions", doc: key }, data);
57 | console.log("success");
58 | } catch (e) {
59 | console.log(e.message);
60 | }
61 | };
62 |
63 | export const deleteLikes = (key) => async (firestore) => {
64 | try {
65 | await firestore.delete({ collection: "likes", doc: key });
66 | console.log("success");
67 | } catch (e) {
68 | console.log(e.message);
69 | }
70 | };
71 |
72 | export const deleteDislikes = (key) => async (firestore) => {
73 | try {
74 | await firestore.delete({ collection: "dislikes", doc: key });
75 | console.log("success");
76 | } catch (e) {
77 | console.log(e.message);
78 | }
79 | };
80 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/index.js:
--------------------------------------------------------------------------------
1 | import { createStore, applyMiddleware, compose } from "redux";
2 | import { getFirebase } from "react-redux-firebase";
3 | import { createFirestoreInstance, getFirestore } from "redux-firestore";
4 |
5 | import thunk from "redux-thunk";
6 |
7 | import rootReducer from "./reducers";
8 |
9 | import firebase from "../config";
10 |
11 | // react-redux-firebase config
12 | const rrfConfig = {
13 | userProfile: "users",
14 | useFirestoreForProfile: true, // Firestore for Profile instead of Realtime
15 | attachAuthIsReady: true,
16 | };
17 |
18 | // Create store with reducers and initial state
19 | const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
20 |
21 | const initialState = {};
22 | const store = createStore(
23 | rootReducer,
24 | initialState,
25 | composeEnhancers(
26 | applyMiddleware(thunk.withExtraArgument({ getFirebase, getFirestore }))
27 | )
28 | );
29 |
30 | export const rrfProps = {
31 | firebase,
32 | config: rrfConfig,
33 | dispatch: store.dispatch,
34 | createFirestoreInstance, // <- needed if using firestore
35 | };
36 |
37 | export default store;
38 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from "redux";
2 | import { firebaseReducer } from "react-redux-firebase";
3 | import { firestoreReducer } from "redux-firestore";
4 |
5 | import wordReducer from "./wordReducer";
6 | // Add firebase to reducers
7 | const rootReducer = combineReducers({
8 | firebase: firebaseReducer,
9 | firestore: firestoreReducer, // <- needed if using firestore
10 | words: wordReducer,
11 | });
12 |
13 | export default rootReducer;
14 |
--------------------------------------------------------------------------------
/com-dict-client/src/store/reducers/wordReducer.js:
--------------------------------------------------------------------------------
1 | import * as actions from "../actions/actionTypes";
2 |
3 | const initialState = {
4 | addWord: {
5 | loading: false,
6 | error: null,
7 | },
8 | };
9 |
10 | export default (state = initialState, { type, payload }) => {
11 | switch (type) {
12 | case actions.ADD_WORD_START:
13 | return {
14 | ...state,
15 | addItem: {
16 | ...state.addItem,
17 | loading: true,
18 | },
19 | };
20 |
21 | case actions.ADD_WORD_SUCCESS:
22 | return {
23 | ...state,
24 | addItem: {
25 | ...state.addItem,
26 | loading: false,
27 | error: false,
28 | },
29 | };
30 |
31 | case actions.ADD_WORD_ERROR:
32 | return {
33 | ...state,
34 | addItem: {
35 | ...state.addItem,
36 | loading: false,
37 | error: payload,
38 | },
39 | };
40 | default:
41 | return state;
42 | }
43 | };
44 |
--------------------------------------------------------------------------------
/com-dict-client/src/utils.js/dataLoader.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scorelab/com-dictionary/a4d123e95d5f8b6d80f5032104063fa6dff1d4e0/com-dict-client/src/utils.js/dataLoader.js
--------------------------------------------------------------------------------
/com-dict-client/src/utils.js/toTitleCase.js:
--------------------------------------------------------------------------------
1 | export function toTitleCase(str) {
2 | return str.replace(/\w\S*/g, function (txt) {
3 | return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
4 | });
5 | }
6 |
--------------------------------------------------------------------------------
/local-firebase-emulators-import-export.md:
--------------------------------------------------------------------------------
1 | # Start up Emulators
2 | #### The Emulators can be start based on the user preferences:-
3 | **NOTE**:- To Run the webpage First you need to start Emulators to load the Database You can start the emulators in different mode.
4 | ### **Initial Start**
5 | - To Start all the emulators at a time we can use the command `firebase emulators:start`
6 |
7 | 
8 |
9 | ### **Start Particular Emulator**
10 | - By including `--only` flag will Limit which emulators to start. Supply a comma-separated list of emulator names, specifying one or more of 'auth', 'database', 'firestore', 'functions', 'hosting', or 'pubsub'.
11 | - Example:-`firebase emulators:start --only firestore` will start the firestore emulator only.
12 |
13 | # Import Data to Emulators
14 | - To import data to emulators there should be a pre-exisiting data file which contains data about respective Emulators.
15 | - we can get the data file by exporting it from the database emualators(if your are using for first time the must be created).
16 | - To import data we can use the command in terminal while starting the emulators `firebase emulators:start --import=file_name`, the file name can be any thing if the file exist in the project folder then the data from it is imported to the firebase local emulators.
17 |
18 | 
19 |
20 | # Export Data From Emulators
21 | - To export data from Local Emulators use the command `firebase emulators:export file_name`
22 | - if the path is specified for the file the data is stored at the particular location else it will be in the stored in the project file itself
23 | - if the file_name is already exisiting the data in the file is overidded else the new file will be created if the file isn't exist already.
24 |
25 | 
26 |
27 |
--------------------------------------------------------------------------------
/rule_sets.md:
--------------------------------------------------------------------------------
1 | # Important points while using the "test data" file:-
2 |
3 | - You can use the data in the "testdata" file by importing while starting the emulators,please refer firebase_import_export.md file for indetailed information.
4 | - if you import the data using "testdata" file the you can see the sample data that contains users,sample tutorials and organisation details.
5 | - If your using the script for importing and exporting the data, all the changes made in emulators will be reflecting the data associated in the "testdata" file upon exporting it.
6 | - Don't perform export operation,if no changes are made to the emulators(like adding newuser, creating new orgs and create new com-dict-client tutorial) this may change the data in the testdata file.
7 | - Do not use export operation if you haven't import the data from testdata before
8 | - you can perform export operation if you have performed import operation while starting the emulators so that the data from testdata file will i.e., remain no change or additional data is appended
9 |
10 | # Export the Emulators data in your own file:-
11 |
12 | Insted of using the pre-existing data file "testdata" you can export the data in your own file externally.
13 |
14 | - To export the data to any external file you can use the below command in the terminal
15 |
16 | ```
17 | firebase emulators:export file_name
18 | ```
19 |
20 | - You can give the file name with preferred file location(on your local) in the "file_name" flag if you don't mention location ,the file will be created in the current folder itself and if the file is already existing you are asked to over ride the data in it while performing this task.
21 | - If the file isn't exist already a new file will be create at the given location with the given file name and data is exported into that file.
22 |
23 | # Import data from your own file to Emulators:-
24 |
25 | - You import that specific data file while starting emulators only using the following command:-
26 |
27 | ```
28 | firebase emulators:start --import=file_name
29 | ```
30 |
--------------------------------------------------------------------------------