From a6e574282df3529b31f77f434bee74fd95ffa3fb Mon Sep 17 00:00:00 2001 From: HEGADE Date: Mon, 21 Jun 2021 19:46:56 -0400 Subject: [PATCH] added some feature --- package-lock.json | 67 ++++++++++++++++++++++ package.json | 2 + src/assets/css/article.css | 12 ++-- src/assets/css/article.css.map | 2 +- src/assets/css/article.scss | 7 ++- src/assets/css/global.css | 22 +++---- src/assets/css/readmore.css | 14 ++--- src/commomComponets/Heading.js | 3 +- src/components/Article.jsx | 11 ++-- src/helper/fetchData.js | 2 +- src/pages/Articles.js | 25 ++++---- src/pages/Login.js | 14 ++--- src/pages/Signup.js | 101 ++++++++++++++++----------------- src/store/SignupContext.js | 2 + yarn.lock | 24 +++++++- 15 files changed, 198 insertions(+), 110 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4395979..a6b2765 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "version": "0.1.0", "dependencies": { "@material-ui/core": "^4.11.4", + "@material-ui/icons": "^4.11.2", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", @@ -16,6 +17,7 @@ "react-dom": "^17.0.2", "react-query": "^3.16.0", "react-router": "^5.2.0", + "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", "web-vitals": "^1.0.1" } @@ -1856,6 +1858,28 @@ } } }, + "node_modules/@material-ui/icons": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-4.11.2.tgz", + "integrity": "sha512-fQNsKX2TxBmqIGJCSi3tGTO/gZ+eJgWmMJkgDiOfyNaunNaxcklJQFaFogYcFl0qFuaEz1qaXYXboa/bUXVSOQ==", + "dependencies": { + "@babel/runtime": "^7.4.4" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "@material-ui/core": "^4.0.0", + "@types/react": "^16.8.6 || ^17.0.0", + "react": "^16.8.0 || ^17.0.0", + "react-dom": "^16.8.0 || ^17.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@material-ui/styles": { "version": "4.11.4", "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.4.tgz", @@ -4461,6 +4485,8 @@ }, "node_modules/babel-preset-react-app/node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/core": { "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.17.tgz", + "integrity": "sha512-V3CuX1aBywbJvV2yzJScRxeiiw0v2KZZYYE3giywxzFJL13RiyPjaaDwhDnxmgFTTS7FgvM2ijr4QmKNIu0AtQ==", "license": "MIT", "peer": true, "dependencies": { @@ -15783,6 +15809,23 @@ "react": ">=15" } }, + "node_modules/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==", + "dependencies": { + "@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" + }, + "peerDependencies": { + "react": ">=15" + } + }, "node_modules/react-router/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -22236,6 +22279,14 @@ "react-transition-group": "^4.4.0" } }, + "@material-ui/icons": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-4.11.2.tgz", + "integrity": "sha512-fQNsKX2TxBmqIGJCSi3tGTO/gZ+eJgWmMJkgDiOfyNaunNaxcklJQFaFogYcFl0qFuaEz1qaXYXboa/bUXVSOQ==", + "requires": { + "@babel/runtime": "^7.4.4" + } + }, "@material-ui/styles": { "version": "4.11.4", "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.4.tgz", @@ -24008,6 +24059,8 @@ "dependencies": { "@babel/core": { "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.17.tgz", + "integrity": "sha512-V3CuX1aBywbJvV2yzJScRxeiiw0v2KZZYYE3giywxzFJL13RiyPjaaDwhDnxmgFTTS7FgvM2ijr4QmKNIu0AtQ==", "peer": true, "requires": { "@babel/code-frame": "^7.12.13", @@ -32266,6 +32319,20 @@ } } }, + "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": "4.0.3", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz", diff --git a/package.json b/package.json index 8b43384..65bbb24 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "@material-ui/core": "^4.11.4", + "@material-ui/icons": "^4.11.2", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", @@ -12,6 +13,7 @@ "react-dom": "^17.0.2", "react-query": "^3.16.0", "react-router": "^5.2.0", + "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", "web-vitals": "^1.0.1" }, diff --git a/src/assets/css/article.css b/src/assets/css/article.css index 0447743..5019753 100644 --- a/src/assets/css/article.css +++ b/src/assets/css/article.css @@ -39,7 +39,7 @@ a { height: -webkit-max-content; height: -moz-max-content; height: max-content; - padding-bottom: .4rem; + padding-bottom: 0.4rem; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); } @@ -94,11 +94,13 @@ a { } .article_container .card_body .author_share .author { + border-radius: 1000px; margin-top: 1rem; - border-radius: 0.1rem; + font-size: small; margin-left: 1rem; - padding: 0.2rem 0.4rem; + padding: 0.4rem 0.6rem; background: rgba(0, 0, 0, 0.4); + color: rgba(255, 255, 255, 0.3); } .article_container .card_body .author_share .shareButton { @@ -276,10 +278,10 @@ a { .custom_msg { color: white; font-family: monsterMedium; - border-radius: .2rem; + border-radius: 0.2rem; margin: 10px auto; max-width: 75vh; - padding: .8rem; + padding: 0.8rem; display: -ms-grid; display: grid; place-items: center; diff --git a/src/assets/css/article.css.map b/src/assets/css/article.css.map index 67ac16b..edec87c 100644 --- a/src/assets/css/article.css.map +++ b/src/assets/css/article.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AAAA,AAAA,KAAK,CAAC;EACJ,QAAQ,CAAA,OAAC;CACV;;AACD,AAAA,CAAC,CAAA;EACC,eAAe,EAAE,IAAI;EACrB,KAAK,EAAE,KAAK;CACb;;AACD,UAAU;EACR,WAAW,EAAE,aAAa;EAC1B,GAAG,EAAE,gDAAgD;;;AAEvD,AAAA,kBAAkB,CAAC;EACjB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,IAAI;EAEb,MAAM,EAAE,SAAS;EACjB,SAAS,EAAE,GAAG;EACd,OAAO,EAAE,IAAI;EACb,GAAG,EAAE,IAAI;EACT,qBAAqB,EAAE,qCAAqC;EAC5D,cAAc,EAAE,IAAI;CAoErB;;AAnEC,MAAM,EAAE,SAAS,EAAE,KAAK;EAV1B,AAAA,kBAAkB,CAAC;IAWf,SAAS,EAAE,GAAG;IACd,cAAc,EAAE,WAAW;GAiE9B;;;AA7ED,AAcE,kBAdgB,CAchB,UAAU,CAAC;EACT,KAAK,EAAE,KAAK;EACZ,KAAK,EAAC,IAAI;EACV,MAAM,EAAE,WAAW;EACnB,cAAc,EAAE,KAAK;EAGrB,sBAAsB,EAAE,aAAa;EACrC,uBAAuB,EAAE,aAAa;CAsDvC;;AA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AE,MAAM;EACrB,UAAU,EAAE,OAAO;EACnB,MAAM,EAAE,+CAAkD;CAC3D;;AAEH,AAAA,WAAW,CAAC;EACV,KAAK,EAAE,KAAK;EAEZ,WAAW,EAAE,aAAa;EAC1B,aAAa,EAAE,MAAM;EACrB,MAAM,EAAE,SAAS;EACjB,SAAS,EAAE,IAAI;EACf,OAAO,EAAE,MAAM;EACf,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;CAIpB;;AAHC,MAAM,EAAE,SAAS,EAAE,KAAK;EAV1B,AAAA,WAAW,CAAC;IAWR,MAAM,EAAE,SAAS;GAEpB", "sources": [ "article.scss" ], diff --git a/src/assets/css/article.scss b/src/assets/css/article.scss index c287035..de50866 100644 --- a/src/assets/css/article.scss +++ b/src/assets/css/article.scss @@ -74,11 +74,14 @@ a { display: flex; justify-content: space-between; .author { + border-radius: 1000px; + margin-top: 1rem; - border-radius: 0.1rem; + font-size: small; margin-left: 1rem; - padding: 0.2rem 0.4rem; + padding: 0.4rem 0.6rem; background: rgba(0, 0, 0, 0.4); + color: rgba(255, 255, 255, 0.3); } .shareButton { margin-top: 1rem; diff --git a/src/assets/css/global.css b/src/assets/css/global.css index 9ee2f3d..c8e93f4 100644 --- a/src/assets/css/global.css +++ b/src/assets/css/global.css @@ -2,7 +2,7 @@ padding: 0; margin: 0; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; } @font-face { @@ -11,7 +11,7 @@ } :root { - --body-bg: #0f162b; + --body-bg:#0f162b; } body { @@ -23,7 +23,7 @@ body { font-family: monsterFont; border-bottom: 2px solid rgba(224, 255, 255, 0.246); margin: 1.4rem; - padding-bottom: 0.8rem; + padding-bottom: .8rem; } .heading_arico h2 { @@ -38,21 +38,21 @@ body { display: -ms-flexbox; display: flex; -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; + -ms-flex-pack: center; + justify-content: center; -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; + -ms-flex-align: center; + align-items: center; height: 100vh; } .wrapper { - padding: 0.8rem 1rem; + padding: .8rem 1rem; border-radius: 50%; -webkit-filter: drop-shadow(0px 5px 10px rgba(0, 0, 0, 0.377)); - filter: drop-shadow(0px 5px 10px rgba(0, 0, 0, 0.377)); + filter: drop-shadow(0px 5px 10px rgba(0, 0, 0, 0.377)); width: 70px; height: 70px; - background-color: #123044; + background-color: #2c2a2a; } -/*# sourceMappingURL=global.css.map */ +/*# sourceMappingURL=global.css.map */ \ No newline at end of file diff --git a/src/assets/css/readmore.css b/src/assets/css/readmore.css index 4f9c199..073471b 100644 --- a/src/assets/css/readmore.css +++ b/src/assets/css/readmore.css @@ -6,14 +6,14 @@ display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; -webkit-box-pack: center; - -ms-flex-pack: center; - justify-content: center; + -ms-flex-pack: center; + justify-content: center; -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; + -ms-flex-align: center; + align-items: center; } .read_more .read_more_heading { @@ -67,4 +67,4 @@ font-size: 1em; background-color: black; } -/*# sourceMappingURL=readmore.css.map */ +/*# sourceMappingURL=readmore.css.map */ \ No newline at end of file diff --git a/src/commomComponets/Heading.js b/src/commomComponets/Heading.js index 51fd318..79ffd44 100644 --- a/src/commomComponets/Heading.js +++ b/src/commomComponets/Heading.js @@ -1,6 +1,7 @@ import React from "react"; -const Heading = () => { +const Heading = ({title}) => { + document.title = title return ( <>
diff --git a/src/components/Article.jsx b/src/components/Article.jsx index fc94db6..3c687a1 100644 --- a/src/components/Article.jsx +++ b/src/components/Article.jsx @@ -1,5 +1,6 @@ import React from "react"; import { Link } from "react-router-dom"; +import ShareOutlinedIcon from '@material-ui/icons/ShareOutlined'; const Article = ({ img, @@ -13,7 +14,7 @@ const Article = ({ background: `linear-gradient(193deg, ${determineColor},22%, #304569)`, }; const share = async (e) => { - if (e.target.className === "shareButton") { + if (navigator.canShare) { navigator .share({ @@ -29,12 +30,12 @@ const Article = ({ alert("sharing capability is not supported by this browser"); }); } - } + }; return ( <> -
+
article_image @@ -48,8 +49,8 @@ const Article = ({
{user} - - Share + +
diff --git a/src/helper/fetchData.js b/src/helper/fetchData.js index 86e794a..7e9f655 100644 --- a/src/helper/fetchData.js +++ b/src/helper/fetchData.js @@ -5,7 +5,7 @@ import { useState, useEffect } from "react"; export const fetchData = async () => { let _token = LocalStorage.getItem(); config.headers["auth"] = _token; - let data = await axios.get("http://localhost:8000/api", config); + let data = await axios.get("http://localhost:8000/api?page=1", config); if (data.data?.code === -1) { console.log("not authorized"); } diff --git a/src/pages/Articles.js b/src/pages/Articles.js index 16f6b06..cea7cc1 100644 --- a/src/pages/Articles.js +++ b/src/pages/Articles.js @@ -4,44 +4,43 @@ import Article from "../components/Article"; import Heading from "../commomComponets/Heading"; import { authC } from "../store/SignupContext"; import { fetchData } from "../helper/fetchData"; -import Loader from "../commomComponets/Loader" +import Loader from "../commomComponets/Loader"; const Articles = () => { - let { isLog, setIsLogg,loading,setLoading } = useContext(authC); + let { isLog, setIsLogg, loading, setLoading } = useContext(authC); let [articles, setArticles] = useState([]); useEffect(() => { - setIsLogg(true) - setLoading(true) + setIsLogg(true); + setLoading(true); fetchData() .then((data) => { if (data.data?.code === -1) { setIsLogg(false); - setLoading(false) + setLoading(false); } if (data.data[0]?.article) { - - setIsLogg(true) - setLoading(false) + setIsLogg(true); + setLoading(false); setArticles((pre) => [...pre, ...data?.data]); } - console.log(data); + setLoading(false); + }) .catch((e) => { alert("Slow network detected..,pls try again later"); }); }, []); - if(loading) return -if(!isLog) return + if (loading) return ; + if (!isLog) return ; return ( <> -
{articles.map((ele, index) => { return (
{ - const [isAuthenticatedUser, setAuthenticated] = useState(false); const [username, setUserName] = useState(""); const [password, setPassword] = useState(""); const [_token, setToken] = useState(""); - const { setIsLogg, login, loadingHandler, loading, isLog ,setLoading} = + const { setIsLogg, login, loadingHandler, loading, isLog, setLoading } = useContext(authC); const [_msg, setMsg] = useState(null); @@ -23,32 +22,27 @@ const Login = () => { loadingHandler(Button, "gray", true); try { let data = await login(username, password); - setMsg(data?.data?.msg); + setMsg(data?.data?.msg); if (data?.data?.token) { LocalStorage.setItem(data?.data?.token); setToken(data?.data?.token); setIsLogg(true); loadingHandler(Button, "gray", false); - - setTimeout(() => { - setAuthenticated(true); - }, 1000); } } catch (e) { setMsg("Some network error"); - } }; - document.title = "Login"; + if (loading) return ; if (isLog) return ; return ( <> {_msg && } -
+
Login
diff --git a/src/pages/Signup.js b/src/pages/Signup.js index 08a0bec..d9c7b10 100644 --- a/src/pages/Signup.js +++ b/src/pages/Signup.js @@ -4,11 +4,11 @@ import { authC } from "../store/SignupContext"; import Heading from "../commomComponets/Heading"; import { Msg } from "../commomComponets/Msg"; import { LocalStorage } from "../helper/localStorage"; - import CircularIndeterminate from "../commomComponets/Loader"; const Signup = () => { - const { signup, isLog, setIsLogg, loadingHandler, loading } =useContext(authC); + const { signup, isLog, setIsLogg, loadingHandler, loading } = + useContext(authC); const [_isLog, setIsLog] = useState(false); const [_token, setToken] = useState(""); const [username, setUsername] = useState(""); @@ -18,7 +18,6 @@ const Signup = () => { const [cPassword, setCPassword] = useState(""); const [_msg, setMsg] = useState(null); - const submit = async (e) => { let Button = e; Button.preventDefault(); @@ -39,9 +38,7 @@ const Signup = () => { setMsg("User Created"); setIsLogg(true); setIsLog(true); - setTimeout(() => { - setIsLog(true); - }, 1000); + } loadingHandler(Button, "#0077ff", false); } catch (e) { @@ -50,56 +47,56 @@ const Signup = () => { } }; if (loading) return ; - if (isLog) return ; - - return ( - <> - - {_msg && } - - - setUsername(e.target.value)} - /> - + if (isLog) return ; + + return ( + <> + + {_msg && } + + + setUsername(e.target.value)} + /> + - setName(e.target.value)} - /> - + setName(e.target.value)} + /> + - setEmail(e.target.value)} - /> - + setEmail(e.target.value)} + /> + - setPassword(e.target.value)} - /> - + setPassword(e.target.value)} + /> + - setCPassword(e.target.value)} - /> - - - - ); + setCPassword(e.target.value)} + /> + + + + ); }; export default Signup; diff --git a/src/store/SignupContext.js b/src/store/SignupContext.js index 7de49d7..07b9de0 100644 --- a/src/store/SignupContext.js +++ b/src/store/SignupContext.js @@ -9,9 +9,11 @@ export const SignupContext = ({ children }) => { const [isLog, setIsLogg] = useState(false); const [loading, setLoading] = useState(false); const [token, setToken] = useState(""); + useEffect(() => { isAuthenticated(); }, []); + const signup = async (username, name, email, password, cPassword) => { if (password !== cPassword) return { msg: "passwords are not matching", token }; diff --git a/yarn.lock b/yarn.lock index 0df2eff..9d5832a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1462,7 +1462,7 @@ "@types/yargs" "^15.0.0" "chalk" "^4.0.0" -"@material-ui/core@^4.11.4": +"@material-ui/core@^4.0.0", "@material-ui/core@^4.11.4": "integrity" "sha512-oqb+lJ2Dl9HXI9orc6/aN8ZIAMkeThufA5iZELf2LQeBn2NtjVilF5D2w7e9RpntAzDb4jK5DsVhkfOvFY/8fg==" "resolved" "https://registry.npmjs.org/@material-ui/core/-/core-4.11.4.tgz" "version" "4.11.4" @@ -1480,6 +1480,13 @@ "react-is" "^16.8.0 || ^17.0.0" "react-transition-group" "^4.4.0" +"@material-ui/icons@^4.11.2": + "integrity" "sha512-fQNsKX2TxBmqIGJCSi3tGTO/gZ+eJgWmMJkgDiOfyNaunNaxcklJQFaFogYcFl0qFuaEz1qaXYXboa/bUXVSOQ==" + "resolved" "https://registry.npmjs.org/@material-ui/icons/-/icons-4.11.2.tgz" + "version" "4.11.2" + dependencies: + "@babel/runtime" "^7.4.4" + "@material-ui/styles@^4.11.4": "integrity" "sha512-KNTIZcnj/zprG5LW0Sao7zw+yG3O35pviHzejMdcSGCdWbiO8qzRgOYL8JAxAsWBKOKYwVZxXtHWaB5T2Kvxew==" "resolved" "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.4.tgz" @@ -9558,7 +9565,20 @@ "resolved" "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz" "version" "0.8.3" -"react-router@^5.2.0": +"react-router-dom@^5.2.0": + "integrity" "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==" + "resolved" "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz" + "version" "5.2.0" + dependencies: + "@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-router@^5.2.0", "react-router@5.2.0": "integrity" "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==" "resolved" "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz" "version" "5.2.0"