Skip to content

Commit

Permalink
🔀 Merge #471 to deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Aug 27, 2024
2 parents 441ef3c + da9ddac commit fbe0504
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 19 deletions.
66 changes: 47 additions & 19 deletions components/IscnRegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,25 @@
</div>
</div>
<!-- type -->
<FormField :label="$t('IscnRegisterForm.label.type')" class="mb-[12px]">
<Selector
class="h-[40px] w-[160px]"
:options="typeOptions"
:placeholder="defaultType"
@input="setType"
/>
</FormField>
<div class="flex justify-between mb-[12px]">
<FormField :label="$t('IscnRegisterForm.label.type')">
<Selector
class="h-[40px] w-[160px]"
:options="typeOptions"
:placeholder="defaultType"
@input="setType"
/>
</FormField>
<FormField v-if="isBookType" :label="$t('IscnRegisterForm.label.language')">
<Selector
class="h-[40px] w-[160px]"
:options="languageOptions"
:placeholder="defaultLanguage"
@input="setLanguage"
/>
</FormField>
</div>

<Divider class="my-[12px]" />
<!-- form fieldset -->
<div>
Expand Down Expand Up @@ -691,19 +702,24 @@ export default class IscnRegisterForm extends Vue {
@walletModule.Action('initIfNecessary') initIfNecessary!: () => Promise<any>
typeOptions = [
'Book',
'Photo',
'Image',
'CreativeWork',
]
'Book',
'Photo',
'Image',
'CreativeWork',
]
fileTypeOptions = [
'epub',
'pdf',
'audio',
'jpg',
'png',
]
'epub',
'pdf',
'audio',
'jpg',
'png',
]
languageOptions = [
'zh',
'en',
]
licenseMap: { [key: string]: string | null } = {
'Copyright. All rights reserved.': 'All Rights Reserved',
Expand Down Expand Up @@ -850,6 +866,10 @@ export default class IscnRegisterForm extends Vue {
return 'CreativeWork'
}
get defaultLanguage() {
return this.epubMetadata?.language || 'zh'
}
get authorDialogTitle() {
return this.currentAuthorDialogType === AuthorDialogType.author
? this.$t('IscnRegisterForm.title.editAuthor')
Expand Down Expand Up @@ -1053,6 +1073,10 @@ export default class IscnRegisterForm extends Vue {
return arweaveIdList
}
get isBookType() {
return this.type === 'Book'
}
@Watch('payload', { immediate: true, deep: true })
change() {
this.debouncedCalculateISCNFee()
Expand Down Expand Up @@ -1237,6 +1261,10 @@ export default class IscnRegisterForm extends Vue {
this.type = value
}
setLanguage(value: string) {
this.language = value
}
setLicense(value: string) {
this.license = value
}
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
"IscnRegisterForm.label.registrant": "Registrant",
"IscnRegisterForm.label.tags": "Tags",
"IscnRegisterForm.label.type": "Type",
"IscnRegisterForm.label.language": "Language",
"IscnRegisterForm.label.content": "Content Info",
"IscnRegisterForm.label.uploading": "Loading files...",
"IscnRegisterForm.label.url": "URL",
Expand Down

0 comments on commit fbe0504

Please sign in to comment.