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

refactor: Navbar Vue composition api #5033

Merged
merged 10 commits into from
Feb 26, 2023
Merged

Conversation

Jarsen136
Copy link
Contributor

@Jarsen136 Jarsen136 commented Feb 17, 2023

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

reduce LOC from 318 to 268

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

Did your issue had any of the "$" label on it?

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

@Jarsen136 Jarsen136 requested a review from a team as a code owner February 17, 2023 04:22
@Jarsen136 Jarsen136 requested review from roiLeo and vikiival and removed request for a team February 17, 2023 04:22
@kodabot
Copy link
Collaborator

kodabot commented Feb 17, 2023

SUCCESS @Jarsen136 PR for issue #5015 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 Feb 17, 2023

Deploy Preview for koda-nuxt ready!

Name Link
🔨 Latest commit 6a02f2d
🔍 Latest deploy log https://app.netlify.com/sites/koda-nuxt/deploys/63fb447bfc68a900087528da
😎 Deploy Preview https://deploy-preview-5033--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.

Copy link
Contributor

@roiLeo roiLeo left a comment

Choose a reason for hiding this comment

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

Strange behavior when I click in searchbar
Screenshot 2023-02-17 at 08-52-31 KodaDot Low fees and low carbon minting KodaDot - NFT Market Explorer

Not happening on beta idk if it's related.

note: Should we keep import since Nuxt provide auto-imported components?

otherwise lgtm

components/Navbar.vue Outdated Show resolved Hide resolved
@Jarsen136
Copy link
Contributor Author

Jarsen136 commented Feb 17, 2023

Strange behavior when I click in searchbar
Not happening on beta idk if it's related.

They also occur on the beta environment. I have also seen some stuff colors change recently. related to #4855

note: Should we keep import since Nuxt provide auto-imported components?

👍 I will remove some unnecessary components import.

Edit: I'm not sure if I miss something, but when I try to remove some component imports, some errors appear.

Co-authored-by: roiLeo <medina.leo42@gmail.com>
Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

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

Usable

get isCreateVisible(): boolean {
return createVisible(this.urlPrefix)
}
const isDarkMode = computed(
Copy link
Member

Choose a reason for hiding this comment

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

Isnt there composable from vueuse? Cc @roiLeo

Copy link
Contributor

Choose a reason for hiding this comment

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

const colorMode = useColorMode()
$consola.log(colorMode.preference)

$colorMode from useNuxtApp working tambien

Copy link
Contributor Author

Choose a reason for hiding this comment

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

context: You will get system instead of dark/light value, when you visit the preview env the first time and have not set any color mode. So, I introduced this method to solve the incorrect color mode issue.
image

IMO, we should make this solution a global composable method and use it everywhere to replace useColorMode. That could be a follow-up issue.

get currentCollection() {
return this.$store.getters['history/getCurrentlyViewedCollection'] || {}
}
const logoSrc = computed(() => (isDarkMode.value ? KodaBetaDark : KodaBeta))
Copy link
Member

Choose a reason for hiding this comment

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

Time for logo component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess you are talking about the inline image component. I have introduced @nuxtjs/svg to make it in the previous PR, but finally do not merge it.
https://github.com/kodadot/nft-gallery/pull/4780/files

Copy link
Member

Choose a reason for hiding this comment

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

<KodadotLogo>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, if we would like to use this kind of component, we need introduce a image loader, like @nuxtjs/svg https://www.npmjs.com/package/@nuxtjs/svg
image


get showSearchOnNavbar(): boolean {
return !this.isLandingPage || !this.showTopNavbar || this.isBurgerMenuOpened
const onScroll = () => {
Copy link
Member

Choose a reason for hiding this comment

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

Also @preschian used some composable for bottom

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean TBH 👀 Which part or composable api could I reuse

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what you mean TBH 👀

Was thinking if something like this would help https://vueuse.org/core/useScroll/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After some trying, I found that useScroll could not be used in this case.

Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

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

So let it roll

components/Navbar.vue Outdated Show resolved Hide resolved
Co-authored-by: Viki Val <viktorko99@gmail.com>
@vikiival
Copy link
Member

Can we fix deepscan please?

image

@codeclimate
Copy link

codeclimate bot commented Feb 25, 2023

Code Climate has analyzed commit 9def05f and detected 0 issues on this pull request.

View more on Code Climate.

@Jarsen136
Copy link
Contributor Author

Can we fix deepscan please?

✅ Fixed

@vikiival vikiival merged commit e80fe13 into kodadot:main Feb 26, 2023
@vikiival
Copy link
Member

pay 40 usd

@yangwao
Copy link
Member

yangwao commented Feb 26, 2023

😍 Perfect, I’ve sent the payout
💵 $40 @ 38.79 USD/KSM ~ 1.031 $KSM
🧗 Caiv9TbPz68q5dC8EcHu5xKYPRnremimGzqmEejDFNpWWLG
🔗 0x92a3259c972f36359926e66cd73d1ce8fc1828e318e171d5619312fdb91a4712

🪅 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 Feb 26, 2023
@yangwao yangwao removed the paid pull-request has been paid label Aug 8, 2023
@yangwao
Copy link
Member

yangwao commented Aug 8, 2023

pay 40 usd

@yangwao
Copy link
Member

yangwao commented Aug 8, 2023

😍 Perfect, I’ve sent the payout
💵 $40 @ 5 USD/DOT ~ 8 $DOT
🧗 16SjUbGKSdjCdWTy3NNT3JxbRVGGqD4mwkHpc6BD9U2Rp29Z
🔗 0x237954b4900afc846c06ca7af1dfcb22edec8e974a6030187c0f11b0a923fb22

🪅 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 Aug 8, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: Navbar Vue composition api
5 participants