@@ -2,6 +2,7 @@ import { useState } from "react";
2
2
import { Button , Card , Col , Divider , Form , Input , Row , Skeleton } from "antd" ;
3
3
import { CopyButton } from "../../components/CopyButton" ;
4
4
import { useAleoWASM } from "../../aleo-wasm-hook" ;
5
+ import "./DecryptRecord.css" ;
5
6
6
7
export const DecryptRecord = ( ) => {
7
8
const [ ciphertext , setCiphertext ] = useState ( null ) ;
@@ -81,81 +82,116 @@ export const DecryptRecord = () => {
81
82
ciphertext !== null ? ciphertext . toString ( ) : "" ;
82
83
83
84
return (
84
- < Card
85
- title = "Decrypt Record"
86
- style = { { width : "100%" } }
87
- extra = {
88
- < Button
89
- type = "primary"
90
-
91
- size = "middle"
92
- onClick = { populateForm }
93
- >
94
- Demo
95
- </ Button >
96
- }
97
- >
98
- < Form { ...layout } >
99
- < Form . Item label = "Record (Ciphertext)" colon = { false } >
100
- < Input
101
- name = "recordCiphertext"
102
- size = "large"
103
- placeholder = "Record (Ciphertext)"
104
- allowClear
105
- onChange = { onCiphertextChange }
106
- value = { recordCipherTextString ( ) }
107
- />
108
- </ Form . Item >
109
- < Form . Item label = "View Key" colon = { false } >
110
- < Input
111
- name = "viewKey"
112
- size = "large"
113
- placeholder = "View Key"
114
- allowClear
115
- onChange = { onViewKeyChange }
116
- value = { viewKeyString ( ) }
117
- />
118
- </ Form . Item >
119
- </ Form >
120
- { ciphertext || viewKey ? (
121
- < Row justify = "center" >
122
- < Col >
85
+ < div className = "container" >
86
+ < h1 > Records</ h1 >
87
+ < h2 > Overview</ h2 >
88
+ < ul >
89
+ < li >
90
+ { " " }
91
+ Records are created by Aleo programs and can be used as
92
+ inputs for functions within the same program. Once a
93
+ record is used, it’s consumed and can’t be reused.
94
+ </ li >
95
+ < li >
96
+ Functions that consume records generate new records as
97
+ output.
98
+ </ li >
99
+ < li >
100
+ Records are < strong > private</ strong > by default, tied to
101
+ a single Aleo program and a user's private key.
102
+ </ li >
103
+ < li >
104
+ The < strong > View Key </ strong > is derived from the
105
+ private key and allows users to decrypt their encrypted
106
+ data and prove ownership of that data.
107
+ </ li >
108
+ </ ul >
109
+
110
+ < br />
111
+ < p >
112
+ Try the demo below! Enter a record and
113
+ decrypt it using your View Key to experience how the process
114
+ works. You can also click the "Show Demo" button on the
115
+ right to generate an example.
116
+ </ p >
117
+
118
+ < br />
119
+
120
+ < Card
121
+ title = "Decrypt Record"
122
+ style = { { width : "100%" } }
123
+ extra = {
124
+ < >
123
125
< Button
124
-
126
+ type = "primary"
125
127
size = "middle"
126
- onClick = { clearForm }
128
+ onClick = { populateForm }
127
129
>
128
- Clear
130
+ Show Demo
129
131
</ Button >
130
- </ Col >
131
- </ Row >
132
- ) : null }
133
- {
132
+ </ >
133
+ }
134
+ >
134
135
< Form { ...layout } >
135
- < Divider />
136
- < Form . Item label = "Record (Plaintext)" colon = { false } >
137
- { plaintext ? (
138
- < Row align = "middle" >
139
- < Col span = { 23 } >
140
- < Input . TextArea
141
- size = "large"
142
- rows = { 10 }
143
- placeholder = "Record (Plaintext)"
144
- value = { recordPlaintext ( ) }
145
- disabled
146
- />
147
- </ Col >
148
- < Col span = { 1 } align = "middle" >
149
- < CopyButton data = { recordPlaintext ( ) } />
150
- </ Col >
151
- </ Row >
152
- ) : (
153
- < Skeleton active />
154
- ) }
136
+ < Form . Item label = "Record (Ciphertext)" colon = { false } >
137
+ < Input
138
+ name = "recordCiphertext"
139
+ size = "large"
140
+ placeholder = "Record (Ciphertext)"
141
+ allowClear
142
+ onChange = { onCiphertextChange }
143
+ value = { recordCipherTextString ( ) }
144
+ />
145
+ </ Form . Item >
146
+ < Form . Item label = "View Key" colon = { false } >
147
+ < Input
148
+ name = "viewKey"
149
+ size = "large"
150
+ placeholder = "View Key"
151
+ allowClear
152
+ onChange = { onViewKeyChange }
153
+ value = { viewKeyString ( ) }
154
+ />
155
155
</ Form . Item >
156
156
</ Form >
157
- }
158
- </ Card >
157
+ { ciphertext || viewKey ? (
158
+ < Row justify = "center" >
159
+ < Col >
160
+ < Button size = "middle" onClick = { clearForm } >
161
+ Clear
162
+ </ Button >
163
+ </ Col >
164
+ </ Row >
165
+ ) : null }
166
+ {
167
+ < Form { ...layout } >
168
+ < Divider />
169
+ < Form . Item label = "Record (Plaintext)" colon = { false } >
170
+ { plaintext ? (
171
+ < Row align = "middle" >
172
+ < Col span = { 23 } >
173
+ < Input . TextArea
174
+ size = "large"
175
+ rows = { 10 }
176
+ placeholder = "Record (Plaintext)"
177
+ value = { recordPlaintext ( ) }
178
+ disabled
179
+ />
180
+ </ Col >
181
+ < Col span = { 1 } align = "middle" >
182
+ < CopyButton
183
+ data = { recordPlaintext ( ) }
184
+ />
185
+ </ Col >
186
+ </ Row >
187
+ ) : (
188
+ < Skeleton active />
189
+ ) }
190
+ </ Form . Item >
191
+ </ Form >
192
+ }
193
+ </ Card >
194
+ </ div >
159
195
) ;
160
196
} else {
161
197
return (
0 commit comments