diff --git a/react-complete-guide/.eslintcache b/react-complete-guide/.eslintcache index 35dbb80..e0b0f00 100644 --- a/react-complete-guide/.eslintcache +++ b/react-complete-guide/.eslintcache @@ -1 +1 @@ -[{"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/index.js":"1","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/App.js":"2","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/Expenses.js":"3","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseItem.js":"4","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseDate.js":"5","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/UI/Card.js":"6","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/NewExpense.js":"7","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/ExpenseForm.js":"8","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesFilter.js":"9","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesList.js":"10"},{"size":179,"mtime":1663691555700,"results":"11","hashOfConfig":"12"},{"size":1074,"mtime":1663784301191,"results":"13","hashOfConfig":"12"},{"size":865,"mtime":1663784016200,"results":"14","hashOfConfig":"12"},{"size":554,"mtime":1663784250244,"results":"15","hashOfConfig":"12"},{"size":560,"mtime":1663696520001,"results":"16","hashOfConfig":"12"},{"size":203,"mtime":1663696382418,"results":"17","hashOfConfig":"12"},{"size":870,"mtime":1663785090702,"results":"18","hashOfConfig":"12"},{"size":2284,"mtime":1663784961415,"results":"19","hashOfConfig":"12"},{"size":808,"mtime":1663783729073,"results":"20","hashOfConfig":"12"},{"size":643,"mtime":1663784178162,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"3vr72g",{"filePath":"25","messages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"29","messages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"31","messages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"33","messages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"35","messages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"41","messages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/index.js",[],["43","44"],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/App.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/Expenses.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseItem.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseDate.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/UI/Card.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/NewExpense.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/ExpenseForm.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesFilter.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesList.js",[],{"ruleId":"45","replacedBy":"46"},{"ruleId":"47","replacedBy":"48"},"no-native-reassign",["49"],"no-negated-in-lhs",["50"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file +[{"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/index.js":"1","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/App.js":"2","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/Expenses.js":"3","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseItem.js":"4","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseDate.js":"5","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/UI/Card.js":"6","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/NewExpense.js":"7","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/ExpenseForm.js":"8","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesFilter.js":"9","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesList.js":"10","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesChart.js":"11","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Chart/Chart.js":"12","/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Chart/ChartBar.js":"13"},{"size":179,"mtime":1663691555700,"results":"14","hashOfConfig":"15"},{"size":1074,"mtime":1663784301191,"results":"16","hashOfConfig":"15"},{"size":971,"mtime":1663786538824,"results":"17","hashOfConfig":"15"},{"size":554,"mtime":1663784250244,"results":"18","hashOfConfig":"15"},{"size":560,"mtime":1663696520001,"results":"19","hashOfConfig":"15"},{"size":203,"mtime":1663696382418,"results":"20","hashOfConfig":"15"},{"size":870,"mtime":1663785090702,"results":"21","hashOfConfig":"15"},{"size":2284,"mtime":1663784961415,"results":"22","hashOfConfig":"15"},{"size":808,"mtime":1663783729073,"results":"23","hashOfConfig":"15"},{"size":643,"mtime":1663784178162,"results":"24","hashOfConfig":"15"},{"size":774,"mtime":1663786597836,"results":"25","hashOfConfig":"15"},{"size":617,"mtime":1663786514528,"results":"26","hashOfConfig":"15"},{"size":603,"mtime":1663786636312,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"3vr72g",{"filePath":"31","messages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"37","messages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"39","messages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"41","messages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"47","messages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"49","messages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"53","messages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/index.js",[],["55","56"],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/App.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/Expenses.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseItem.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpenseDate.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/UI/Card.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/NewExpense.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/NewExpense/ExpenseForm.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesFilter.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesList.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Expenses/ExpensesChart.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Chart/Chart.js",[],"/Users/tyrel.souza/code/udemy/react-course/react-complete-guide/src/components/Chart/ChartBar.js",[],{"ruleId":"57","replacedBy":"58"},{"ruleId":"59","replacedBy":"60"},"no-native-reassign",["61"],"no-negated-in-lhs",["62"],"no-global-assign","no-unsafe-negation"] \ No newline at end of file diff --git a/react-complete-guide/src/components/Chart/Chart.css b/react-complete-guide/src/components/Chart/Chart.css new file mode 100644 index 0000000..be69b13 --- /dev/null +++ b/react-complete-guide/src/components/Chart/Chart.css @@ -0,0 +1,9 @@ +.chart { + padding: 1rem; + border-radius: 12px; + background-color: #f8dfff; + text-align: center; + display: flex; + justify-content: space-around; + height: 10rem; + } \ No newline at end of file diff --git a/react-complete-guide/src/components/Chart/Chart.js b/react-complete-guide/src/components/Chart/Chart.js new file mode 100644 index 0000000..2df25bd --- /dev/null +++ b/react-complete-guide/src/components/Chart/Chart.js @@ -0,0 +1,24 @@ +import React from "react" + +import ChartBar from "./ChartBar" +import "./Chart.css" + +function Chart(props) { + const dataPointValues = props.dataPoints.map(dataPoint => dataPoint.value) + const totalMaximum = Math.max(...dataPointValues) + + return ( +