-
-
Notifications
You must be signed in to change notification settings - Fork 366
feat: Create select page into modal #11510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ddd78f3
feat: Create select page into modal
Jarsen136 3dabbb5
feat: create modal test case
Jarsen136 32bbee7
Merge branch 'main' into issue-11506
Jarsen136 69e1a98
Merge branch 'main' into issue-11506
Jarsen136 4093cf3
fix: create entry modal
Jarsen136 279f1da
fix: e2t test
Jarsen136 fd41e7b
fix: path
Jarsen136 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,102 @@ | ||
<template> | ||
<NeoModal | ||
append-to-body | ||
:value="isModalActive" | ||
@close="isModalActive = false" | ||
> | ||
<NeoModalHead | ||
:title="$t('create')" | ||
@close="isModalActive = false" | ||
/> | ||
<div class=" px-6 pt-6 pb-5"> | ||
<div class="space-y-4"> | ||
<div | ||
v-for="item in createOptionsConfig" | ||
:key="item.path" | ||
:data-testid="item.testId" | ||
class="cursor-pointer max-w-[316px] w-full bg-k-grey-light border border-k-grey-light hover:bg-blue-light-cards hover:border-k-blue-hover px-[20px] py-2 flex items-center group" | ||
@click="onClickCreateOption(item.path)" | ||
> | ||
<KIcon | ||
:name="item.icon" | ||
size="medium" | ||
class="text-k-grey group-hover:text-k-blue" | ||
/> | ||
<div class="text-left ml-4"> | ||
<div class=""> | ||
{{ item.title }} | ||
</div> | ||
<div class="text-sm text-k-grey"> | ||
{{ item.description }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="text-center text-sm text-k-grey mt-[20px]"> | ||
{{ $t('mint.modal.availableOn', ['Ahp', 'Ahk']) }} | ||
hassnian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</div> | ||
</div> | ||
</NeoModal> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { NeoModal, NeoModalHead } from '@kodadot1/brick' | ||
|
||
type CreateConfig = { | ||
path: string | ||
icon: string | ||
title: string | ||
description: string | ||
testId?: string | ||
} | ||
|
||
const props = defineProps<{ | ||
modelValue: boolean | ||
}>() | ||
|
||
const emit = defineEmits<{ | ||
(e: 'update:modelValue', value: boolean): void | ||
}>() | ||
hassnian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const { doAfterLogin } = useDoAfterlogin() | ||
const { urlPrefix } = usePrefix() | ||
const { $i18n } = useNuxtApp() | ||
const isModalActive = computed({ | ||
get: () => props.modelValue, | ||
set: value => emit('update:modelValue', value), | ||
}) | ||
Jarsen136 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const onClickCreateOption = (path: string) => { | ||
isModalActive.value = false | ||
doAfterLogin({ | ||
onLoginSuccess: () => { | ||
navigateTo({ path }) | ||
}, | ||
}) | ||
} | ||
|
||
const createOptionsConfig = computed<CreateConfig[]>(() => [ | ||
{ | ||
path: '/create/nft', | ||
icon: 'i-mdi:image-outline', | ||
title: $i18n.t('mint.modal.createSingle'), | ||
description: $i18n.t('mint.modal.createSingleDesc'), | ||
testId: 'create-landing-single-nft-button', | ||
}, | ||
{ | ||
path: `/${urlPrefix}/massmint`, | ||
icon: 'i-mdi:image-multiple-outline', | ||
title: $i18n.t('mint.modal.createMultiple'), | ||
description: $i18n.t('mint.modal.createMultipleDesc'), | ||
testId: 'create-landing-multiple-nft-button', | ||
}, | ||
{ | ||
path: '/create/collection', | ||
icon: 'i-mdi:folder-open', | ||
title: $i18n.t('mint.modal.createCollection'), | ||
description: $i18n.t('mint.modal.createCollectionDesc'), | ||
testId: 'create-landing-collection-button', | ||
}, | ||
]) | ||
</script> |
This file contains hidden or 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 |
---|---|---|
@@ -1,21 +1,30 @@ | ||
<template> | ||
<div> | ||
<nuxt-link | ||
<div | ||
data-testid="classic" | ||
:to="`/${urlPrefix}/create`" | ||
class="navbar-item" | ||
@click="emit('select')" | ||
@click="handleButtonClick" | ||
> | ||
{{ $t('create') }} | ||
</nuxt-link> | ||
</div> | ||
<CreateModal | ||
v-model="isModalActive" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import CreateModal from '@/components/create/CreateModal.vue' | ||
hassnian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
defineProps<{ | ||
chain: string | ||
}>() | ||
const emit = defineEmits(['select']) | ||
|
||
const { urlPrefix } = usePrefix() | ||
const isModalActive = ref(false) | ||
|
||
const handleButtonClick = () => { | ||
isModalActive.value = true | ||
emit('select') | ||
} | ||
</script> |
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.