nft-gallery icon indicating copy to clipboard operation
nft-gallery copied to clipboard

Summer Refactor

Open petersopko opened this issue 2 years ago • 12 comments

As discussed in multiple places here, we got to a point where our codebase deserves serious refactor. Except for making our life easier, this would be great help for newcomers, since some things became quite messy/chaotic over the months of remote/async development.

following up from discussion here:

  • https://github.com/kodadot/nft-gallery/discussions/3068

When it comes to the folder structure, I prefer the way @kkukelka described his approach in the discussion:

I like to divide stuff in either context-specific or functionality-specific folders e.g. for context-specific:

/payment
/payment/CheckoutComponent.vue
/payment/BillingComponent.vue
  • [x] #3883
  • [ ] #3299
  • [ ] #3308
  • [ ] #3310
  • [ ] #3309
  • [ ] #3355
  • [ ] #3379
  • [ ] #3579
  • [ ] #1348
  • [ ] #3706
  • [x] #3774
  • [x] #3865
  • [x] #3772
  • [ ] #3714
  • [ ] #3706
  • [ ] #3868
  • [x] #3360
  • [x] #3747
  • [x] #3749
  • [x] #3773

petersopko avatar Jun 30 '22 11:06 petersopko

@kkukelka @roiLeo @vikiival I've moved the ideas from discussion about this into more actionable version, please feel free to add / modify whatever you find valuable

petersopko avatar Jun 30 '22 11:06 petersopko

So far short list


# Components we need

## Shared
- Auth
- Avatar
- Identity
- CollapseWrapper
- CommonTable
- LabeledText - (label, slot)

## Form
- DropUpload
- SubmitButton
- Collection Select
- Basic
  - Input
  - Switch
  - CheckBoxButton
  - NumberInput
  - Slider
- BalanceInput
  - Simple
  - Multicurrency
- AddressInput
  - Simple
  - Strict
  - WithHint
- AttributeTagInput

## View
- Money (with currency, decimal places)
- AccountBalance
- Titles (h1, h2, h3, h4, h5, h6)
- GalleryCard
- Percentage
- Image (rounded, square)


## Profile Specific
- Stats
  - Stats Column (label, slot)
- Web3 Social - sub.id, subscan, polkascan
- Sharing - donate, QR, link, share


## Lists
- GalleryCardList

## Search / Sort / Filter
- Pagination
- Buy Now
- SortDropdown
- Go to random
- ChangeLayout
- SearchInput

## Table
- Pagination (backend pagination)
- Cells
  - Type (BUY, SEND...)
  - Link (detail,) (just icon)
  - External
  - Money
  - Percentage
  - Identity?
  - Common - Just show it as text
  - RelativeDate - (9 months ago)
- WithDetail
  - list
  - gallery cards

## Charts

## Galery Item
- Navigation (through collection)
- Image
- ImageResize (fill, full-screen, grid)
- Emote?
- Title
- Description
- Attributes


### Carousel - Landing, Visited NFTs
- Image
- Title
- Money
- Creator
- current Owner

### Notification

## Chain Specific

### RMRK

### BSX

#### Offers

# Utils


vikiival avatar Aug 04 '22 14:08 vikiival

@vikiival dont we already have some of these components that is shared? like Identity

prachi00 avatar Aug 05 '22 04:08 prachi00

@vikiival dont we already have some of these components that is shared? like Identity

Yes, we have component called Identity but it is doing too much logic. & has more than 200 lines of code.

Our focus it to have atomic (reusable) components

vikiival avatar Aug 05 '22 09:08 vikiival

Just found out there is a new version of Vue 2.7 that we can implement before full Vue3

Only blocking

  • https://github.com/buefy/buefy/issues/3768

vikiival avatar Aug 08 '22 11:08 vikiival

Just found out there is a new version of Vue 2.7 that we can implement before full Vue3

Only blocking

this is not a blocker then right? If not, we can follow this https://blog.vuejs.org/posts/vue-2-7-naruto.html to upgrade to 2.7

prachi00 avatar Aug 09 '22 04:08 prachi00

Just found out there is a new version of Vue 2.7 that we can implement before full Vue3

Only blocking

i've updated vue to 2.7.8 in here https://github.com/kodadot/nft-gallery/pull/3689 buefy seems to work nonetheless

kkukelka avatar Aug 09 '22 04:08 kkukelka

some questions:

  1. it's time to remove nuxt-property-decorator and use vue composition API instead?
  2. do we need storybook to manage and preview our components?

preschian avatar Aug 10 '22 11:08 preschian

it's time to remove nuxt-property-decorator and use vue composition API instead?

Yup, best time is to write new components in composition api and also refactor some.

do we need storybook to manage and preview our components?

There was an alternative for Vue3. I don't know what was it's name

vikiival avatar Aug 11 '22 12:08 vikiival

ok then, I will start with some components on the landing page https://github.com/kodadot/nft-gallery/issues/3714

preschian avatar Aug 11 '22 13:08 preschian

@preschian https://github.com/histoire-dev/histoire

vikiival avatar Aug 13 '22 13:08 vikiival

@preschian histoire-dev/histoire

looks cool, thanks, will try to experiment with it later 👍

preschian avatar Aug 14 '22 03:08 preschian