Skip to content

Commit

Permalink
Create New Button Style
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed Feb 5, 2024
1 parent c62720c commit acb2069
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/StartScreenComp/StartScreenComp.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
background-color: #646cff;
cursor: pointer;
transition: border-color 0.25s;
min-width: 170px;
min-width: 200px;
white-space: nowrap;
}

Expand Down
10 changes: 5 additions & 5 deletions src/SurveyComp/SurveyComp.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect } from "react";
import { Model } from "survey-core";
import "survey-core/defaultV2.min.css";
import { Survey } from "survey-react-ui";
import { json } from "./json";
import { themeJson } from "./theme";
Expand All @@ -10,7 +9,9 @@ import { fetcher } from "../lib/fetcher";
import useSWR from "swr";

import { useUuid, useSaveOnServer } from "../store/store";
import { requestPOST } from "../lib/request";
import { postRequest } from "../lib/request";

import "survey-core/defaultV2.min.css";

// eslint-disable-next-line react/prop-types
function SurveyComponent({ setResult, surveyReset, templateURL }) {
Expand All @@ -21,7 +22,7 @@ function SurveyComponent({ setResult, surveyReset, templateURL }) {
const saveONServer = useSaveOnServer();

useEffect(() => {
requestPOST(survey.data, UUID);
postRequest(survey.data, UUID);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [saveONServer, UUID]);

Expand Down Expand Up @@ -82,10 +83,9 @@ function SurveyComponent({ setResult, surveyReset, templateURL }) {
survey.applyTheme(themeJson);

survey.onComplete.add(function (sender, options) {
console.log(JSON.stringify(sender.data, null, 3));
setResult(sender.data);
options.showSaveInProgress();
requestPOST(sender.data, UUID);
postRequest(sender.data, UUID);
});
return <Survey model={survey} />;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const requestPOST = (data, uuid) => {
export const postRequest = (data, uuid) => {
if (uuid) {
fetch(`https://api.ramanchada.ideaconsult.net/template/${uuid}`, {
method: "POST",
Expand Down

0 comments on commit acb2069

Please sign in to comment.