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

fix: #4302 add wallet name #4476

Merged
merged 26 commits into from
Dec 13, 2022

Conversation

petersopko
Copy link
Contributor

@petersopko petersopko commented Dec 11, 2022

Thank you for your contribution to the KodaDot NFT gallery.

👇 _ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality
  • I've posted a screenshot of demonstrated change in this PR

Optional

  • I've tested it at </bsx/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Had issue bounty label?

  • Fill up your KSM address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.
KodaDot.-.Kusama.NFT.Market.Explorer._.Low.Carbon.NFTs.-.Google.Chrome.2022-12-11.12-57-54.mp4

@petersopko petersopko requested a review from a team as a code owner December 11, 2022 12:06
@petersopko petersopko requested review from preschian and removed request for a team December 11, 2022 12:06
@kodabot
Copy link
Collaborator

kodabot commented Dec 11, 2022

SUCCESS @petersopko PR for issue #4302 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

@netlify
Copy link

netlify bot commented Dec 11, 2022

Deploy Preview for koda-nuxt ready!

Name Link
🔨 Latest commit dcd3d07
🔍 Latest deploy log https://app.netlify.com/sites/koda-nuxt/deploys/639893210e75690009312f69
😎 Deploy Preview https://deploy-preview-4476--koda-nuxt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@petersopko
Copy link
Contributor Author

one thing left when it comes to functionality: changing wallet doesn't update the name in the dropdown, it updates only after refreshing the page. I've spent some time on how to do this and I have only stupid ideas, I'd appreciate some hints here 🥺

@petersopko
Copy link
Contributor Author

@exezbcz btw, I have included your comments regarding the dividers etc., one question tho, shouldn't the blue color change on hover? I couldn't figure it out from the design.

@exezbcz
Copy link
Member

exezbcz commented Dec 11, 2022

@exezbcz btw, I have included your comments regarding the dividers etc., one question tho, shouldn't the blue color change on hover? I couldn't figure it out from the design.

yup, we can add this color on hover, it isnt in the handoff files yet.
#B6CBFF

Working file is a mess :D Visit only the handoffs

@yangwao
Copy link
Member

yangwao commented Dec 11, 2022

What about balance part?

image

@petersopko
Copy link
Contributor Author

What about balance part?

image

Must've missed that, I somehow didn't get this requirement from issue name / desc 😆 working on it.

@yangwao
Copy link
Member

yangwao commented Dec 11, 2022

Anyway I've logged in, and this is not the name of my account :D

image

@yangwao yangwao added the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Dec 11, 2022
@petersopko
Copy link
Contributor Author

Anyway I've logged in, and this is not the name of my account :D

image

oh okay, that's actually unrelated to this PR, also on beta, and caused by recent one here:

@daiagi would you please create supplemental PR to your fix, so it doesn't break identity?

I've reverted it and it works, it seems that identity is getting passed as empty object from IdentityIndex.vue

image

@@ -26,6 +26,21 @@ export const getKsmPrice = async (): Promise<void> => {
}
}

export const getBsxPrice = async (): Promise<void> => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@petersopko
Copy link
Contributor Author

needs some more styling + storing basilisk/usd price (hopefully tomorrow evening).
image

@yangwao when it comes to USD price previews, basilisk is listed on coingecko, but not sure about tnkr, do we want to show that here? maybe hide tnkr for now ?

@yangwao
Copy link
Member

yangwao commented Dec 12, 2022

oh okay, that's actually unrelated to this PR, also on beta, and caused by recent one here:

oh good catch, my bad 🧐 haven't tested it properly everywhere

do we want to show that here? maybe hide tnkr for now ?

ah yes if price is not available we will be showing iirc "--" in current design.

yes lot of tokens on lbp at some extent won't have USD price

@yangwao
Copy link
Member

yangwao commented Dec 12, 2022

let's refactor utils and let's go?

@petersopko
Copy link
Contributor Author

let's refactor utils and let's go?

working on it, for some reason I can't fetch my KSM balance on RMRK. Doesn't work on kodadot.xyz, beta or local, idk.

},
}

export const actions: ActionTree<WalletState, WalletState> = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 3 locations. Consider refactoring.

getWalletName: ({ wallet }: any) => wallet.name,
}

export const mutations: MutationTree<WalletState> = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.


export type WalletState = ReturnType<typeof state>

export const getters: GetterTree<WalletState, WalletState> = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Dec 13, 2022

Code Climate has analyzed commit 358fba5 and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 5

