+
,
+ layout: "/admin",
+ },
{
path: "/dashboard",
name: "Dashboard",
- rtlName: "لوحة القيادة",
+ rtlName: "Grafikler",
icon: "tim-icons icon-chart-pie-36",
component:
,
layout: "/admin",
},
{
- path: "/icons",
- name: "Icons",
- rtlName: "الرموز",
- icon: "tim-icons icon-atom",
- component:
,
- layout: "/admin",
- },
- {
- path: "/map",
- name: "Map",
- rtlName: "خرائط",
- icon: "tim-icons icon-pin",
- component:
,
- layout: "/admin",
- },
- {
- path: "/notifications",
- name: "Notifications",
- rtlName: "إخطارات",
- icon: "tim-icons icon-bell-55",
- component:
,
- layout: "/admin",
- },
- {
- path: "/user-profile",
- name: "User Profile",
- rtlName: "ملف تعريفي للمستخدم",
- icon: "tim-icons icon-single-02",
- component:
,
- layout: "/admin",
- },
- {
- path: "/tables",
- name: "Table List",
- rtlName: "قائمة الجدول",
- icon: "tim-icons icon-puzzle-10",
- component:
,
- layout: "/admin",
- },
- {
- path: "/typography",
- name: "Typography",
- rtlName: "طباعة",
- icon: "tim-icons icon-align-center",
- component:
,
+ path: "/cryptos",
+ name: "Crypto Currencies",
+ rtlName: "Kripto Paralar",
+ icon: "tim-icons icon-chart-pie-36",
+ component:
,
layout: "/admin",
},
- {
- path: "/rtl-support",
- name: "RTL Support",
- rtlName: "ار تي ال",
- icon: "tim-icons icon-world",
- component:
,
- layout: "/rtl",
- },
+ // {
+ // path: "/user-profile",
+ // name: "User Profile",
+ // rtlName: "Kullanıcı Profili",
+ // icon: "tim-icons icon-single-02",
+ // component:
,
+ // layout: "/admin",
+ // },
+ // {
+ // path: "/rtl-support",
+ // name: "Türkçe",
+ // rtlName: "Türkçe",
+ // icon: "tim-icons icon-world",
+ // component:
,
+ // layout: "/rtl",
+ // },
+
];
export default routes;
diff --git a/src/variables/charts.js b/src/variables/charts.js
index c6b342bd..e0315049 100755
--- a/src/variables/charts.js
+++ b/src/variables/charts.js
@@ -19,7 +19,7 @@
// // // Chart variables
// #############################
-// chartExample1 and chartExample2 options
+
let chart1_2_options = {
maintainAspectRatio: false,
legend: {
@@ -96,7 +96,7 @@ let chartExample1 = {
],
datasets: [
{
- label: "My First dataset",
+ label: "Total Savings",
fill: true,
backgroundColor: gradientStroke,
borderColor: "#1f8ef1",
diff --git a/src/views/Cryptos.js b/src/views/Cryptos.js
new file mode 100644
index 00000000..463aaa9c
--- /dev/null
+++ b/src/views/Cryptos.js
@@ -0,0 +1,59 @@
+import React, { useState, useEffect } from "react";
+import axios from "axios";
+import "../assets/css/App.css";
+import Moeda from "../components/Crypto/Moeda.js";
+
+function App() {
+ const [moedas, setMoedas] = useState([]);
+ const [search, setSearch] = useState("");
+
+ useEffect(() => {
+ axios
+ .get(
+ "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=10&page=1&sparkline=false"
+ )
+ .then((res) => {
+ setMoedas(res.data);
+ console.log(res.data);
+ })
+ .catch((error) => console.log(error));
+ }, []);
+
+ const handleChange = (e) => {
+ setSearch(e.target.value);
+ };
+
+ const filteredMoedas = moedas.filter((moeda) =>
+ moeda.name.toLowerCase().includes(search.toLowerCase())
+ );
+ return (
+
+
+
Crypto Search
+
+
+ {filteredMoedas.map((moeda) => {
+ return (
+
+ );
+ })}
+
+ );
+}
+export default App;
diff --git a/src/views/Dashboard.js b/src/views/Dashboard.js
index 38c5a7cd..c093334a 100755
--- a/src/views/Dashboard.js
+++ b/src/views/Dashboard.js
@@ -29,17 +29,8 @@ import {
CardHeader,
CardBody,
CardTitle,
- DropdownToggle,
- DropdownMenu,
- DropdownItem,
- UncontrolledDropdown,
- Label,
- FormGroup,
- Input,
- Table,
Row,
Col,
- UncontrolledTooltip,
} from "reactstrap";
// core components
@@ -49,6 +40,7 @@ import {
chartExample3,
chartExample4,
} from "variables/charts.js";
+
function Dashboard(props) {
const [bigChartData, setbigChartData] = React.useState("data1");
@@ -64,8 +56,8 @@ function Dashboard(props) {
- Total Shipments
- Performance
+ Total Savings
+ Balance
setBgChartData("data1")}
>
- Accounts
+ Daily
@@ -100,7 +92,7 @@ function Dashboard(props) {
onClick={() => setBgChartData("data2")}
>
- Purchases
+ Weekly
@@ -117,7 +109,7 @@ function Dashboard(props) {
onClick={() => setBgChartData("data3")}
>
- Sessions
+ Monthly
@@ -195,338 +187,7 @@ function Dashboard(props) {
-
-
-
-
- Tasks(5)
- today
-
-
-
-
-
- e.preventDefault()}
- >
- Action
-
- e.preventDefault()}
- >
- Another action
-
- e.preventDefault()}
- >
- Something else
-
-
-
-
-
-
-
-
-
-
-
-
- Simple Table
-
-
-
-
-
- | Name |
- Country |
- City |
- Salary |
-
-
-
-
- | Dakota Rice |
- Niger |
- Oud-Turnhout |
- $36,738 |
-
-
- | Minerva Hooper |
- Curaçao |
- Sinaai-Waas |
- $23,789 |
-
-
- | Sage Rodriguez |
- Netherlands |
- Baileux |
- $56,142 |
-
-
- | Philip Chaney |
- Korea, South |
- Overland Park |
- $38,735 |
-
-
- | Doris Greene |
- Malawi |
- Feldkirchen in Kärnten |
- $63,542 |
-
-
- | Mason Porter |
- Chile |
- Gloucester |
- $78,615 |
-
-
- | Jon Porter |
- Portugal |
- Gloucester |
- $98,615 |
-
-
-
-
-
-
-
+
>
);
diff --git a/src/views/HomePage.js b/src/views/HomePage.js
new file mode 100644
index 00000000..3807542e
--- /dev/null
+++ b/src/views/HomePage.js
@@ -0,0 +1,296 @@
+import { ToastContainer, toast } from 'react-toastify';
+import 'react-toastify/dist/ReactToastify.css';
+import React, { useState } from "react";
+import axios from 'axios';
+// reactstrap components
+import {
+ Button,
+ Card,
+ CardHeader,
+ CardBody,
+ CardFooter,
+ FormGroup,
+ Form,
+ Input,
+ Row,
+ Col,
+ CardTitle,
+ Table,
+ Alert
+} from "reactstrap";
+
+function Tables() {
+ const [formData, setFormData] = useState({
+ initialSaving: '',
+ monthlyDeposit: '',
+ invest: 'No',
+ investmentProfit: '',
+ targetAmount: '',
+ });
+
+ const [monthsNeeded, setMonthsNeeded] = useState(null);
+ const [formError, setFormError] = useState(false);
+
+
+
+ const handleInputChange = (event) => {
+ const { name, value } = event.target;
+ console.log(formData);
+
+ setFormData({
+ ...formData,
+ [name]: value,
+ });
+ };
+
+ const handleSubmit = async (event) => {
+ event.preventDefault();
+
+ // Check if any of the required fields are empty
+ if (!formData.initialSaving || !formData.monthlyDeposit || !formData.targetAmount) {
+ setFormError(true);
+ return;
+ }
+
+ if (
+ parseFloat(formData.initialSaving) < 0 ||
+ parseFloat(formData.monthlyDeposit) < 0 ||
+ parseFloat(formData.targetAmount) < 0
+ ) {
+ setFormError(true);
+ return;
+ }
+
+ try {
+ const response = await axios.post('http://localhost:3005/calculate', formData);
+ const {months, weeks, days} = response.data;
+ console.log(`It will take ${months} months to reach your goal.`);
+ setMonthsNeeded(months);
+ setFormError(false); // Reset form error
+
+ toast.success(`Success! It will take ${months} months to reach your goal. Scroll down to see details.`);
+
+ console.log(response.data);
+ } catch (error) {
+ console.error('Error sending data to the backend:', error);
+ }
+ };
+ const renderInvestmentProfitField = () => {
+ if (formData.invest === 'No') {
+ return null; // Return nothing if "No" is selected
+ }
+
+ return (
+