LiraShapira / app

The Lira Shapira App
4 stars 8 forks source link

phone number parsing #56

Open GILREICH1 opened 11 months ago

GILREICH1 commented 11 months ago
GILREICH1 commented 11 months ago

@view4 worth considering during registration to set standard format ?

view4 commented 11 months ago

@view4 worth considering during registration to set standard format ?

Sounds fine. Can use package to handle the standardisation parsed/formatting of the number e.g. https://www.npmjs.com/package/libphonenumber-js?activeTab=readme.

We can assume country code for now by default is IL && post-mvp/later you can add a dropdown of countries/flags to set more dynamically (?). So in the meantime can have default value in textinput of (+972), which can be manually overridden.

lmk what you think.

GILREICH1 commented 11 months ago

great , sounds like a good plan 👍

GILREICH1 commented 9 months ago

To add info to this: phone number supplied by user on registration requires parsing before sending to backend. Number can be parsed like here: https://github.com/LiraShapira/app/blob/main/app/SendAmount.tsx#L42