View more on Code Climate.

@petersopko
Copy link
Contributor Author

currently testable at snek/bsx with various wallets.

todo:

  • get ksm balance and show it in similar fashion. as I described, I'm currently not able to fetch KSM balance, it seems to be broken at prod and beta as well
  • hide the whole asset section in case there are only 0 balance assets
  • cleanup + style touchup

@daiagi
Copy link
Contributor

daiagi commented Dec 13, 2022

@petersopko
I've been exploring the issue you mentioned where my PR broke onchain identity and:

  1. you were right, it does.
  2. I have yet to understand why it breaks it or how to fix it

one thing left when it comes to functionality: changing wallet doesn't update the name in the dropdown, it updates only after refreshing the page. I've spent some time on how to do this and I have only stupid ideas, I'd appreciate some hints here pleading_face

same here

@petersopko
Copy link
Contributor Author

same here

I have solved issue with reactive wallet name by storing the wallet name in store, which is reactive when accessed through getters in components, i.e.

  get userWalletName(): string {
    return this.$store.getters['wallet/getWalletName']
  }

@yangwao
Copy link
Member

yangwao commented Dec 13, 2022

why is there prefix My ?

image

todo:

image

yes, we can do follow-up, 14 changed files are bit frightening to me 😅 this never went well with complex changes

Otherwise is mergable I guess?

components/identity/module/IdentityLink.vue Outdated Show resolved Hide resolved
components/navbar/ProfileDropdown.vue Outdated Show resolved Hide resolved
<Identity
:address="account"
class="navbar__address is-size-6"
hide-identity-popover />
</b-dropdown-item>

<hr class="dropdown-divider mx-4" aria-role="menuitem" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally would not have moved <hr /> tags to component

Comment on lines 9 to 10
<th class="has-text-grey">Asset</th>
<th class="has-text-grey">Balance</th>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<th class="has-text-grey">Asset</th>
<th class="has-text-grey">Balance</th>
<th class="has-text-grey">{{ $t('assets') }}</th>
<th class="has-text-grey">{{ $t('general.balance') }}</th>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be possible to move this file outside `/rmrk' folder?

styles/themes/_dark.scss Outdated Show resolved Hide resolved
@petersopko
Copy link
Contributor Author

why is there prefix My ?

image

I thought that's what was in design, so it should be just ${walletName} wallet? Or just ${walletName}?

todo:

image

yes, we can do follow-up, 14 changed files are bit frightening to me 😅 this never went well with complex changes

Otherwise is mergable I guess?

Not mergeable yet, please let me implement feedback by @roiLeo 🙏🏻 and clean up a little.

@yangwao
Copy link
Member

yangwao commented Dec 13, 2022

just ${walletName}?

yes

Comment on lines +1068 to +1070
"asset": "Asset",
"balance": "Balance",
"noAssets": "There are currently no assets in this wallet."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move asset & noAssets in

"general": { ... }

@yangwao
Copy link
Member

yangwao commented Dec 13, 2022

Seems https://github.com/kodadot/nft-gallery/pull/4476/files#diff-a4a33e7ecfb7969dbf41700112aa3cf6f2880fe4a397f3faececd4a001e67384 is copy of https://github.com/kodadot/nft-gallery/blob/main/components/bsx/Asset/AssetList.vue ?

I mean, I'm a bit against copying functions over file and duplicating code.

I'm merging it because this was the very last issue to have it released; otherwise, I dislike the code approach ignoring DRY approach.

pay 60 USD

@yangwao
Copy link
Member

yangwao commented Dec 13, 2022

😍 Perfect, I’ve sent the payout
💵 $60 @ 29.12 USD/KSM ~ 2.06 $KSM
🧗 FNyt7T1xdbhN7dagf7yGYCRJuE3R45VmTCE3tjzy1rKxa7y
🔗 0x190ecd6efea6a858e7132ad5d3c3418a91daa43f1824e71ca3ef9d1d61d66f9b

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Dec 13, 2022
@yangwao yangwao merged commit e22bdde into kodadot:main Dec 13, 2022
@petersopko
Copy link
Contributor Author

dislike the code approach ignoring DRY approach

pay 60 USD

I'm not too fond of the state in which it got merged in either, and I wish I had time to clean up/finish. Maybe next time :)

@roiLeo roiLeo mentioned this pull request Dec 14, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid S-changes-requested-🤞 PR is almost good to go, just some fine tunning
Projects
None yet
7 participants