Skip to content

Commit

Permalink
Button and cards set to match 'execute' (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
KendrickDrews authored Sep 14, 2023
1 parent 2b2f35a commit 537003f
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 110 deletions.
6 changes: 1 addition & 5 deletions website/src/tabs/account/AccountFromPrivateKey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export const AccountFromPrivateKey = () => {
return (
<Card
title="Load Account from Private Key"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%" }}
>
<Form {...layout}>
<Form.Item label="Private Key" colon={false}>
Expand All @@ -44,7 +43,6 @@ export const AccountFromPrivateKey = () => {
placeholder="Private Key"
allowClear
onChange={onChange}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
</Form>
Expand All @@ -59,7 +57,6 @@ export const AccountFromPrivateKey = () => {
addonAfter={
<CopyButton
data={viewKey()}
style={{ borderRadius: "20px" }}
/>
}
disabled
Expand All @@ -73,7 +70,6 @@ export const AccountFromPrivateKey = () => {
addonAfter={
<CopyButton
data={address()}
style={{ borderRadius: "20px" }}
/>
}
disabled
Expand Down
5 changes: 1 addition & 4 deletions website/src/tabs/account/AddressFromViewKey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const AddressFromViewKey = () => {
return (
<Card
title="Load Address from View Key"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%" }}
>
<Form {...layout}>
<Form.Item label="View Key" colon={false}>
Expand All @@ -38,7 +37,6 @@ export const AddressFromViewKey = () => {
placeholder="View Key"
allowClear
onChange={onChange}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
</Form>
Expand All @@ -53,7 +51,6 @@ export const AddressFromViewKey = () => {
addonAfter={
<CopyButton
data={address()}
style={{ borderRadius: "20px" }}
/>
}
disabled
Expand Down
6 changes: 2 additions & 4 deletions website/src/tabs/account/NewAccount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ export const NewAccount = () => {
return (
<Card
title="Create a New Account"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%" }}
>
<Row justify="center">
<Col>
<Button
type="primary"
shape="round"
size="large"
onClick={generateAccount}
loading={!!loading}
Expand All @@ -48,7 +46,7 @@ export const NewAccount = () => {
</Button>
</Col>
<Col offset="1">
<Button shape="round" size="large" onClick={clear}>
<Button size="large" onClick={clear}>
Clear
</Button>
</Col>
Expand Down
5 changes: 1 addition & 4 deletions website/src/tabs/account/SignMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export const SignMessage = () => {
return (
<Card
title="Sign a Message"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%" }}
>
<Form {...layout}>
<Form.Item label="Private Key" colon={false}>
Expand All @@ -55,7 +54,6 @@ export const SignMessage = () => {
placeholder="Private Key"
allowClear
onChange={onKeyChange}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
<Form.Item label="Message" colon={false}>
Expand All @@ -65,7 +63,6 @@ export const SignMessage = () => {
placeholder="Message"
value={messageString()}
allowClear={true}
style={{ borderRadius: "20px" }}
onChange={onMessageChange}
/>
</Form.Item>
Expand Down
6 changes: 1 addition & 5 deletions website/src/tabs/account/VerifyMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ export const VerifyMessage = () => {
return (
<Card
title="Verify a Message"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%"}}
>
<Form {...layout}>
<Form.Item label="Address" colon={false}>
Expand All @@ -78,7 +77,6 @@ export const VerifyMessage = () => {
placeholder="Address"
allowClear
onChange={onAddressChange}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
<Form.Item label="Message" colon={false}>
Expand All @@ -87,7 +85,6 @@ export const VerifyMessage = () => {
size="large"
placeholder="Message"
value={messageString()}
style={{ borderRadius: "20px" }}
onChange={onMessageChange}
/>
</Form.Item>
Expand All @@ -102,7 +99,6 @@ export const VerifyMessage = () => {
size="large"
placeholder="Signature"
value={signatureString()}
style={{ borderRadius: "20px" }}
onChange={onSignatureChange}
/>
</Form.Item>
Expand Down
8 changes: 1 addition & 7 deletions website/src/tabs/advanced/DecryptAccount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export const DecryptAccount = () => {
return (
<Card
title="Decrypt Account Ciphertext with Password"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%" }}
>
<Form {...layout}>
<Form.Item label="Private Key Ciphertext" colon={false}>
Expand All @@ -73,7 +72,6 @@ export const DecryptAccount = () => {
placeholder="Private Key Ciphertext"
allowClear
onChange={onCiphertextChange}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
<Form.Item
Expand All @@ -87,7 +85,6 @@ export const DecryptAccount = () => {
size="large"
placeholder="Password"
onChange={onPasswordChange}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
</Form>
Expand All @@ -102,7 +99,6 @@ export const DecryptAccount = () => {
addonAfter={
<CopyButton
data={privateKey()}
style={{ borderRadius: "20px" }}
/>
}
disabled
Expand All @@ -116,7 +112,6 @@ export const DecryptAccount = () => {
addonAfter={
<CopyButton
data={viewKey()}
style={{ borderRadius: "20px" }}
/>
}
disabled
Expand All @@ -130,7 +125,6 @@ export const DecryptAccount = () => {
addonAfter={
<CopyButton
data={address()}
style={{ borderRadius: "20px" }}
/>
}
disabled
Expand Down
7 changes: 2 additions & 5 deletions website/src/tabs/advanced/EncryptAccount.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ export const EncryptAccount = () => {
return (
<Card
title="Create a New Account"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%"}}
>
<Row justify="center">
<Col>
<Button
type="primary"
shape="round"
size="large"
onClick={generateAccount}
loading={!!loading}
Expand All @@ -73,7 +71,7 @@ export const EncryptAccount = () => {
</Button>
</Col>
<Col offset="1">
<Button shape="round" size="large" onClick={clear}>
<Button size="large" onClick={clear}>
Clear
</Button>
</Col>
Expand Down Expand Up @@ -125,7 +123,6 @@ export const EncryptAccount = () => {
<Col>
<Button
type="primary"
shape="round"
size="large"
onClick={encryptAccount}
>
Expand Down
59 changes: 35 additions & 24 deletions website/src/tabs/develop/Deploy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ import {
Spin,
Space,
} from "antd";
import { CodeEditor } from "./execute/CodeEditor.jsx";
import axios from "axios";

export const Deploy = () => {

const [form] = Form.useForm();
const [deploymentFeeRecord, setDeploymentFeeRecord] = useState(null);
const [deployUrl, setDeployUrl] = useState("https://vm.aleo.org/api");
const [deploymentFee, setDeploymentFee] = useState("1");
Expand Down Expand Up @@ -132,7 +135,7 @@ export const Deploy = () => {
setLoading(false);
setTransactionID(null);
setDeploymentError(null);
setProgram(
await onLoadProgram(
"program hello_hello.aleo;\n" +
"\n" +
"function hello:\n" +
Expand All @@ -142,6 +145,14 @@ export const Deploy = () => {
" output r2 as u32.private;\n",
);
};
const onLoadProgram = async (value) => {
if (value) {
form.setFieldsValue({
program: value,
});
await onProgramChange(value);
}
};

const onUrlChange = (event) => {
if (event.target.value !== null) {
Expand All @@ -150,10 +161,11 @@ export const Deploy = () => {
return deployUrl;
};

const onProgramChange = (event) => {
if (event.target.value !== null) {
setProgram(event.target.value);
}
const onProgramChange = (value) => {
// if (event.target.value !== null) {
// setProgram(event.target.value);
// }
setProgram(value);
setTransactionID(null);
setDeploymentError(null);
return program;
Expand Down Expand Up @@ -201,34 +213,33 @@ export const Deploy = () => {
return (
<Card
title="Deploy Program"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%"}}
extra={
<Button
type="primary"
shape="round"
size="middle"
onClick={demo}
>
Demo
</Button>
}
>
<Form {...layout}>
<Form
form={form}
{...layout}>
<Divider />
<Form.Item label="Program" colon={false}>
<Input.TextArea
size="large"
rows={10}
placeholder="Program"
style={{
whiteSpace: "pre-wrap",
overflowWrap: "break-word",
}}
value={programString()}
onChange={onProgramChange}
/>
</Form.Item>
<Form.Item
label="Program"
name="program"
rules={[
{
required: true,
message: "Please input or load an Aleo program",
},
]}
>
<CodeEditor onChange={onProgramChange} />
</Form.Item>
<Divider />
<Form.Item
label="Private Key"
Expand Down Expand Up @@ -287,7 +298,7 @@ export const Deploy = () => {
<Space>
<Button
type="primary"
shape="round"

size="middle"
onClick={deploy}
>
Expand All @@ -296,7 +307,7 @@ export const Deploy = () => {
{contextHolder}
<Button
type="primary"
shape="round"

size="middle"
onClick={estimate}
>
Expand Down
10 changes: 4 additions & 6 deletions website/src/tabs/develop/ExecuteLegacy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,11 @@ export const ExecuteLegacy = () => {
return (
<Card
title="Execute Program"
style={{ width: "100%", borderRadius: "20px" }}
bordered={false}
style={{ width: "100%" }}
extra={
<Button
type="primary"
shape="round"

size="middle"
onClick={demo}
>
Expand All @@ -413,7 +412,6 @@ export const ExecuteLegacy = () => {
onSearch={onSearch}
onChange={onChange}
value={programIDString()}
style={{ borderRadius: "20px" }}
/>
</Form.Item>
</Form>
Expand Down Expand Up @@ -546,7 +544,7 @@ export const ExecuteLegacy = () => {
<Space>
<Button
type="primary"
shape="round"

size="middle"
onClick={execute}
>
Expand All @@ -556,7 +554,7 @@ export const ExecuteLegacy = () => {
{executeOnline && (
<Button
type="primary"
shape="round"

size="middle"
onClick={estimate}
>
Expand Down
Loading

0 comments on commit 537003f

Please sign in to comment.