diff --git a/.gitignore b/.gitignore index 4d29575..c067634 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,23 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/README.md b/README.md new file mode 100644 index 0000000..12425e9 --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## Available Scripts + +In the project directory, you can run: + +### `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `npm test` + +Launches the test runner in the interactive watch mode.
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `npm run build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `npm run eject` + +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** + +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. + +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). + +### Code Splitting + +This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting + +### Analyzing the Bundle Size + +This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size + +### Making a Progressive Web App + +This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app + +### Advanced Configuration + +This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration + +### Deployment + +This section has moved here: https://facebook.github.io/create-react-app/docs/deployment + +### `npm run build` fails to minify + +This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify diff --git a/client/fdweb b/client/fdweb new file mode 160000 index 0000000..c401a43 --- /dev/null +++ b/client/fdweb @@ -0,0 +1 @@ +Subproject commit c401a433dd2c2431e6885a1aedeb65ee124389c6 diff --git a/client/package-lock.json b/client/package-lock.json index 00f353f..315c94c 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -6264,6 +6264,19 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, + "history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -6274,6 +6287,14 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", @@ -7564,6 +7585,11 @@ } } }, + "js-cookie": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz", + "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -8172,6 +8198,15 @@ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" }, + "mini-create-react-context": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz", + "integrity": "sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA==", + "requires": { + "@babel/runtime": "^7.5.5", + "tiny-warning": "^1.0.3" + } + }, "mini-css-extract-plugin": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz", @@ -10571,6 +10606,52 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "react-router": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + } + } + }, + "react-router-dom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + } + }, "react-scripts": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-3.4.1.tgz", @@ -10933,6 +11014,11 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" }, + "resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -12367,6 +12453,16 @@ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" }, + "tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -12738,6 +12834,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/client/package.json b/client/package.json index df2f460..a29fa88 100644 --- a/client/package.json +++ b/client/package.json @@ -7,8 +7,10 @@ "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", "fdweb": "^1.0.5", + "js-cookie": "^2.2.1", "react": "^16.13.1", "react-dom": "^16.13.1", + "react-router-dom": "^5.2.0", "react-scripts": "3.4.1" }, "scripts": { diff --git a/client/public/index.html b/client/public/index.html index aa069f2..b4f8eb3 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -3,6 +3,7 @@ + { @@ -15,10 +13,8 @@ const App = () =>{ - - diff --git a/client/src/Icons/Franklin Clinton.jpg b/client/src/Icons/Franklin Clinton.jpg new file mode 100644 index 0000000..89af48a Binary files /dev/null and b/client/src/Icons/Franklin Clinton.jpg differ diff --git a/client/src/Icons/Jaqcueline.jpg b/client/src/Icons/Jaqcueline.jpg new file mode 100644 index 0000000..5be17d9 Binary files /dev/null and b/client/src/Icons/Jaqcueline.jpg differ diff --git a/client/src/Icons/Michael De Santa.jpg b/client/src/Icons/Michael De Santa.jpg new file mode 100644 index 0000000..d7c20f3 Binary files /dev/null and b/client/src/Icons/Michael De Santa.jpg differ diff --git a/client/src/Icons/Niko Bellic.jpg b/client/src/Icons/Niko Bellic.jpg new file mode 100644 index 0000000..ba4d452 Binary files /dev/null and b/client/src/Icons/Niko Bellic.jpg differ diff --git a/client/src/Icons/Tracey Townley.jpg b/client/src/Icons/Tracey Townley.jpg new file mode 100644 index 0000000..e4f6a9a Binary files /dev/null and b/client/src/Icons/Tracey Townley.jpg differ diff --git a/client/src/Icons/Trevor Philips.jpg b/client/src/Icons/Trevor Philips.jpg new file mode 100644 index 0000000..14865b5 Binary files /dev/null and b/client/src/Icons/Trevor Philips.jpg differ diff --git a/client/src/components/AppViewComp.js b/client/src/components/AppViewComp.js deleted file mode 100644 index 8317170..0000000 --- a/client/src/components/AppViewComp.js +++ /dev/null @@ -1,174 +0,0 @@ -import React, { Fragment, useState, useEffect } from "react"; -import { NavLink } from "react-router-dom"; -import Cookies from "js-cookie"; -import DeleteView from "./DeleteComp"; -import DetailsView from "./detailsview"; - -const AppView = () => { - - const [contacts, setContacts] = useState ([]); - const [sender, setSender] = useState(""); - - const openmod1 = () => { - document.getElementById(`addview`).style.display="Block"; - } - const closemod1 = () => { - document.getElementById(`addview`).style.display="None"; - document.getElementById("refreshbutton").style.display="block"; - } - - const openprofile = () => { - document.getElementById("profile").style.display="Block"; - } - const closeprofile = () => { - document.getElementById("profile").style.display="None"; - } - - const [newSender, setNewSender] = useState(""); - const [newReceiver, setNewReceiver] = useState(""); - const [newBalance, setNewBalance] = useState(""); - const [newNote, setNewNote] = useState(""); - - const addcontact = async () =>{ - - var newType=""; - if(newBalance<0) - newType="credit"; - else - newType="debit"; - const contactbody = { - sender: newSender, - receiver: newReceiver, - net_balance: newBalance - }; - const transbody = { - sender: newSender, - receiver: newReceiver, - type: newType, - balance: newBalance, - note: newNote - }; - const response = await fetch("lists", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(contactbody) - }); - - const transresponse = await fetch("/lists/add", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(transbody) - }); - - } - const onFormSubmit = async e => { - e.preventDefault(); - try { - addcontact(); - closemod1(); - - } catch (error) { - console.error(error); - } - } - - const getList = async userexists => { - try { - const listbody = { - Sender: userexists - } - const response = await fetch(`/lists/${listbody.Sender}`); - const jsonData = await response.json(); - - setContacts(jsonData); - setSender(jsonData[0].sender); - } catch (error) { - console.error(error); - } - } - - const logout = () =>{ - console.log("logging out"); - Cookies.remove('username', {path: ''}); - Cookies.remove('username', {path: '/login'}); - window.location="/"; - } - - const redirect = () =>{ - window.location=('/login'); - } - - const getsender = async userexists =>{ - setSender(userexists); - getList(userexists); - } - - useEffect(() => { - const userexists = Cookies.get('username'); - if(userexists==undefined) - redirect(); - else - getsender(userexists); - }, []); - - return( - -
-
Hisab Kitab
- -




-
- - Some content has updated, Refresh -
    - {contacts.map(contact =>( -
  • -

    {contact.receiver}

    - - -
    ₹ {contact.net_balance}
    -
  • - ))} -
-
- -
-
-
-
Add Contact
-




-
-
-
- setNewReceiver(e.target.value)} onClick={e => setNewSender(sender)} required />
-

- setNewBalance(e.target.value)} required />
-

- setNewNote(e.target.value)} />
-

-
- -
- -
-
-
- -
-
-
-

Hi, {sender} we are working on providing many settings for you. For now you can only use the profile - view to log out of your account. Soon there will be lots of profile settings avalaible

-

- - - -
-
-
- -
- ); -} - -export default AppView; \ No newline at end of file diff --git a/client/src/components/ChatWindowComp.js b/client/src/components/ChatWindowComp.js index 112229c..f627e0b 100644 --- a/client/src/components/ChatWindowComp.js +++ b/client/src/components/ChatWindowComp.js @@ -1,13 +1,74 @@ -import React, { Fragment, useState, useEffect } from "react"; +import React, { Fragment} from "react"; import "./extrastyles.css"; +import Nico from '../Icons/Niko Bellic.jpg' + + const ChatWindow = () => { return( +
+ + +
+ +
+ User + +
+ +
+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mollis facilisis luctus. Nullam augue ante, varius vel tellus in, finibus elementum tellus. Maecenas faucibus aliquam orci, eget fermentum tortor tempus eget. Integer ut venenatis nulla. Aenean efficitur, neque in finibus aliquet, urna sapien consectetur justo, et cursus velit quam ut orci. + +
+ +
+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mollis facilisis luctus. Nullam augue ante, varius vel tellus in, finibus elementum tellus. Maecenas faucibus aliquam orci, eget fermentum tortor tempus eget. Integer ut venenatis nulla. Aenean efficitur, neque in finibus aliquet, urna sapien consectetur justo, et cursus velit quam ut orci. + +
+ +
+