Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 29c4cab

Browse files
committed
Can append hashtag after the name
1 parent 6cc98bb commit 29c4cab

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/components/rmrk/Create/SimpleMint.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
spellcheck="true"
124124
></b-input>
125125
</b-field>
126+
<BasicSwitch v-model="postfix" label="mint.expert.postfix" />
126127
</CollapseWrapper>
127128
</b-field>
128129
<b-field>
@@ -224,7 +225,8 @@ const components = {
224225
Loader: () => import('@/components/shared/Loader.vue'),
225226
ArweaveUploadSwitch: () => import('./ArweaveUploadSwitch.vue'),
226227
CollapseWrapper: () =>
227-
import('@/components/shared/collapse/CollapseWrapper.vue')
228+
import('@/components/shared/collapse/CollapseWrapper.vue'),
229+
BasicSwitch: () => import('@/components/shared/form/BasicSwitch.vue'),
228230
}
229231
230232
@Component<SimpleMint>({
@@ -288,6 +290,7 @@ export default class SimpleMint extends Mixins(
288290
private hasCarbonOffset = true;
289291
protected arweaveUpload = false;
290292
protected batchAdresses = '';
293+
protected postfix = false;
291294
292295
protected updateMeta(value: number) {
293296
console.log(typeof value, value)
@@ -382,8 +385,11 @@ export default class SimpleMint extends Mixins(
382385
const result = NFTUtils.generateRemarks(
383386
this.rmrkMint,
384387
accountId,
385-
version
388+
version,
389+
false,
390+
this.postfix ? (name: string, index: number) => `${name} #${index + 1}` : undefined
386391
) as MintType
392+
387393
const cb = api.tx.utility.batchAll
388394
const remarks: string[] = Array.isArray(result)
389395
? result

src/components/rmrk/service/NftUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ class NFTUtils {
130130
}
131131

132132

133-
public static generateRemarks(mint: SimpleNFT, caller: string, version = '1.0.0', encode?: boolean): MintType | string[] {
133+
public static generateRemarks(mint: SimpleNFT, caller: string, version = '1.0.0', encode?: boolean, updateName?: (name: string, index: number) => string ): MintType | string[] {
134134
const collection = NFTUtils.createCollection(caller, mint.symbol, mint.name, mint.metadata, mint.max, version)
135-
const nfts = Array(mint.max).fill(null).map((e, i) => NFTUtils.createNFT(caller, i, mint.symbol, mint.name, mint.metadata))
135+
const nfts = Array(mint.max).fill(null).map((e, i) => NFTUtils.createNFT(caller, i, mint.symbol, updateName ? updateName(mint.name, i) : mint.name, mint.metadata))
136136

137137
if (encode) {
138138
return [NFTUtils.encodeCollection(collection, version), ...nfts.map(nft => NFTUtils.encodeNFT(nft, version))]

src/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@
200200
"show": "Show advanced settings",
201201
"hide": "Hide advanced settings",
202202
"count": "Currently matched {0} adresses",
203-
"countGlitch": "You have more adresses than available editions. This can cause a problem. Consider to set EDITION field to at least to {0}"
203+
"countGlitch": "You have more adresses than available editions. This can cause a problem. Consider to set EDITION field to at least to {0}",
204+
"postfix": "Add hashtag and index after the name (e.g #1)"
204205
}
205206
},
206207
"tooltip": {

0 commit comments

Comments
 (0)