Skip to content

Commit

Permalink
Merge branch 'master' into add-datepicker-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandroTorresSicilia authored Dec 7, 2021
2 parents 8e291e0 + 6315e8f commit 3075ae3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12'
- run: 'yarn install'
- run: 'yarn build:library'
- uses: FirebaseExtended/action-hosting-deploy@v0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-rainbow-components",
"version": "1.27.0",
"version": "1.28.0",
"description": "React Rainbow Components",
"keywords": [
"react",
Expand Down
33 changes: 33 additions & 0 deletions src/components/PhoneInput/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,36 @@ const Form = () => {
<Form />
</Container>
```

# Custom country as the initial value
##### If you want to initialize the input with another country other than "us" selected by default, you can use the value to set a different country initially setting the `isoCode` field to the iso code of the country you want to set as initial: e.g `isoCode: 'fr'`

```js
import React, { useState } from 'react';
import styled from 'styled-components';
import { PhoneInput } from 'react-rainbow-components';

const Container = styled.div`
max-width: 480px;
margin: 30px auto;
padding: 20px 10px;
min-height: 400px;
`;

const Form = () => {
const [phone, setPhone] = useState({ isoCode:"fr" });

return (
<PhoneInput
label="Phone Number"
placeholder="Enter your phone number"
onChange={setPhone}
value={phone}
/>
);
};

<Container>
<Form />
</Container>
```
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16018,9 +16018,9 @@ write@1.0.3:
mkdirp "^0.5.1"

ws@^5.2.0:
version "5.2.2"
resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f"
integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==
version "5.2.3"
resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d"
integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==
dependencies:
async-limiter "~1.0.0"

Expand Down

0 comments on commit 3075ae3

Please sign in to comment.