From 692ddd691f7d2e8b917f3515d19edc24d7fe1660 Mon Sep 17 00:00:00 2001 From: Adesojisouljay Date: Thu, 12 Jan 2023 22:56:08 +0100 Subject: [PATCH 1/6] proposal-creation --- src/common/api/operations.ts | 32 +++ src/common/app.tsx | 9 +- .../components/create-proposal/index.scss | 10 + .../components/create-proposal/index.tsx | 213 ++++++++++++++++++ src/common/pages/proposals.tsx | 11 +- src/common/routes.ts | 1 + src/style/_components.scss | 1 + 7 files changed, 275 insertions(+), 2 deletions(-) create mode 100644 src/common/components/create-proposal/index.scss create mode 100644 src/common/components/create-proposal/index.tsx diff --git a/src/common/api/operations.ts b/src/common/api/operations.ts index 69c3266a4f8..eb1bfcafebd 100644 --- a/src/common/api/operations.ts +++ b/src/common/api/operations.ts @@ -1090,6 +1090,38 @@ export const proposalVoteKc = (account: string, proposal: number, approve: boole return keychain.broadcast(account, [op], "Active"); }; +export const createProposal = ( + account: string, + receiver: string, + start: any, + end: any, + dailyPay: any, + subject: string, + link: string + ) => { + const op: Operation = [ + "create_proposal", + { + creator: account, + receiver: receiver, + start_date: start, + end_date: end, + daily_pay: { + amount: dailyPay, + precision: 3, + // nai: "@@000000013" + }, + subject: subject, + permlink: link + } + ] + console.log(op) + + keychain.broadcast(account, [op], "Active") + .then(result => console.log(result)) + .catch(err => console.log(err)); +} + export const subscribe = ( username: string, community: string diff --git a/src/common/app.tsx b/src/common/app.tsx index fb47877eef5..4f9640b33f7 100644 --- a/src/common/app.tsx +++ b/src/common/app.tsx @@ -23,6 +23,7 @@ import { pageMapDispatchToProps, pageMapStateToProps } from "./pages/common"; import { connect } from "react-redux"; import loadable from "@loadable/component"; import Announcement from "./components/announcement"; +import { ProposalCreationContainer } from "./components/create-proposal"; // Define lazy pages const ProfileContainer = loadable(() => import("./pages/profile-functional")); @@ -38,7 +39,7 @@ const WitnessesContainer = loadable(() => import("./pages/witnesses")); const WitnessesPage = (props: any) => ; const AuthContainer = loadable(() => import("./pages/auth")); -const AuthPage = (props: any) => ; +const AuthPage = (props: any) => ; const SubmitContainer = loadable(() => import("./pages/submit")); const SubmitPage = (props: any) => ; @@ -132,6 +133,12 @@ const App = (props: any) => { path={routes.PROPOSAL_DETAIL} component={ProposalDetailContainer} /> + diff --git a/src/common/components/create-proposal/index.scss b/src/common/components/create-proposal/index.scss new file mode 100644 index 00000000000..04699c74e75 --- /dev/null +++ b/src/common/components/create-proposal/index.scss @@ -0,0 +1,10 @@ +.create-proposal{ + flex-direction: column; + padding: 10px; +} + +.date-picker{ + width: 50%; + display: inline-block; + padding: 5px; +} diff --git a/src/common/components/create-proposal/index.tsx b/src/common/components/create-proposal/index.tsx new file mode 100644 index 00000000000..694593fb65a --- /dev/null +++ b/src/common/components/create-proposal/index.tsx @@ -0,0 +1,213 @@ +import React, { Fragment, useEffect, useState } from "react"; +import { Link } from "react-router-dom"; +import { connect } from "react-redux"; +import Theme from "../theme"; +import NavBar from "../navbar"; +import LinearProgress from "../linear-progress"; +import { _t } from "../../i18n"; +import { pageMapDispatchToProps, pageMapStateToProps } from "../../pages/common"; +import { Button, Form } from "react-bootstrap"; +import { createProposal } from "../../api/operations"; +import communitySelector from "../community-selector"; +import { ActiveUser } from "../../store/active-user/types"; + +interface Props { + activeUser: ActiveUser | null; + } + +const ProposalCreationPage = (props: any) => { + const { activeUser } = props; + + const [loading, setLoading] = useState(true); + const [formInput, steFormInput] = useState({}); + const [error, setError] = useState({}) + + useEffect(() => { + setLoading(false) + }, []) + + const handleFormError = () => { + const { receiver,subject, start, end, funding, link } = formInput; + const newError: any = {}; + + if(!receiver || receiver === "") newError.receiver = "Please enter receiver" + if(!subject || subject === "") newError.subject = "Please enter subject" + if(!start || start === "") newError.start = "Please select start date" + if(!end || end === "") newError.end = "Please select end date" + if(!funding || funding === "") newError.funding = "Please enter funding amount" + if(!link || link === "") newError.link = "Please enter post link" + + return newError; + } + + const handleChange = (field: any, value: any) => { + steFormInput({ + ...formInput, + [field]:value + }); + + if(!!error){ + setError({ + ...error, + [field]:null + }) + }; + } + + const onSubmit = (e: any) => { + e.preventDefault(); + const formErrors = handleFormError(); + if(Object.keys(formErrors).length > 0){ + setError(formErrors) + } else { + createProposal( + activeUser.username, + formInput.receiver, + formInput.start, + formInput.end, + formInput.funding, + formInput.subject, + formInput.link) + } + + }; + + if (loading) { + return ( + <> + + + ); + } + + return ( + <> +
+ + { NavBar({ ...props })} +
+
+
+

Create Proposal

+
+ + Creator Username + handleChange("username", e.target.value)} + /> + + {error.username} + + + + Proposal Description + handleChange("subject", e.target.value)} + /> + + {error.subject} + + + + Post Link + handleChange("link", e.target.value)} + /> + + {error.link} + + + + Daily Funding (HBD) + handleChange("funding", e.target.value)} + /> + + {error.funding} + + + + Total Amount + handleChange("total", e.target.value)} + /> + + {error.total} + + + + Select Start Date + handleChange("start", e.target.value)} + /> + + {error.start} + + + + Select End Date + handleChange("end", e.target.value)} + /> + + {error.end} + + + + Receiver + handleChange("receiver", e.target.value)} + /> + + {error.receiver} + + + + + +
+
+
+ + ); +} + +export const ProposalCreationContainer = connect( + pageMapStateToProps, + pageMapDispatchToProps +)(ProposalCreationPage); diff --git a/src/common/pages/proposals.tsx b/src/common/pages/proposals.tsx index 5c12bbc3559..db2e951774b 100644 --- a/src/common/pages/proposals.tsx +++ b/src/common/pages/proposals.tsx @@ -43,6 +43,8 @@ import parseDate from "../helper/parse-date"; import { closeSvg } from "../img/svg"; import moment from "moment"; +import { Button } from "react-bootstrap"; +// import { CreateProposal } from "../components/create-proposal"; enum Filter { ALL = "all", @@ -306,7 +308,14 @@ class ProposalsPage extends BaseComponent { ); })} - + +
+ + + +
+ + {(() => { if (inProgress) { diff --git a/src/common/routes.ts b/src/common/routes.ts index 09da21a6d4f..54129f1632c 100644 --- a/src/common/routes.ts +++ b/src/common/routes.ts @@ -37,5 +37,6 @@ export default { WITNESSES: `/witnesses`, PROPOSALS: `/proposals`, PROPOSAL_DETAIL: `/proposals/:id(\\d+)`, + PROPOSAL_CREATE: `/:section(proposals)/:create`, PURCHASE: "/purchase" }; diff --git a/src/style/_components.scss b/src/style/_components.scss index 62d2989a1af..414e78da1b8 100644 --- a/src/style/_components.scss +++ b/src/style/_components.scss @@ -55,6 +55,7 @@ @import "../common/components/login"; @import "../common/components/comment"; @import "../common/components/comment-engagement"; +@import "../common/components/create-proposal"; @import "../common/components/transfer"; @import "../common/components/or-divider"; @import "../common/components/notifications"; From 5093979cd807207b23788b3664518614dad2aa05 Mon Sep 17 00:00:00 2001 From: Adesojisouljay Date: Mon, 16 Jan 2023 14:44:29 +0100 Subject: [PATCH 2/6] form fields --- .../components/create-proposal/index.tsx | 83 ++++++++++++------- src/common/i18n/locales/en-US.json | 17 ++++ 2 files changed, 70 insertions(+), 30 deletions(-) diff --git a/src/common/components/create-proposal/index.tsx b/src/common/components/create-proposal/index.tsx index 694593fb65a..8d4dd4108c2 100644 --- a/src/common/components/create-proposal/index.tsx +++ b/src/common/components/create-proposal/index.tsx @@ -8,7 +8,6 @@ import { _t } from "../../i18n"; import { pageMapDispatchToProps, pageMapStateToProps } from "../../pages/common"; import { Button, Form } from "react-bootstrap"; import { createProposal } from "../../api/operations"; -import communitySelector from "../community-selector"; import { ActiveUser } from "../../store/active-user/types"; interface Props { @@ -16,11 +15,13 @@ interface Props { } const ProposalCreationPage = (props: any) => { - const { activeUser } = props; + // const { activeUser } = props; const [loading, setLoading] = useState(true); const [formInput, steFormInput] = useState({}); - const [error, setError] = useState({}) + const [error, setError] = useState({}); + const [hbdBalanceError, setHbdBalanceError] = useState(false); + const [totalDays, setTotalDays] = useState(0) useEffect(() => { setLoading(false) @@ -52,13 +53,30 @@ const ProposalCreationPage = (props: any) => { [field]:null }) }; + const days = getDateDifference(formInput.start, formInput.end); + setTotalDays(days); + + }; + + const getDateDifference = (start: any, end: any) => { + const startDate = new Date(start); + const endDate = new Date(end); + const difference: any = endDate.getTime() - startDate.getTime(); + const daysDifference: number = difference / (1000 * 3600 * 24); + console.log(daysDifference) + return daysDifference } const onSubmit = (e: any) => { + console.log(formInput) + const { activeUser } = props; + const hbdBalance = Number(props.activeUser.data.hbd_balance.replace("HBD","")) e.preventDefault(); const formErrors = handleFormError(); if(Object.keys(formErrors).length > 0){ setError(formErrors) + } else if ( hbdBalance < 10 ){ + setHbdBalanceError(true) } else { createProposal( activeUser.username, @@ -67,9 +85,10 @@ const ProposalCreationPage = (props: any) => { formInput.end, formInput.funding, formInput.subject, - formInput.link) + formInput.link + ) } - + console.log(formInput) }; if (loading) { @@ -88,15 +107,17 @@ const ProposalCreationPage = (props: any) => {
-

Create Proposal

+

{_t("create-proposal.title")}

+ {hbdBalanceError &&

+ {_t("create-proposal.hbd-balance-error")} +

}
- Creator Username + {_t("create-proposal.creator-username")} handleChange("username", e.target.value)} /> @@ -104,12 +125,12 @@ const ProposalCreationPage = (props: any) => { - Proposal Description + {_t("create-proposal.description")} handleChange("subject", e.target.value)} /> @@ -118,11 +139,11 @@ const ProposalCreationPage = (props: any) => { - Post Link + {_t("create-proposal.link")} handleChange("link", e.target.value)} /> @@ -131,11 +152,11 @@ const ProposalCreationPage = (props: any) => { - Daily Funding (HBD) + {_t("create-proposal.daily-funding")} handleChange("funding", e.target.value)} /> @@ -144,23 +165,25 @@ const ProposalCreationPage = (props: any) => { - Total Amount + {_t("create-proposal.total")} handleChange("total", e.target.value)} + readOnly /> {error.total} - Select Start Date + {_t("create-proposal.start-date")} handleChange("start", e.target.value)} /> @@ -169,10 +192,10 @@ const ProposalCreationPage = (props: any) => { - Select End Date + {_t("create-proposal.end-date")} handleChange("end", e.target.value)} /> @@ -181,11 +204,11 @@ const ProposalCreationPage = (props: any) => { - Receiver + {_t("create-proposal.receiver")} handleChange("receiver", e.target.value)} /> @@ -197,7 +220,7 @@ const ProposalCreationPage = (props: any) => {
diff --git a/src/common/i18n/locales/en-US.json b/src/common/i18n/locales/en-US.json index 9301d8d5857..abb2ad4a24b 100644 --- a/src/common/i18n/locales/en-US.json +++ b/src/common/i18n/locales/en-US.json @@ -1334,6 +1334,23 @@ "daily-budget": "daily budget", "total-budget": "total budget" }, + "create-proposal": { + "title": "Create Proposal", + "hbd-balance-error": "You must have at least 10HBD to submit a proposal", + "creator-username": "Creator", + "description": "Proposal Description", + "subject": "Write a brief subject", + "link": "Post Link", + "link-placeholder": "Enter post link", + "daily-funding": "Daily Funding (HBD)", + "daily-funding-placeholder": "Daily amount", + "total": "Total", + "start-date": "Select Start Date", + "end-date": "Select End Date", + "receiver": "Receiver", + "submit": "Submit Proposal", + "receiver-placeholder": "eg @demo" + }, "gallery": { "title": "Gallery", "copied": "Copied to clipboard" From c1e7f3871198d0e65bb572de766c7f21bea0c200 Mon Sep 17 00:00:00 2001 From: Adesojisouljay Date: Mon, 16 Jan 2023 15:53:24 +0100 Subject: [PATCH 3/6] sign --- src/common/api/operations.ts | 9 ++------- src/common/components/create-proposal/index.tsx | 14 ++++++++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/common/api/operations.ts b/src/common/api/operations.ts index eb1bfcafebd..25f964125d5 100644 --- a/src/common/api/operations.ts +++ b/src/common/api/operations.ts @@ -1098,7 +1098,7 @@ export const createProposal = ( dailyPay: any, subject: string, link: string - ) => { + ): Promise => { const op: Operation = [ "create_proposal", { @@ -1109,17 +1109,12 @@ export const createProposal = ( daily_pay: { amount: dailyPay, precision: 3, - // nai: "@@000000013" }, subject: subject, permlink: link } ] - console.log(op) - - keychain.broadcast(account, [op], "Active") - .then(result => console.log(result)) - .catch(err => console.log(err)); + return broadcastPostingJSON(account, 'amount', op) } export const subscribe = ( diff --git a/src/common/components/create-proposal/index.tsx b/src/common/components/create-proposal/index.tsx index 8d4dd4108c2..709ba9045eb 100644 --- a/src/common/components/create-proposal/index.tsx +++ b/src/common/components/create-proposal/index.tsx @@ -63,12 +63,10 @@ const ProposalCreationPage = (props: any) => { const endDate = new Date(end); const difference: any = endDate.getTime() - startDate.getTime(); const daysDifference: number = difference / (1000 * 3600 * 24); - console.log(daysDifference) return daysDifference } const onSubmit = (e: any) => { - console.log(formInput) const { activeUser } = props; const hbdBalance = Number(props.activeUser.data.hbd_balance.replace("HBD","")) e.preventDefault(); @@ -86,9 +84,17 @@ const ProposalCreationPage = (props: any) => { formInput.funding, formInput.subject, formInput.link - ) + ).then( + (res: any) => { + console.log({res}) + return res; + } + ).catch((e: any) => { + console.log({e}) + return e; + }); + return; } - console.log(formInput) }; if (loading) { From 8500d2f9229ef3de0dc4f375e7437b660004210b Mon Sep 17 00:00:00 2001 From: Adesojisouljay Date: Mon, 30 Jan 2023 15:27:46 +0100 Subject: [PATCH 4/6] fixed calc total --- src/common/api/operations.ts | 12 ++-- .../components/create-proposal/index.tsx | 61 ++++++++----------- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/common/api/operations.ts b/src/common/api/operations.ts index 25f964125d5..ecbb180c075 100644 --- a/src/common/api/operations.ts +++ b/src/common/api/operations.ts @@ -1098,7 +1098,7 @@ export const createProposal = ( dailyPay: any, subject: string, link: string - ): Promise => { + ) => { const op: Operation = [ "create_proposal", { @@ -1106,15 +1106,15 @@ export const createProposal = ( receiver: receiver, start_date: start, end_date: end, - daily_pay: { - amount: dailyPay, - precision: 3, - }, + daily_pay: `${Number(dailyPay).toFixed(3)} HBD`, subject: subject, permlink: link } ] - return broadcastPostingJSON(account, 'amount', op) + keychain.broadcast(account, [op], "Active") + .then(result => console.log(result)) + .catch(err => console.log(err)); + // return broadcastPostingJSON(account, 'amount', op) } export const subscribe = ( diff --git a/src/common/components/create-proposal/index.tsx b/src/common/components/create-proposal/index.tsx index 709ba9045eb..b218b5aa95c 100644 --- a/src/common/components/create-proposal/index.tsx +++ b/src/common/components/create-proposal/index.tsx @@ -8,35 +8,31 @@ import { _t } from "../../i18n"; import { pageMapDispatchToProps, pageMapStateToProps } from "../../pages/common"; import { Button, Form } from "react-bootstrap"; import { createProposal } from "../../api/operations"; -import { ActiveUser } from "../../store/active-user/types"; - -interface Props { - activeUser: ActiveUser | null; - } const ProposalCreationPage = (props: any) => { - // const { activeUser } = props; + const { activeUser } = props; const [loading, setLoading] = useState(true); const [formInput, steFormInput] = useState({}); const [error, setError] = useState({}); const [hbdBalanceError, setHbdBalanceError] = useState(false); - const [totalDays, setTotalDays] = useState(0) + const [total, setTotal] = useState(0); useEffect(() => { setLoading(false) }, []) const handleFormError = () => { - const { receiver,subject, start, end, funding, link } = formInput; + const { receiver,subject, start, end, funding, link, total } = formInput; const newError: any = {}; - if(!receiver || receiver === "") newError.receiver = "Please enter receiver" + // if(!receiver || receiver === "") newError.receiver = "Please enter receiver" if(!subject || subject === "") newError.subject = "Please enter subject" if(!start || start === "") newError.start = "Please select start date" if(!end || end === "") newError.end = "Please select end date" if(!funding || funding === "") newError.funding = "Please enter funding amount" - if(!link || link === "") newError.link = "Please enter post link" + if(!link) newError.link = "Please enter post link" + if(Number(total) <= 0) newError.total = "Invalid amount" return newError; } @@ -53,9 +49,6 @@ const ProposalCreationPage = (props: any) => { [field]:null }) }; - const days = getDateDifference(formInput.start, formInput.end); - setTotalDays(days); - }; const getDateDifference = (start: any, end: any) => { @@ -67,32 +60,23 @@ const ProposalCreationPage = (props: any) => { } const onSubmit = (e: any) => { - const { activeUser } = props; const hbdBalance = Number(props.activeUser.data.hbd_balance.replace("HBD","")) e.preventDefault(); const formErrors = handleFormError(); if(Object.keys(formErrors).length > 0){ setError(formErrors) - } else if ( hbdBalance < 10 ){ + } else if ( hbdBalance < 0.00010 ){ setHbdBalanceError(true) } else { createProposal( activeUser.username, - formInput.receiver, - formInput.start, - formInput.end, + formInput.receiver || activeUser.username, + `${formInput.start}T00:00:00`, + `${formInput.end}T00:00:00`, formInput.funding, formInput.subject, - formInput.link - ).then( - (res: any) => { - console.log({res}) - return res; - } - ).catch((e: any) => { - console.log({e}) - return e; - }); + formInput.link.split("/")[5] + ) return; } }; @@ -164,7 +148,10 @@ const ProposalCreationPage = (props: any) => { placeholder={_t("create-proposal.daily-funding-placeholder")} value={formInput.funding || ""} isInvalid={!!error.funding} - onChange={(e: any) => handleChange("funding", e.target.value)} + onChange={(e: any) => { + handleChange("funding", e.target.value); + setTotal(getDateDifference(formInput.start, formInput.end) * Number(e.target.value)) + }} /> {error.funding} @@ -175,10 +162,10 @@ const ProposalCreationPage = (props: any) => { handleChange("total", e.target.value)} + onChange={() => handleChange("total", Number(total))} readOnly /> @@ -191,7 +178,10 @@ const ProposalCreationPage = (props: any) => { type="date" value={formInput.start || ""} isInvalid={!!error.start} - onChange={(e: any) => handleChange("start", e.target.value)} + onChange={(e: any) => { + handleChange("start", e.target.value); + setTotal(getDateDifference(e.target.value, formInput.end) * Number(formInput.funding)) + }} /> {error.start} @@ -203,7 +193,10 @@ const ProposalCreationPage = (props: any) => { type="date" value={formInput.end || ""} isInvalid={!!error.end} - onChange={(e: any) => handleChange("end", e.target.value)} + onChange={(e: any) => { + handleChange("end", e.target.value) + setTotal(getDateDifference(formInput.start, e.target.value) * Number(formInput.funding)) + }} /> {error.end} From 771b9458dc099e0bfbd82f6eee863731e8dd6d57 Mon Sep 17 00:00:00 2001 From: Adesojisouljay Date: Tue, 31 Jan 2023 14:20:15 +0100 Subject: [PATCH 5/6] validate receiver --- .../components/create-proposal/index.scss | 14 +++-- .../components/create-proposal/index.tsx | 60 +++++++++++++------ 2 files changed, 52 insertions(+), 22 deletions(-) diff --git a/src/common/components/create-proposal/index.scss b/src/common/components/create-proposal/index.scss index 04699c74e75..65de9d5c661 100644 --- a/src/common/components/create-proposal/index.scss +++ b/src/common/components/create-proposal/index.scss @@ -1,10 +1,14 @@ .create-proposal{ + display: flex; flex-direction: column; padding: 10px; -} + width: 75%; + align-self: center; -.date-picker{ - width: 50%; - display: inline-block; - padding: 5px; + .date-picker{ + width: 50%; + display: inline-block; + padding: 5px; + } } + diff --git a/src/common/components/create-proposal/index.tsx b/src/common/components/create-proposal/index.tsx index b218b5aa95c..69e8ccaf185 100644 --- a/src/common/components/create-proposal/index.tsx +++ b/src/common/components/create-proposal/index.tsx @@ -1,5 +1,4 @@ -import React, { Fragment, useEffect, useState } from "react"; -import { Link } from "react-router-dom"; +import React, { Fragment, useCallback, useEffect, useState } from "react"; import { connect } from "react-redux"; import Theme from "../theme"; import NavBar from "../navbar"; @@ -8,6 +7,8 @@ import { _t } from "../../i18n"; import { pageMapDispatchToProps, pageMapStateToProps } from "../../pages/common"; import { Button, Form } from "react-bootstrap"; import { createProposal } from "../../api/operations"; +import { getAccount } from "../../api/hive"; +import _ from "lodash"; const ProposalCreationPage = (props: any) => { const { activeUser } = props; @@ -17,16 +18,17 @@ const ProposalCreationPage = (props: any) => { const [error, setError] = useState({}); const [hbdBalanceError, setHbdBalanceError] = useState(false); const [total, setTotal] = useState(0); + const [receieverData, setReceiverData] = useState(""); + const [receiverError, setReceiverError] = useState("") useEffect(() => { setLoading(false) }, []) const handleFormError = () => { - const { receiver,subject, start, end, funding, link, total } = formInput; + const { subject, start, end, funding, link, total } = formInput; const newError: any = {}; - // if(!receiver || receiver === "") newError.receiver = "Please enter receiver" if(!subject || subject === "") newError.subject = "Please enter subject" if(!start || start === "") newError.start = "Please select start date" if(!end || end === "") newError.end = "Please select end date" @@ -81,16 +83,33 @@ const ProposalCreationPage = (props: any) => { } }; - if (loading) { - return ( - <> - - - ); + const validateccount = async (account: string) => { + setLoading(true) + return getAccount(account) + .then((resp) => { + if (resp) { + console.log(resp) + setReceiverError("") + setReceiverData(resp) + } else { + console.log("user not found") + setReceiverError("user not found") + } + return resp; + }) + .catch((err) => { + console.log(err) + }) + .finally(() => { + setLoading(false) + }); } - + + const delayedVerify = useCallback(_.debounce(validateccount, 3000, { leading: true }), []); + return ( <> + {loading && }
{ NavBar({ ...props })} @@ -98,9 +117,11 @@ const ProposalCreationPage = (props: any) => {

{_t("create-proposal.title")}

+ {hbdBalanceError &&

{_t("create-proposal.hbd-balance-error")}

} +
{_t("create-proposal.creator-username")} @@ -209,18 +230,23 @@ const ProposalCreationPage = (props: any) => { placeholder={_t("create-proposal.receiver-placeholder")} value={formInput.receiver || ""} isInvalid={!!error.receiver} - onChange={(e: any) => handleChange("receiver", e.target.value)} + onChange={(e: any) => { + handleChange("receiver", e.target.value); + delayedVerify(e.target.value) + }} /> - {error.receiver} + {receiverError} - - +
From 86c99bd3af0fd99e017db82d8e52c80668cbfe6d Mon Sep 17 00:00:00 2001 From: Adesojisouljay Date: Tue, 31 Jan 2023 14:23:15 +0100 Subject: [PATCH 6/6] update min Hbd --- src/common/components/create-proposal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/components/create-proposal/index.tsx b/src/common/components/create-proposal/index.tsx index 69e8ccaf185..4347ed35700 100644 --- a/src/common/components/create-proposal/index.tsx +++ b/src/common/components/create-proposal/index.tsx @@ -67,7 +67,7 @@ const ProposalCreationPage = (props: any) => { const formErrors = handleFormError(); if(Object.keys(formErrors).length > 0){ setError(formErrors) - } else if ( hbdBalance < 0.00010 ){ + } else if ( hbdBalance < 10 ){ setHbdBalanceError(true) } else { createProposal(