dzcode-io / dzcode.io

Website & mobile app for Algerian open-source community
https://dzcode.io
MIT License
114 stars 41 forks source link

Refining the Contribution Gallery on mobile #348

Closed ZibanPirate closed 2 years ago

ZibanPirate commented 3 years ago

Description

Follow up PR on #342

Check List

  1. [x] we can move the calculate-date.ts file to ./common folder, then reuse it on both ./web and ./mobile folders cuz it's also on the web as ./web/src/common/utils/elapsed-time.ts (46a1f6e73b60a5962e3fc22a361e793b1bc6a6ab)
  2. [x] there's no need to re-create the response interfaces, instead we can import them from "src/.common/types/api-responses" ( 9794d9a9d58b49225ee48c8d6d9cdaada66fbb40 )
  3. [x] We need to use Redux, this will make dev easier and predictable. (this will also make the filters work properly) ( #361 )
  4. [x] maybe add some margin at the bottom of the cards container, so that last results will not appear at the very bottom. (b6246b71f68a53849bc72e1933b21ca45d798c79)
  5. [x] maybe we can place the filters component inside a FAB.Group component so it appears just like the mobile version of the website? (1c2c9fd78ac85c76ae473931a525bcefe2f31764)
  6. [x] and Yes, we probably should show something when there's an empty result. (afd036a44a04d47e6bcbec942b0873798ff1f740)

Additional Comments

The tasks are from this comment, please feel free to add more if anything is missing.

ZibanPirate commented 3 years ago

i can take up the 3rd task, the one about implementing Redux

omdxp commented 3 years ago

@ZibanPirate Okay sounds cool to me, as you can see in the redux folder, there is the structure for it, from actions creators to action types to reducers, each reducer should do specific tasks, I am guessing that we should separate reducers for each screen, as for this one maybe it will be ContributeReducer, so what do you think?

I can do the other tasks

ZibanPirate commented 3 years ago

generally, we will have two types of reducers, Screen Reducer for eg: contributeScreen reducer, and Data reducer for eg: settings reducer, the first one contains state of the Contribute screen: contributions, filters ..etc, similar to the web one, and the settings reducer will also be similar to the web's setting reducer which for now contains darkMode

omdxp commented 3 years ago

Good idea, we'll work on that way then

omdxp commented 3 years ago

@ZibanPirate would you see the #355 PR to see WIP code, so maybe you can continue what left. PS: for the empty state it would be awesome if we have some pngs or maybe lottie files that shows the dzcode.io logo in it.

ZibanPirate commented 3 years ago

still only the last task for this issue, then we can close it 👌

omdxp commented 3 years ago

still only the last task for this issue, then we can close it 👌

@ZibanPirate I'm going to work on it

ZibanPirate commented 2 years ago

closing as done in #364