4
4
:style =" cardStyles" >
5
5
<div class =" content" >
6
6
7
- <div class =" text " >
7
+ <div class =" title-wrapper " >
8
8
9
9
<IconPieChartIcon />
10
10
11
11
<div v-if =" title" class =" title" >
12
12
{{ title }}
13
13
</div >
14
14
15
- <div v-if =" description" class =" description" >
16
- {{ description }}
17
- </div >
18
15
19
16
</div >
20
17
18
+ <div v-if =" description" class =" description" >
19
+ {{ description }}
20
+ </div >
21
+
21
22
<div class =" signup-form" >
22
23
23
24
<div class =" name-fields" >
58
59
{{ selected.label }}
59
60
</p >
60
61
<p v-else class =" toggle-button-label" >
61
- Select an option
62
+ Country
62
63
</p >
63
64
</div >
64
65
</template >
104
105
</template >
105
106
</ZeroDropdown >
106
107
108
+ <ZeroButton
109
+ class =" submit-button"
110
+ @clicked =" submitForm" >
111
+ <span class =" button-label" > Register </span >
112
+ </ZeroButton >
113
+
107
114
</div >
108
115
109
116
</div >
110
117
</div >
111
118
</template >
112
119
113
120
<script setup>
121
+ const SINGULARITY_DEMO_SIGNUPS_TOKEN = import .meta.env.VITE_AIRTABLE_SINGULARITY_DEMO_TOKEN
114
122
// ======================================================================= Props
115
123
const props = defineProps ({
116
124
signupCard: {
@@ -124,7 +132,7 @@ const props = defineProps({
124
132
const firstName = ref (false )
125
133
const lastName = ref (false )
126
134
const email = ref (false )
127
- const org = ref (false )
135
+ const organization = ref (false )
128
136
const country = ref (false )
129
137
const filecoinFamiliarity = ref (false )
130
138
@@ -169,7 +177,7 @@ const updateInputValue = (val, field) => {
169
177
email .value = val
170
178
break
171
179
case ' org' :
172
- org .value = val
180
+ organization .value = val
173
181
break
174
182
}
175
183
}
@@ -190,6 +198,36 @@ const selectOption = (setSelected, closePanel, option, field) => {
190
198
}
191
199
}
192
200
}
201
+ /**
202
+ * @method submitForm
203
+ */
204
+ const submitForm = async () => {
205
+ if (firstName .value && lastName .value && email .value && organization .value && country .value && filecoinFamiliarity .value ) {
206
+ const body = {
207
+ records: [
208
+ {
209
+ fields: {
210
+ email: email .value ,
211
+ firstName: firstName .value ,
212
+ lastName: lastName .value ,
213
+ organization: organization .value ,
214
+ country: country .value .label ,
215
+ filecoinFamiliarity: filecoinFamiliarity .value
216
+ }
217
+ }
218
+ ]
219
+ }
220
+ const headers = {
221
+ ' Content-Type' : ' application/json' ,
222
+ ' Authorization' : ` Bearer ${ SINGULARITY_DEMO_SIGNUPS_TOKEN } `
223
+ }
224
+ await $fetch (' https://api.airtable.com/v0/apphbQmrNLNNXiaqG/tblDUSr66nczukX9Y' , {
225
+ method: ' POST' ,
226
+ body,
227
+ headers
228
+ })
229
+ }
230
+ }
193
231
</script >
194
232
195
233
<style lang="scss" scoped>
0 commit comments