From 1ed5405652fc8c0b32ac3d72fdb1f27149bf6761 Mon Sep 17 00:00:00 2001 From: Spectralitree Date: Wed, 9 Dec 2020 09:32:20 +0100 Subject: [PATCH] Fixed routing --- .eslintcache | 2 +- .gitignore | 2 ++ src/App.js | 4 ++-- src/Components/Dash.js | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.eslintcache b/.eslintcache index 0996b187..d1ee982d 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\index.js":"1","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\History.js":"2","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\App.js":"3","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Dash.js":"4","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Constants\\constants.js":"5","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Loading.js":"6","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Navigation.js":"7","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\System.js":"8","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Memberlist.js":"9","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\MemberCard.js":"10"},{"size":296,"mtime":1607424711608,"results":"11","hashOfConfig":"12"},{"size":87,"mtime":1607422561580,"results":"13","hashOfConfig":"12"},{"size":3416,"mtime":1607467147275,"results":"14","hashOfConfig":"12"},{"size":336,"mtime":1607466411435,"results":"15","hashOfConfig":"12"},{"size":73,"mtime":1607380663280,"results":"16","hashOfConfig":"12"},{"size":231,"mtime":1607464297342,"results":"17","hashOfConfig":"12"},{"size":671,"mtime":1607467074202,"results":"18","hashOfConfig":"12"},{"size":1694,"mtime":1607466250269,"results":"19","hashOfConfig":"12"},{"size":2160,"mtime":1607468731560,"results":"20","hashOfConfig":"12"},{"size":1894,"mtime":1607468928885,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1rd8s2n",{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"36","messages":"37","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\index.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\History.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\App.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Dash.js",["42"],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Constants\\constants.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Loading.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Navigation.js",["43"],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\System.js",["44"],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Memberlist.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\MemberCard.js",["45"],{"ruleId":"46","severity":1,"message":"47","line":2,"column":13,"nodeType":"48","messageId":"49","endLine":2,"endColumn":15},{"ruleId":"46","severity":1,"message":"50","line":1,"column":8,"nodeType":"48","messageId":"49","endLine":1,"endColumn":13},{"ruleId":"51","severity":1,"message":"52","line":18,"column":4,"nodeType":"53","endLine":18,"endColumn":22,"suggestions":"54"},{"ruleId":"51","severity":1,"message":"52","line":18,"column":8,"nodeType":"53","endLine":18,"endColumn":28,"suggestions":"55"},"no-unused-vars","'BS' is defined but never used.","Identifier","unusedVar","'react' is defined but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'toHTML'. Either include it or remove the dependency array.","ArrayExpression",["56"],["57"],{"desc":"58","fix":"59"},{"desc":"60","fix":"61"},"Update the dependencies array to be: [toHTML, user.description]",{"range":"62","text":"63"},"Update the dependencies array to be: [member.description, toHTML]",{"range":"64","text":"65"},[550,568],"[toHTML, user.description]",[541,561],"[member.description, toHTML]"] \ No newline at end of file +[{"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\index.js":"1","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\History.js":"2","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\App.js":"3","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Dash.js":"4","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Constants\\constants.js":"5","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Loading.js":"6","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Navigation.js":"7","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\System.js":"8","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Memberlist.js":"9","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\MemberCard.js":"10"},{"size":296,"mtime":1607424711608,"results":"11","hashOfConfig":"12"},{"size":87,"mtime":1607422561580,"results":"13","hashOfConfig":"12"},{"size":3416,"mtime":1607467147275,"results":"14","hashOfConfig":"12"},{"size":336,"mtime":1607466411435,"results":"15","hashOfConfig":"12"},{"size":73,"mtime":1607380663280,"results":"16","hashOfConfig":"12"},{"size":231,"mtime":1607464297342,"results":"17","hashOfConfig":"12"},{"size":671,"mtime":1607467074202,"results":"18","hashOfConfig":"12"},{"size":1694,"mtime":1607466250269,"results":"19","hashOfConfig":"12"},{"size":2160,"mtime":1607468731560,"results":"20","hashOfConfig":"12"},{"size":1894,"mtime":1607468928885,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"1rd8s2n",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"31","usedDeprecatedRules":"24"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"38","usedDeprecatedRules":"24"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"41","usedDeprecatedRules":"24"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"46"},"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\index.js",[],["47","48"],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\History.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\App.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Dash.js",["49"],"import React from 'react';\r\nimport * as BS from 'react-bootstrap'\r\n\r\nimport System from './System.js'\r\nimport Memberlist from './Memberlist.js'\r\n\r\nexport default function Dash(props) {\r\n\r\n return (<>\r\n \r\n \r\n \r\n );\r\n}","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Constants\\constants.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Loading.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Navigation.js",["50"],"import react from 'react';\r\nimport * as BS from 'react-bootstrap'\r\n\r\n\r\nexport default function Navigation(props) {\r\n\r\n function logOut() {\r\n localStorage.removeItem(\"token\");\r\n localStorage.removeItem(\"user\");\r\n props.setIsSubmit(false);\r\n }\r\n\r\n return (\r\n \r\n \r\n pk-web\r\n \r\n \r\n { localStorage.getItem('token') ? Log Out : \"\" }\r\n \r\n \r\n )\r\n}","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\System.js",["51"],"import React, { useState, useEffect } from 'react';\r\nimport * as BS from 'react-bootstrap'\r\n\r\nimport { FaAddressCard } from \"react-icons/fa\";\r\nimport defaultAvatar from '../default_discord_avatar.png'\r\n\r\nexport default function System(props) {\r\n\r\n const { toHTML } = require('discord-markdown');\r\n\r\n const [ desc, setDesc ] = useState(\"\");\r\n const user = JSON.parse(localStorage.getItem(\"user\"));\r\n\r\n useEffect(() => {\r\n if (user.description) {\r\n setDesc(toHTML(user.description));\r\n } else setDesc(\"(no description)\");\r\n}, [user.description]);\r\n\r\n return (\r\n \r\n \r\n {user.name} \r\n { user.avatar_url ? : \r\n }\r\n \r\n \r\n \r\n ID: {user.id}\r\n Tag: {user.tag}\r\n Timezone: {user.tz}\r\n \r\n
\r\n

Description:

\r\n

\r\n
\r\n
\r\n )\r\n}\r\n\r\n \r\n\r\n ","C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\Memberlist.js",[],"C:\\Users\\Fleur\\Desktop\\website projects etc\\pk-web\\src\\Components\\MemberCard.js",["52"],"import React, { useEffect, useState } from 'react';\r\nimport * as BS from 'react-bootstrap'\r\n\r\nimport defaultAvatar from '../default_discord_avatar.png'\r\nimport { FaUser } from \"react-icons/fa\";\r\n\r\nexport default function MemberCard(props) {\r\n\r\n const { toHTML } = require('discord-markdown');\r\n\r\n const [ desc, setDesc ] = useState(\"\");\r\n const member = props.member;\r\n\r\n useEffect(() => {\r\n if (member.description) {\r\n setDesc(toHTML(member.description));\r\n } else setDesc(\"(no description)\");\r\n }, [member.description]);\r\n\r\n return (\r\n <> \r\n \r\n {member.name} ({member.id})\r\n { member.avatar_url ? : \r\n }\r\n \r\n \r\n \r\n \r\n ID: {member.id}\r\n { member.display_name ? AKA: {member.display_name} : \"\" }\r\n { member.birthday ? Birthday: {member.birthday} : \"\" }\r\n { member.pronouns ? Pronouns: {member.pronouns} : \"\" }\r\n \r\n
\r\n

