-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into neoinput-tailwindcss
- Loading branch information
Showing
79 changed files
with
1,645 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<template> | ||
<NeoModal :value="value" @close="value = false"> | ||
<div class="py-4 px-5 limit-width"> | ||
<div class="is-flex mb-3 is-size-6 has-text-weight-bold"> | ||
{{ 'Customize Collection' }} | ||
</div> | ||
<div class="has-text-grey is-size-7 mb-5"> | ||
This will update the Maximum items in your collection | ||
</div> | ||
<!-- collection max nfts --> | ||
<NeoField | ||
:label="$t('Maximum NFTs in collection')" | ||
data-testid="collection-maxAmount" | ||
required> | ||
<div class="w-full"> | ||
<NeoInput | ||
v-model="max" | ||
type="number" | ||
:placeholder="`${min} is the minimum`" | ||
:min="min" /> | ||
</div> | ||
</NeoField> | ||
<div class="is-flex is-justify-content-flex-end"> | ||
<NeoButton | ||
class="has-text-weight-bold mr-4" | ||
variant="text" | ||
no-shadow | ||
@click="customizeCollection"> | ||
<span class="has-text-k-green"> | ||
{{ $t('Update') }} | ||
</span> | ||
</NeoButton> | ||
<NeoButton | ||
class="has-text-weight-bold" | ||
variant="text" | ||
no-shadow | ||
:label="$t('cancel')" | ||
@click="value = false" /> | ||
</div> | ||
</div> | ||
</NeoModal> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { NeoButton, NeoField, NeoInput, NeoModal } from '@kodadot1/brick' | ||
import { Collections } from '@/composables/transaction/types' | ||
const { $updateLoader } = useNuxtApp() | ||
const { transaction, status } = useTransaction() | ||
const { urlPrefix } = usePrefix() | ||
const route = useRoute() | ||
const props = defineProps<{ | ||
modelValue: boolean | ||
min: number | ||
max: number | ||
}>() | ||
const emit = defineEmits(['update:value', 'customize']) | ||
const value = useVModel(props, 'modelValue') | ||
const min = computed(() => props.min || 1) | ||
const max = ref(props.max) | ||
const customizeCollection = async () => { | ||
emit('customize') | ||
$updateLoader(true) | ||
await transaction({ | ||
interaction: Collections.SET_MAX_SUPPLY, | ||
collectionId: route.params.id.toString(), | ||
urlPrefix: urlPrefix.value, | ||
max: Number(max.value), | ||
}) | ||
if (status.value === TransactionStatus.Finalized) { | ||
$updateLoader(false) | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.limit-width { | ||
max-width: 314px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<NeoDropdownItem | ||
:disabled="max" | ||
@click="customizeCollectionModalActive = true"> | ||
{{ $i18n.t('moreActions.customize') }} | ||
</NeoDropdownItem> | ||
|
||
<CollectionCustomizeModal | ||
v-model="customizeCollectionModalActive" | ||
:min="min" | ||
:max="max" | ||
@customize="closeModal" /> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { NeoDropdownItem } from '@kodadot1/brick' | ||
withDefaults( | ||
defineProps<{ | ||
min: number | ||
max: number | ||
}>(), | ||
{ | ||
min: undefined, | ||
max: undefined, | ||
}, | ||
) | ||
const { $i18n } = useNuxtApp() | ||
const customizeCollectionModalActive = ref(false) | ||
const closeModal = () => { | ||
customizeCollectionModalActive.value = false | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.