Giter VIP home page Giter VIP logo

partyplan's Introduction

Changelog

  • Responsive
    • Desktop size got a route indicator
    • Other parts of the UI are responsive now
  • Test
    • Added Some Unit Tests for Reducers
    • learn and adding components test progressively
  • Readme
    • Readme got updated using the markup language

(28, May,2023)

  • Performance Prevent re-rendering using React Dev Tools.

    • List items on selection,
    • Next Button,
    • Header Stepper,
    • Route Indicator.
  • Hooks refactor functions and turn them into the hook

    • useDiffrenceDateTime
    • useNextStep
    • usePlanSeperator
  • Component Structure

    • create a new component and a data type for guest and occasion pages, that uses a similar implementation to the other create-plan outlets ( question+answer)

Thought Process

PlanSlice

initialState includes a Array<Plan> and a Plan object that will fill through the life cycle of creating a plan, purpose of having a single plan object was to not modify the original plan Array and keep it untouched.

how it works:

  • initially newPlan object is undefined
const plan: Plan | undefined = undefined;
  • on add new plan we create a dummy id and initialize all the properties with empty values
      state.newPlan = {
        id: action.payload,
        alcohol: "",
        etc ... }
  • after that we add user modifications step by step to the same plan object.
  • in the end we have a full-filled Plan object that we can add to our plan Array.
state.plans.push(state.newPlan);

QAComponent

I can tell 4 pages had the same structure icon + question + answer and I use the same data structure and component for all of them.

Outlet

I used Outlet instead of conditional rendering due to the declarative syntax of Routes

Todo

in the todo route, I just pass an index prop to simply access the array plan and show the todos of a plan.

first, I want to separate todos from plans in a different slice but I just figured out we can`t access a slice in another slice. in the end, todos were very tight and specific to the plans

Folder Structure

src
 ┣ assets
 ┃ ┣ icons
 ┃ ┃
 ┣ components
 ┃ ┣ layout
 ┃ ┗ shared-ui
 ┃ ┃
 ┣ core
 ┃ ┣ constant
 ┃ ┣ hook
 ┃ ┗ util
 ┃ ┃
 ┣ pages
 ┃ ┣ Home
 ┃ ┃ ┣ test
 ┃ ┃ ┣ components
 ┃ ┃ ┗ home.tsx
 ┃ ┣ plan
 ┃ ┃ ┣ components
 ┃ ┃ ┗ CreatePlan.tsx
 ┃ ┗ todo
 ┃ ┃ ┣ components
 ┃ ┃ ┗ Todo.tsx
 ┃ ┃
 ┣ redux
 ┃ ┣ test
 ┃ ┃ ┣ plan-slice.test.ts
 ┃ ┃ ┗ ui-slice.test.ts
 ┃ ┣ slices
 ┃ ┃ ┣ plan-slice.ts
 ┃ ┃ ┗ ui-slice.ts
 ┃ ┃
 ┃ ┗ store.ts
 ┃ ┃
 ┣ types
 ┃ ┣ plan.d.ts
 ┃ ┣ etc ...
 ┃ ┃
 ┗ App.tsx

Screen Shots

Mobile

Desktop

partyplan's People

Watchers

mohammd molaei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.