Description:

\r\n

\r\n
\r\n
\r\n \r\n )\r\n}\r\n",{"ruleId":"53","replacedBy":"54"},{"ruleId":"55","replacedBy":"56"},{"ruleId":"57","severity":1,"message":"58","line":2,"column":13,"nodeType":"59","messageId":"60","endLine":2,"endColumn":15},{"ruleId":"57","severity":1,"message":"61","line":1,"column":8,"nodeType":"59","messageId":"60","endLine":1,"endColumn":13},{"ruleId":"62","severity":1,"message":"63","line":18,"column":4,"nodeType":"64","endLine":18,"endColumn":22,"suggestions":"65"},{"ruleId":"62","severity":1,"message":"63","line":18,"column":8,"nodeType":"64","endLine":18,"endColumn":28,"suggestions":"66"},"no-native-reassign",["67"],"no-negated-in-lhs",["68"],"no-unused-vars","'BS' is defined but never used.","Identifier","unusedVar","'react' is defined but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'toHTML'. Either include it or remove the dependency array.","ArrayExpression",["69"],["70"],"no-global-assign","no-unsafe-negation",{"desc":"71","fix":"72"},{"desc":"73","fix":"74"},"Update the dependencies array to be: [toHTML, user.description]",{"range":"75","text":"76"},"Update the dependencies array to be: [member.description, toHTML]",{"range":"77","text":"78"},[550,568],"[toHTML, user.description]",[541,561],"[member.description, toHTML]"] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4d29575d..d7b8f1bd 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.eslintcache diff --git a/src/App.js b/src/App.js index aa8bb32f..d3841564 100644 --- a/src/App.js +++ b/src/App.js @@ -65,10 +65,10 @@ export default function App() { - { !localStorage.getItem('token') || isInvalid ? : + { !localStorage.getItem('token') || isInvalid ? : } - + { isLoading ? : diff --git a/src/Components/Dash.js b/src/Components/Dash.js index 0f99f004..2eac4182 100644 --- a/src/Components/Dash.js +++ b/src/Components/Dash.js @@ -1,5 +1,4 @@ import React from 'react'; -import * as BS from 'react-bootstrap' import System from './System.js' import Memberlist from './Memberlist.js'