Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI corporate #18

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions components/NewAssessment/assessment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,26 @@ interface AssesorProps {

export default function NewAssessment({stateChanger, open}: AssesorProps) {

var [url, setUrl] = useState('');
const handleClose = () => {
stateChanger(false);
}

const newAssessmentPost = () => {
fetch("https://asia-southeast1-starlit-array-328711.cloudfunctions.net/hack4good/api/assessment/add", {
method: 'POST',
mode: 'cors',
body: JSON.stringify({
companyName: 'visa',
timestamp: 1676060952,
url: {url},
assessInfo: "im tired"
})
},).then((response) => {
console.log(response);
stateChanger(false);
})
}

return (
<Modal open={open}
Expand Down Expand Up @@ -84,6 +101,7 @@ export default function NewAssessment({stateChanger, open}: AssesorProps) {
variant="filled"
label="Enter URL here"
id="fullWidth"
onChange={(event) => {setUrl(event.target.value)}}
sx={{ borderRadius: "1px" }}
/>
</Stack>
Expand Down Expand Up @@ -153,6 +171,7 @@ export default function NewAssessment({stateChanger, open}: AssesorProps) {
<Grid display={"flex"} spacing={3}>
<Button
startIcon={<AddIcon />}
onClick={newAssessmentPost}
sx={{
backgroundColor: "#E0E0E0",
color: "#000000DE",
Expand Down
2 changes: 1 addition & 1 deletion components/coporateGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function CollapsibleTable({stateChanger}: GridProps) {
JSON.stringify(data);
for (var i = 0; i < data.length; i++){
data[i].index = i + 1;
data[i].time = new Date(parseInt(data[i].timestamp)).toLocaleString();
data[i].time = new Date(parseInt(data[i].timestamp) * 1000).toLocaleString();
data[i].info = [
{
name: 'jon doe',
Expand Down