Coder Social home page Coder Social logo

redesigned's People

Contributors

n-d-r-d-g avatar

Stargazers

 avatar

Watchers

 avatar

redesigned's Issues

Use `destroyInactiveTabPanel` to simplify code

Problem

Currently, the Tabs component from NextUI unmounts inactive tabs' components. When users switch from tab to tab, they lose all their form data in the previous tab. The current implemented solution is to save the current form data in Formik's initialValues whenever the user clicks on a new tab.

This has caused a bug where the Reset button wouldn't reset the form data to the actual initialValues. To fix this, I had to add a new prop on the Reset button to accept a function whose responsibility is to reset the initial values. The Reset button then calls this prop is it has been provided, then resets the form.

This is working currently, however, I think the DX is not optimized and this can cause maintenance issues, e.g. regression, later.

Solution

The reason why all the above needed to be implemented was because NextUI currently does not allow for tabs' content to always be mounted. The default behavior is to unmount all inactive tabs' content, which makes sense for performance reasons.

A new prop: destroyInactiveTabPanel has been added and is available currently in Canary (feature). Once this props is available in a stable version of NextUI, it can be used instead the current implementation.

IMHO, this will make the code way more maintainable and cause less regressions in the future.

Add french translations in MUDOCS

Add JSON translation files matching EN JSON file naming under mudocs/public/locales/fr.

DO NOT TRANSLATE TAGS INSIDE THE TRANSLATIONS, E.G:
EN -> "title": "Welcome <MyName />"
FR -> "title": "Bienvenue <MyName />"

Add Mauritian creole translations in MUDOCS

Add JSON translation files matching EN JSON file naming under mudocs/public/locales/mu.

DO NOT TRANSLATE TAGS INSIDE THE TRANSLATIONS, E.G:
EN -> "title": "Welcome <MyName />"
MU -> "title": "Bienveni <MyName />"

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.