Merge pull request #960 from ayush0033/launch
Remove some un-used Vars for SSR improving
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
|
||||||
import { useNavigate, Link } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
Grid,
|
Grid,
|
||||||
Typography,
|
Typography,
|
||||||
@@ -23,19 +23,16 @@ const Settings = (props) => {
|
|||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [firstname, setFirstname] = useState("");
|
const [firstname, setFirstname] = useState("");
|
||||||
const [lastname, setLastname] = useState("");
|
const [lastname, setLastname] = useState("");
|
||||||
const [title, setTitle] = useState("");
|
|
||||||
const [companyname, setCompanyname] = useState("");
|
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
const [phone, setPhone] = useState("");
|
|
||||||
const [currentPassword, setCurrentPassword] = useState("");
|
const [currentPassword, setCurrentPassword] = useState("");
|
||||||
const [newPassword, setNewPassword] = useState("");
|
const [newPassword, setNewPassword] = useState("");
|
||||||
const [newPassword2, setNewPassword2] = useState("");
|
const [newPassword2, setNewPassword2] = useState("");
|
||||||
const [file, setFile] = React.useState("");
|
// const [file, setFile] = React.useState("");
|
||||||
const [fileBase64, setFileBase64] = React.useState(
|
// const [fileBase64, setFileBase64] = React.useState(
|
||||||
userdata.image === undefined || userdata.image === null
|
// userdata.image === undefined || userdata.image === null
|
||||||
? theme.palette.defaultImage
|
// ? theme.palette.defaultImage
|
||||||
: userdata.image
|
// : userdata.image
|
||||||
);
|
// );
|
||||||
const [loadedValidationWorkflows, setLoadedValidationWorkflows] =
|
const [loadedValidationWorkflows, setLoadedValidationWorkflows] =
|
||||||
React.useState([]);
|
React.useState([]);
|
||||||
const [selfOwnedWorkflows, setSelfOwnedWorkflows] = React.useState([]);
|
const [selfOwnedWorkflows, setSelfOwnedWorkflows] = React.useState([]);
|
||||||
@@ -43,7 +40,6 @@ const Settings = (props) => {
|
|||||||
React.useState([]);
|
React.useState([]);
|
||||||
|
|
||||||
// Used for error messages etc
|
// Used for error messages etc
|
||||||
const [formMessage] = useState("");
|
|
||||||
const [passwordFormMessage, setPasswordFormMessage] = useState("");
|
const [passwordFormMessage, setPasswordFormMessage] = useState("");
|
||||||
|
|
||||||
const [firstrequest, setFirstRequest] = useState(true);
|
const [firstrequest, setFirstRequest] = useState(true);
|
||||||
@@ -296,58 +292,58 @@ const Settings = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerProviders = (userdata) => {
|
// const registerProviders = (userdata) => {
|
||||||
// Register hooks here
|
// // Register hooks here
|
||||||
detectEthereumProvider().then((provider) => {
|
// detectEthereumProvider().then((provider) => {
|
||||||
if (provider) {
|
// if (provider) {
|
||||||
if (!provider.isMetaMask) {
|
// if (!provider.isMetaMask) {
|
||||||
alert.error("Only MetaMask is supported as of now.");
|
// alert.error("Only MetaMask is supported as of now.");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Find the ethereum network
|
// // Find the ethereum network
|
||||||
// Get the users' account(s)
|
// // Get the users' account(s)
|
||||||
//alert.info("Connecting to MetaMask")
|
// //alert.info("Connecting to MetaMask")
|
||||||
//console.log("Connected: ", provider.isConnected())
|
// //console.log("Connected: ", provider.isConnected())
|
||||||
|
|
||||||
if (!provider.isConnected()) {
|
// if (!provider.isConnected()) {
|
||||||
alert.error("Metamask is not connected.");
|
// alert.error("Metamask is not connected.");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
provider.on("message", (event) => {
|
// provider.on("message", (event) => {
|
||||||
alert.info("Ethereum message: ", event);
|
// alert.info("Ethereum message: ", event);
|
||||||
});
|
// });
|
||||||
|
|
||||||
provider.on("chainChanged", (chainId) => {
|
// provider.on("chainChanged", (chainId) => {
|
||||||
console.log("Changed chain to: ", chainId);
|
// console.log("Changed chain to: ", chainId);
|
||||||
|
|
||||||
const method = "eth_getBalance";
|
// const method = "eth_getBalance";
|
||||||
const params = [userdata.eth_info.account, "latest"];
|
// const params = [userdata.eth_info.account, "latest"];
|
||||||
provider
|
// provider
|
||||||
.request({
|
// .request({
|
||||||
method: method,
|
// method: method,
|
||||||
params,
|
// params,
|
||||||
})
|
// })
|
||||||
.then((result) => {
|
// .then((result) => {
|
||||||
console.log("Got result: ", result);
|
// console.log("Got result: ", result);
|
||||||
if (result !== undefined && result !== null) {
|
// if (result !== undefined && result !== null) {
|
||||||
userdata.eth_info.balance = result;
|
// userdata.eth_info.balance = result;
|
||||||
userdata.eth_info.parsed_balance = result / 1000000000000000000;
|
// userdata.eth_info.parsed_balance = result / 1000000000000000000;
|
||||||
console.log("INFO: ", userdata);
|
// console.log("INFO: ", userdata);
|
||||||
setUserData(userdata);
|
// setUserData(userdata);
|
||||||
} else {
|
// } else {
|
||||||
alert.error("Couldn't find balance: ", result);
|
// alert.error("Couldn't find balance: ", result);
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
// If the request fails, the Promise will reject with an error.
|
// // If the request fails, the Promise will reject with an error.
|
||||||
alert.error("Failed getting info from ethereum API: " + error);
|
// alert.error("Failed getting info from ethereum API: " + error);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
|
|
||||||
// This should "always" have data
|
// This should "always" have data
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import TableRow from "@material-ui/core/TableRow";
|
|||||||
import Paper from "@material-ui/core/Paper";
|
import Paper from "@material-ui/core/Paper";
|
||||||
|
|
||||||
import { LineChart, LineSeries, BarChart } from "reaviz";
|
import { LineChart, LineSeries, BarChart } from "reaviz";
|
||||||
import { Gridline, GridStripe } from "reaviz";
|
import { GridStripe } from "reaviz";
|
||||||
import { GridlineSeries } from "reaviz";
|
//import { GridlineSeries } from "reaviz";
|
||||||
|
|
||||||
import InputLabel from '@material-ui/core/InputLabel';
|
import InputLabel from '@material-ui/core/InputLabel';
|
||||||
import FormControl from '@material-ui/core/FormControl';
|
import FormControl from '@material-ui/core/FormControl';
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ import WelcomeForm from "../components/WelcomeForm.jsx";
|
|||||||
import DetectionFramework from "../components/DetectionFramework.jsx";
|
import DetectionFramework from "../components/DetectionFramework.jsx";
|
||||||
import {
|
import {
|
||||||
Grid,
|
Grid,
|
||||||
Container,
|
|
||||||
Fade,
|
Fade,
|
||||||
Typography,
|
Typography,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import theme from '../theme';
|
import theme from '../theme';
|
||||||
import { useNavigate, Link } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
// Should be different if logged in :|
|
// Should be different if logged in :|
|
||||||
const Welcome = (props) => {
|
const Welcome = (props) => {
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import React, { useEffect, useContext } from "react";
|
import React, { useEffect, useContext } from "react";
|
||||||
import ReactDOM from "react-dom"
|
import ReactDOM from "react-dom"
|
||||||
|
|
||||||
import { makeStyles } from "@material-ui/core/styles";
|
import { makeStyles } from "@material-ui/core/styles";
|
||||||
import { useTheme } from "@material-ui/core/styles";
|
import { useTheme } from "@material-ui/core/styles";
|
||||||
import { Navigate } from "react-router-dom";
|
import { Navigate } from "react-router-dom";
|
||||||
//import { Redirect } from "react-router-dom";
|
//import { Redirect } from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
import SecurityFramework from '../components/SecurityFramework.jsx';
|
import SecurityFramework from '../components/SecurityFramework.jsx';
|
||||||
import EditWorkflow from "../components/EditWorkflow.jsx"
|
import EditWorkflow from "../components/EditWorkflow.jsx"
|
||||||
import { ShepherdTour, ShepherdTourContext } from 'react-shepherd'
|
import { ShepherdTour, ShepherdTourContext } from 'react-shepherd'
|
||||||
|
|
||||||
import { isMobile } from "react-device-detect"
|
import { isMobile } from "react-device-detect"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -19,16 +22,13 @@ import {
|
|||||||
ListSubheader,
|
ListSubheader,
|
||||||
Paper,
|
Paper,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Divider,
|
|
||||||
Button,
|
Button,
|
||||||
TextField,
|
TextField,
|
||||||
FormControl,
|
FormControl,
|
||||||
IconButton,
|
IconButton,
|
||||||
Menu,
|
Menu,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
FormControlLabel,
|
|
||||||
Chip,
|
Chip,
|
||||||
Switch,
|
|
||||||
Typography,
|
Typography,
|
||||||
Zoom,
|
Zoom,
|
||||||
CircularProgress,
|
CircularProgress,
|
||||||
@@ -36,7 +36,6 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogActions,
|
DialogActions,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
OutlinedInput,
|
|
||||||
Checkbox,
|
Checkbox,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
@@ -74,7 +73,7 @@ import {
|
|||||||
ExpandMore as ExpandMoreIcon,
|
ExpandMore as ExpandMoreIcon,
|
||||||
} from "@material-ui/icons";
|
} from "@material-ui/icons";
|
||||||
|
|
||||||
import NestedMenuItem from "material-ui-nested-menu-item";
|
//import NestedMenuItem from "material-ui-nested-menu-item";
|
||||||
//import {Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons';
|
//import {Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons';
|
||||||
|
|
||||||
//https://next.material-ui.com/components/material-icons/
|
//https://next.material-ui.com/components/material-icons/
|
||||||
@@ -2023,7 +2022,6 @@ const Workflows = (props) => {
|
|||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
marginTop: 5,
|
marginTop: 5,
|
||||||
maxHeight: 28,
|
maxHeight: 28,
|
||||||
overflow: "hidden",
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{data.tags !== undefined && data.tags !== null
|
{data.tags !== undefined && data.tags !== null
|
||||||
@@ -2973,100 +2971,100 @@ const Workflows = (props) => {
|
|||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
||||||
const tourOptions = {
|
// const tourOptions = {
|
||||||
defaultStepOptions: {
|
// defaultStepOptions: {
|
||||||
classes: "shadow-md bg-purple-dark",
|
// classes: "shadow-md bg-purple-dark",
|
||||||
scrollTo: true
|
// scrollTo: true
|
||||||
},
|
// },
|
||||||
useModalOverlay: true,
|
// useModalOverlay: true,
|
||||||
tourName: workflows,
|
// tourName: workflows,
|
||||||
exitOnEsc: true,
|
// exitOnEsc: true,
|
||||||
}
|
// }
|
||||||
|
|
||||||
//classes: "custom-class-name-1 custom-class-name-2",
|
// //classes: "custom-class-name-1 custom-class-name-2",
|
||||||
const newSteps = [
|
// const newSteps = [
|
||||||
{
|
// {
|
||||||
id: "intro",
|
// id: "intro",
|
||||||
scrollTo: true,
|
// scrollTo: true,
|
||||||
beforeShowPromise: function() {
|
// beforeShowPromise: function() {
|
||||||
return new Promise(function(resolve) {
|
// return new Promise(function(resolve) {
|
||||||
setTimeout(function() {
|
// setTimeout(function() {
|
||||||
window.scrollTo(0, 0);
|
// window.scrollTo(0, 0);
|
||||||
resolve();
|
// resolve();
|
||||||
}, 500);
|
// }, 500);
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
buttons: [
|
// buttons: [
|
||||||
{
|
// {
|
||||||
classes: "shepherd-button-primary",
|
// classes: "shepherd-button-primary",
|
||||||
style: {
|
// style: {
|
||||||
backgroundColor: "red",
|
// backgroundColor: "red",
|
||||||
color: "white",
|
// color: "white",
|
||||||
},
|
// },
|
||||||
text: "Next",
|
// text: "Next",
|
||||||
type: "next"
|
// type: "next"
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
highlightClass: "highlight",
|
// highlightClass: "highlight",
|
||||||
showCancelLink: true,
|
// showCancelLink: true,
|
||||||
text: [
|
// text: [
|
||||||
"React-Shepherd is a JavaScript library for guiding users through your React app."
|
// "React-Shepherd is a JavaScript library for guiding users through your React app."
|
||||||
],
|
// ],
|
||||||
when: {
|
// when: {
|
||||||
show: () => {
|
// show: () => {
|
||||||
console.log("show step 1");
|
// console.log("show step 1");
|
||||||
},
|
// },
|
||||||
hide: () => {
|
// hide: () => {
|
||||||
console.log("hide step 1");
|
// console.log("hide step 1");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: "second",
|
// id: "second",
|
||||||
attachTo: {
|
// attachTo: {
|
||||||
element: "second-step",
|
// element: "second-step",
|
||||||
on: "top"
|
// on: "top"
|
||||||
},
|
// },
|
||||||
text: [
|
// text: [
|
||||||
"Yuk eksplorasi hasil Tes Minat Bakat-mu dan rekomendasi <b>Jurusan</b> dan Karier."
|
// "Yuk eksplorasi hasil Tes Minat Bakat-mu dan rekomendasi <b>Jurusan</b> dan Karier."
|
||||||
],
|
// ],
|
||||||
buttons: [
|
// buttons: [
|
||||||
{
|
// {
|
||||||
classes: "btn btn-info",
|
// classes: "btn btn-info",
|
||||||
text: "Kembali",
|
// text: "Kembali",
|
||||||
type: "back"
|
// type: "back"
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
classes: "btn btn-success",
|
// classes: "btn btn-success",
|
||||||
text: "Saya Mengerti",
|
// text: "Saya Mengerti",
|
||||||
type: "cancel"
|
// type: "cancel"
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
when: {
|
// when: {
|
||||||
show: () => {
|
// show: () => {
|
||||||
console.log("show stepp");
|
// console.log("show stepp");
|
||||||
},
|
// },
|
||||||
hide: () => {
|
// hide: () => {
|
||||||
console.log("complete step");
|
// console.log("complete step");
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
showCancelLink: false,
|
// showCancelLink: false,
|
||||||
scrollTo: true,
|
// scrollTo: true,
|
||||||
modalOverlayOpeningPadding: 4,
|
// modalOverlayOpeningPadding: 4,
|
||||||
useModalOverlay: false,
|
// useModalOverlay: false,
|
||||||
canClickTarget: false
|
// canClickTarget: false
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
|
|
||||||
function TourButton() {
|
// function TourButton() {
|
||||||
const tour = useContext(ShepherdTourContext);
|
// const tour = useContext(ShepherdTourContext);
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<Button variant="contained" color="primary" onClick={tour.start}>
|
// <Button variant="contained" color="primary" onClick={tour.start}>
|
||||||
Start Tour
|
// Start Tour
|
||||||
</Button>
|
// </Button>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
const WorkflowView = () => {
|
const WorkflowView = () => {
|
||||||
if (workflows.length === 0) {
|
if (workflows.length === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user