Skip to content
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

(beta): 32% of December 2024 Fig 💜 #11232

Merged
merged 116 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
dca9973
✨ swap page landing
roiLeo Oct 23, 2024
2d4c882
✨ wip: swap page Step 2
roiLeo Oct 23, 2024
ca66655
✨ wip: swap page Step 2
roiLeo Oct 24, 2024
0fe2f3d
✨ wip: swap page Step 2 list
roiLeo Oct 24, 2024
6bff9f9
✨ wip: steps flow final
roiLeo Oct 24, 2024
1f9219c
Merge branch 'main' into feature/init/swapLanding
roiLeo Oct 30, 2024
1938f80
ref(swap): move simialr logic into smaller components
hassnian Nov 6, 2024
5d08758
add(swaps): store add item logic
hassnian Nov 6, 2024
5071fdb
add(offers): store multichain support
hassnian Nov 6, 2024
bc35ebd
ref(useAtomicSwapAction.ts): cleaner and null check
hassnian Nov 6, 2024
75041cd
add(swaps): add connect wallet button if wallet is not disconnected
hassnian Nov 7, 2024
1923237
add(swaps): swap middleware & review step
hassnian Nov 7, 2024
6e0c279
add(swaps): pesist store and step
hassnian Nov 7, 2024
d0d6ad3
add(swaps): init `createSwap` transaction
hassnian Nov 9, 2024
4db3059
ref(swaps): preview and fix surcharge per step
hassnian Nov 10, 2024
21b362c
fix(swap/Preview.vue): step based `surchargeDirection`
hassnian Nov 10, 2024
e843fea
fix(swaps): `getSwapStepRouteName` util
hassnian Nov 10, 2024
e568190
add(swaps): `swapId` in route
hassnian Nov 11, 2024
55c153f
fix(swaps): `surcharge` amount
hassnian Nov 11, 2024
57ca110
add(swaps): grid list filters
hassnian Nov 11, 2024
82846e9
fix(swaps): collection grid filter owner prop
hassnian Nov 12, 2024
5768199
ref(CollectionFilter.vue): query overfetching collection details
hassnian Nov 12, 2024
40f6996
add(swaps): selection cart sticky when scrolling
hassnian Nov 12, 2024
d40dbc3
🔧 ts warning swapgridlistfilter
roiLeo Nov 12, 2024
386a3f3
fix(swaps): network dropdown filter by vm & correct route redirect
hassnian Nov 12, 2024
8fe626a
fix(swaps): chain redirect pass swapId query
hassnian Nov 12, 2024
3a2193d
ref(swaos): transaction force 1:1 nft swaps
hassnian Nov 13, 2024
a124524
ref(swaps): selection disable next button if is over 1:1 swap
hassnian Nov 13, 2024
5018234
Merge branch 'feature/init/swapLanding' of https://github.com/roiLeo/…
hassnian Nov 13, 2024
4323ab1
ref(swaps): move `SwapStep` to `components/swap/types`
hassnian Nov 13, 2024
36dd75e
ref(swaps): layout and code duplication
hassnian Nov 13, 2024
e82f84a
ref(swaps): preview cart item
hassnian Nov 13, 2024
9442a8a
ref(swaps): pass `step` as prop to `Preview.vue`
hassnian Nov 14, 2024
618d5d2
ref(swaps): singular `swap` store name
hassnian Nov 14, 2024
bbf5219
add(swaps): allow logged out swap first steps
hassnian Nov 14, 2024
e09b5a5
fix(swaps): `isItemSelected` computed
hassnian Nov 14, 2024
e5fe925
ref(swaps): review step use `updateSwap` to update swap store
hassnian Nov 14, 2024
1da4f5c
fix(swap): `review.vue` redirect on success
hassnian Nov 14, 2024
a08d281
🔧 improve responsive
roiLeo Nov 14, 2024
dacbace
🔧 missing swap review hr
roiLeo Nov 14, 2024
f90a84a
🔧 swap selection to tailwind
roiLeo Nov 14, 2024
8b80fdb
🔧 swap review to tailwind
roiLeo Nov 14, 2024
caf0042
Merge branch 'main' into feature/init/swapLanding
hassnian Nov 26, 2024
3fdd846
🔧 resolve conflicts
roiLeo Nov 27, 2024
dc4b34e
fix(useChainRedirect.ts): can't change chain on profile page
hassnian Nov 28, 2024
ea494ae
fix: `redirectAfterChainChange` on route with `prefix`
hassnian Nov 28, 2024
29df0fc
fix(swaps): expiration selector not showing in review page
hassnian Nov 28, 2024
6064ae5
fix: only collection issuer can edit nft
Jarsen136 Nov 28, 2024
44e74a2
fix: collection current owner
Jarsen136 Nov 28, 2024
2d63c95
fix(swaps): `surcharge` not being saved
hassnian Nov 29, 2024
d1b1204
ref: removed comments
hassnian Nov 29, 2024
10c0408
fix: profile interactions test
hassnian Nov 29, 2024
2b64376
Merge pull request #11196 from Jarsen136/issue-11195
vikiival Nov 29, 2024
aef3417
Merge branch 'main' into issue-11197
Jarsen136 Nov 29, 2024
d741f2d
feat: Collection Edit: Support Name Update and Description Update
Jarsen136 Nov 29, 2024
4a2fae8
Merge branch 'main' into feature/init/swapLanding
hassnian Nov 30, 2024
45a2041
fix(swaps): trade modal successful transaction transalation details
hassnian Nov 30, 2024
fc1155e
fix(transactions): `ActionAcceptOffer` type
hassnian Nov 30, 2024
032aaf3
fix(swaps): transaction translations
hassnian Nov 30, 2024
3848be3
Merge pull request #11198 from hassnian/issue-11197
hassnian Nov 30, 2024
ce9a90b
feat: Item Edit: Limit Name and Image Update
Jarsen136 Dec 1, 2024
55a6c88
Merge branch 'main' into feature/init/swapLanding
hassnian Dec 2, 2024
874e602
feat: undo edit nft
Jarsen136 Dec 2, 2024
70ae8a6
chore: remove class
Jarsen136 Dec 2, 2024
e99b32a
Merge branch 'main' into issue-11143
Jarsen136 Dec 2, 2024
e1c2281
ref: init `UserCartModal` component
hassnian Dec 3, 2024
51b7484
chore: update translation
Jarsen136 Dec 3, 2024
6d8dd9f
Update composables/transaction/transactionCreateSwap.ts
hassnian Dec 3, 2024
2004e2a
fix(UserCartModal.vue): missing `exectTransaction` function
hassnian Dec 3, 2024
894f666
fix(ItemTransferModal.vue): `isYourAddress` invalid not working
hassnian Dec 3, 2024
d902547
ref(UserCartModal.vue): `submit` function
hassnian Dec 3, 2024
f8790a4
ref(UserCartModal.vue): add `title` and `signingTitle` props
hassnian Dec 3, 2024
c5d5839
ref(UserCartModal.vue): add `mode` prop`
hassnian Dec 3, 2024
6f64c71
chore: deepscan
Jarsen136 Dec 3, 2024
b430d04
Merge branch 'issue-11143' of github.com:Jarsen136/nft-gallery into i…
Jarsen136 Dec 3, 2024
1d91b2b
add: 🔥 mass burn modal
hassnian Dec 4, 2024
c27e4c9
Update components/collection/EditModal.vue
vikiival Dec 4, 2024
7193ac9
Merge pull request #11199 from Jarsen136/issue-11143
vikiival Dec 4, 2024
eaad18c
Merge pull request #11200 from Jarsen136/issue-11156
vikiival Dec 4, 2024
9595a1d
[skip ci] updated code diagram
kkukelka Dec 4, 2024
cb28193
Merge pull request #11206 from kodadot/action
vikiival Dec 4, 2024
f46d5d6
feat: collection Edit - Limit Name and Image Update
Jarsen136 Dec 4, 2024
aa99edf
ref(transactions): remove `NFTs.BURN_MULTIPLE` action and added `Item…
hassnian Dec 4, 2024
3e79ec0
Merge branch 'main' into issue-11201
hassnian Dec 4, 2024
27d3923
Merge branch 'main' into feature/init/swapLanding
hassnian Dec 5, 2024
3b2f086
fix(ListingCartMini.vue): disable `burn` if it's not available
hassnian Dec 5, 2024
75026f8
ref(ItemBurnModal.vue): add `acknowledge` checkbox
hassnian Dec 5, 2024
c2dbba7
fix(transactions): `burn nft` on `evm` missing `abi`
hassnian Dec 5, 2024
bf548a8
Merge pull request #11207 from Jarsen136/limit-collection-edit-field
Jarsen136 Dec 5, 2024
f2cba01
Merge branch 'main' into issue-11201
hassnian Dec 5, 2024
63f898e
fix: deepscan local variable not used.
hassnian Dec 6, 2024
cbc7748
Merge branch 'issue-11201' of https://github.com/hassnian/nft-gallery…
hassnian Dec 6, 2024
d78ae74
ref(codeclimate): Similar blocks of code found in multiple locations
hassnian Dec 6, 2024
892381a
ref(UserCartModal.vue): removed duplicate notification by adding `sho…
hassnian Dec 6, 2024
c57f661
ref(ItemBurnModal.vue): use `checkbox` label prop
hassnian Dec 6, 2024
2df7408
Merge branch 'main' into issue-11192
hassnian Dec 6, 2024
6842ba7
remove: watch `getPrefixByAddress`
hassnian Dec 6, 2024
574e4ee
fix(profile): route redirect on wallet connect
hassnian Dec 6, 2024
f30179d
fix(AddressInput.vue): `strict` prop as `optional`
hassnian Dec 7, 2024
40fe6f3
Merge pull request #11208 from hassnian/issue-11201
vikiival Dec 7, 2024
ee70ff5
Merge branch 'main' into feature/init/swapLanding
hassnian Dec 8, 2024
af1194a
Merge branch 'main' into issue-11192
hassnian Dec 9, 2024
9c6aacf
Merge pull request #11163 from roiLeo/feature/init/swapLanding
vikiival Dec 9, 2024
e1cfc12
✨ profile Swaps button
roiLeo Dec 9, 2024
462d25f
✨ Profile swap btn visible only on authorized prefix
roiLeo Dec 9, 2024
3f733fc
fix(create/nft): minting error
hassnian Dec 10, 2024
f3e9b9c
fix(CreateNft.vue): mint action types
hassnian Dec 10, 2024
47f1d34
🔧 handleSwapPageRedirect on profile details
roiLeo Dec 10, 2024
6e3b3fd
🔧 handleSwapPageRedirect . value
roiLeo Dec 10, 2024
1e0cf84
add(WalletAssetMenu.vue): `Swap` button
hassnian Dec 10, 2024
3406afe
Merge branch 'main' into issue-11192
hassnian Dec 10, 2024
ce72171
fix(ConnectWalletModal.vue): constant typo
hassnian Dec 10, 2024
9e61fdb
Merge pull request #11225 from hassnian/issue-11218
vikiival Dec 10, 2024
b654924
Merge pull request #11223 from roiLeo/feature/profile/SwapsButton
vikiival Dec 10, 2024
44bf46c
Merge pull request #11193 from hassnian/issue-11192
vikiival Dec 10, 2024
7467051
Merge pull request #11231 from hassnian/issue-11216
vikiival Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions assets/svg/swap/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions assets/svg/swap/arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions assets/svg/swap/arrows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 59 additions & 13 deletions components/collection/EditModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,45 @@
class="flex flex-col gap-6"
@submit.prevent
>
<CollectionEditSection :title="$t('edit.collection.image.label')">
<FormLogoField
v-model:file="image"
v-model:url="imageUrl"
:title="$t('edit.collection.image.message')"
<NeoField
:label="$t('mint.collection.name.label')"
required
:error="!name"
>
<NonRecommendFieldNotification
:show="name && nameChanged"
@undo="name = props.collection.name"
>
<NeoInput
v-model="name"
required
:placeholder="$t('mint.collection.name.placeholder')"
/>
</NonRecommendFieldNotification>
</NeoField>

<!-- collection description -->
<NeoField :label="$t('mint.collection.description.label')">
<NeoInput
v-model="description"
type="textarea"
has-counter
maxlength="1000"
height="10rem"
:placeholder="$t('mint.collection.description.placeholder')"
/>
</NeoField>
<CollectionEditSection :title="$t('edit.collection.image.label')">
<NonRecommendFieldNotification
:show="hasImageChanged"
@undo="initLogoImage"
>
<FormLogoField
v-model:file="image"
v-model:url="imageUrl"
:title="$t('edit.collection.image.message')"
/>
</NonRecommendFieldNotification>
</CollectionEditSection>

<CollectionEditSection :title="$t('edit.collection.banner.label')">
Expand Down Expand Up @@ -131,6 +164,8 @@ const props = defineProps<{

const isModalActive = useVModel(props, 'modelValue')

const name = ref<string>()
const description = ref<string>()
const image = ref<File>()
const banner = ref<File>()
const imageUrl = ref<string>()
Expand All @@ -140,20 +175,30 @@ const unlimited = ref(true)
const min = computed(() => props.min || 1)
const max = ref<number | null>(null)

const nameChanged = computed(() => props.collection.name !== name.value)
const hasImageChanged = computed(() => (!imageUrl.value && Boolean(props.collection.image)) || Boolean(image.value))
const originalLogoImageUrl = computed(() => sanitizeIpfsUrl(props.collection.image))

const disabled = computed(() => {
const hasImage = imageUrl.value
const isNameFilled = Boolean(name.value)

const hasImagechanged = (!imageUrl.value && Boolean(props.collection?.image)) || Boolean(image.value)
const hasBannerChanged = (!bannerUrl.value && Boolean(props.collection?.banner)) || Boolean(banner.value)
const hasMaxChanged = max.value !== props.collection?.max
const descriptionChanged = props.collection.description !== description.value
const hasBannerChanged = (!bannerUrl.value && Boolean(props.collection.banner)) || Boolean(banner.value)
const hasMaxChanged = max.value !== props.collection.max

return !hasImage || (!hasImagechanged && !hasBannerChanged && !hasMaxChanged)
return !hasImage || !isNameFilled || (!nameChanged.value && !descriptionChanged && !hasImageChanged.value && !hasBannerChanged && !hasMaxChanged)
})

const initLogoImage = () => {
imageUrl.value = originalLogoImageUrl.value
image.value = undefined
}

const editCollection = async () => {
emit('submit', {
name: props.collection.name,
description: props.collection.description,
name: name.value,
description: description.value,
image: image.value || props.collection.image,
imageType: props.collection.imageType,
banner: bannerUrl.value ? banner.value || props.collection.banner : undefined,
Expand All @@ -163,10 +208,11 @@ const editCollection = async () => {

watch(isModalActive, (value) => {
if (value && props.collection) {
imageUrl.value = sanitizeIpfsUrl(props.collection.image)
name.value = props.collection.name
description.value = props.collection.description
bannerUrl.value = props.collection.banner && sanitizeIpfsUrl(props.collection.banner)
image.value = undefined
banner.value = undefined
initLogoImage()
unlimited.value = !props.collection.max
max.value = props.collection.max
}
Expand Down
4 changes: 2 additions & 2 deletions components/collection/HeroButtonDeleteNfts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</template>

<script setup lang="ts">
import { Interaction } from '@kodadot1/minimark/v1'
import { NeoDropdownItem } from '@kodadot1/brick'
import { NFTs } from '@/composables/transaction/types'

type NftIds = {
nfts?: {
Expand Down Expand Up @@ -53,7 +53,7 @@ const deleteNfts = async () => {
isLoading.value = true

await transaction({
interaction: NFTs.BURN_MULTIPLE,
interaction: Interaction.CONSUME,
nftIds: ids,
urlPrefix: urlPrefix.value,
})
Expand Down
12 changes: 6 additions & 6 deletions components/collection/HeroButtonEditCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
/>

<CollectionEditModal
v-if="collectinoMetadata"
v-if="collectionMetadata"
v-model="isModalActive"
:collection="collectinoMetadata"
:collection="collectionMetadata"
:min="collection.nftCount"
@submit="editCollection"
/>
Expand All @@ -37,7 +37,7 @@ const route = useRoute()

const isModalActive = ref(false)

const collectinoMetadata = computed(() =>
const collectionMetadata = computed(() =>
props.collection
? {
name: props.collection.meta.name,
Expand All @@ -61,7 +61,7 @@ const updateMetadata = (a: UpdateCollection, b: UpdateCollection) => {
const editCollection = async (collection: UpdateCollection) => {
isModalActive.value = false

if (!collectinoMetadata.value) {
if (!collectionMetadata.value) {
return
}

Expand All @@ -70,8 +70,8 @@ const editCollection = async (collection: UpdateCollection) => {
collectionId: route.params.id.toString(),
collection,
update: {
metadata: updateMetadata(collection, collectinoMetadata.value),
max: collection.max !== collectinoMetadata.value.max,
metadata: updateMetadata(collection, collectionMetadata.value),
max: collection.max !== collectionMetadata.value.max,
},
urlPrefix: urlPrefix.value,
successMessage: $i18n.t('edit.collection.success'),
Expand Down
1 change: 1 addition & 0 deletions components/collection/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export type CollectionEntityMinimal = {
name: string
currentOwner: string
type: string
ownerCount?: number
}
22 changes: 13 additions & 9 deletions components/common/ChainDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<template #trigger="{ active }">
<NeoButton
class="chain-dropdown-text"
:variant
:label="
isMobile || !showNetworkLabel
? selected?.text
? label || selected?.text
: `Network: ${selected?.text}`
"
:icon="active ? 'chevron-up' : 'chevron-down'"
Expand All @@ -27,28 +28,32 @@
</template>

<script setup lang="ts">
import { NeoButton, NeoDropdown, NeoDropdownItem } from '@kodadot1/brick'
import { NeoButton, NeoDropdown, NeoDropdownItem, type NeoButtonVariant } from '@kodadot1/brick'
import { type Prefix } from '@kodadot1/static'

const props = withDefaults(
defineProps<{
showNetworkLabel: boolean
position?: 'bottom-auto'
redirect?: boolean
exclude: Prefix[]
exclude?: Prefix[]
variant?: NeoButtonVariant
label?: string
filterByVm?: boolean
}>(),
{
showNetworkLabel: true,
position: undefined,
redirect: true,
mobileModal: false,
exclude: () => [],
filterByVm: false,
},
)

const route = useReactiveRoute()
const { setUrlPrefix, urlPrefix } = usePrefix()
const { availableChains: allChains } = useChain()
const { availableChains: allChains, availableChainsByVm: allChainInVm } = useChain()
const { redirectAfterChainChange } = useChainRedirect()
const { isMobile } = useViewport()

Expand All @@ -58,11 +63,10 @@ const selected = computed(() =>
allChains.value.find(chain => chain.value === prefix.value),
)

const availableChains = computed(() =>
allChains.value.filter(
chain => !props.exclude.includes(chain.value as Prefix),
),
)
const availableChains = computed(() => {
return (props.filterByVm ? allChainInVm.value : allChains.value)
.filter(chain => !props.exclude.includes(chain.value as Prefix))
})

function onSwitchChain(chain) {
setUrlPrefix(chain)
Expand Down
8 changes: 6 additions & 2 deletions components/common/ConnectWallet/ConnectWalletModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ import WalletAsset from '@/components/common/ConnectWallet/WalletAsset.vue'
import { ModalCloseType } from '@/components/navbar/types'
import { arePrefixesOfSameVm } from '@/utils/config/chain.config'

const NO_PREFIX_CHANGE_ROUTES_NAMES = [
'prefix-u-id',
]

const emit = defineEmits(['close', 'connect'])
const props = defineProps<{ preselected?: ChainVM }>()
const { isWalletModalOpen } = useWallet()

const route = useRoute()
const { urlPrefix, setUrlPrefix } = usePrefix()
const { redirectAfterChainChange } = useChainRedirect()
const walletStore = useWalletStore()
Expand All @@ -76,7 +80,7 @@ const setAccount = ({ account, prefix }: { account: WalletAccount, prefix?: Pref
walletStore.setWallet(account)
identityStore.setAuth({ address: account.address })

if (!arePrefixesOfSameVm(prefix, urlPrefix.value)) {
if (!arePrefixesOfSameVm(prefix, urlPrefix.value) && !NO_PREFIX_CHANGE_ROUTES_NAMES.includes(route.name?.toString() || '')) {
setUrlPrefix(prefix)
redirectAfterChainChange(urlPrefix.value)
}
Expand Down
24 changes: 7 additions & 17 deletions components/common/ConnectWallet/WalletAssetMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@
import { NeoDropdown, NeoDropdownItem, NeoIcon } from '@kodadot1/brick'
import type { Prefix } from '@kodadot1/static'
import { langsFlags, setUserLocale } from '@/utils/config/i18n'
import { transferVisible, teleportVisible } from '@/utils/config/permission.config'
import { transferVisible, teleportVisible, swapVisible } from '@/utils/config/permission.config'

const { urlPrefix } = usePrefix()
// const { isAssetHub } = useIsChain(urlPrefix)
const { neoModal } = useProgrammatic()
const { $i18n } = useNuxtApp()

const menus = ref<{ label: string, to: string, check: (v: Prefix) => boolean }[]>([
{
Expand All @@ -99,23 +99,13 @@ const menus = ref<{ label: string, to: string, check: (v: Prefix) => boolean }[]
to: `/${urlPrefix.value}/teleport`,
check: teleportVisible,
},
{
label: $i18n.t('swap.swap'),
to: `/${urlPrefix.value}/swap`,
check: swapVisible,
},
])

// TODO: enable when asset hub offers are ready
// watchEffect(() => {
// if (isAssetHub.value) {
// menus.value.push({
// label: 'Incoming Offers',
// to: `/${urlPrefix.value}/incomingoffers`,
// })

// menus.value.push({
// label: 'Assets',
// to: `/${urlPrefix.value}/assets`,
// })
// }
// })

const filteredMenus = computed(() =>
menus.value.filter(menu => menu.check(urlPrefix.value)),
)
Expand Down
Loading
Loading