Skip to content

Commit 2e27720

Browse files
committed
Update documentation how to override default content of application
1 parent 191d750 commit 2e27720

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
onFailure={this.onFailed} onSuccess={this.onSuccess}
2323
requestTokenUrl="http://localhost:4000/api/v1/auth/twitter/reverse"/>
2424
```
25+
26+
Custom content that overrides default content:
27+
28+
```jsx harmony
29+
<TwitterLogin loginUrl="http://localhost:4000/api/v1/auth/twitter"
30+
onFailure={this.onFailed}
31+
onSuccess={this.onSuccess}
32+
requestTokenUrl="http://localhost:4000/api/v1/auth/twitter/reverse"
33+
showIcon={true}
34+
customHeaders={customHeader}>
35+
<b>Custom</b> Twitter <i>Login</i> content
36+
</TwitterLogin>
37+
```
38+
2539
## Options
2640

2741
| params | value | default value | description |
@@ -40,6 +54,8 @@
4054
| showIcon |bool |true |should default icon be visible |
4155
| credentials |string |same-origin |indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests. Possible values: `omit`, `same-origin`, `include`|
4256
| customHeaders |object |{} |custom headers should be object with fields that needs to be sent to user server. Field name will be used as header key and field value as header value. Because of bug in fetch implementation all keys will be lowercase.|
57+
| children |node | |this props can be used in order to override default component content|
58+
4359
# Examples
4460

4561
Full example can be found in [example](https://github.com/GenFirst/react-twitter-login/tree/master/example) folder.

example/twitter-example/src/App.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ class App extends Component {
3131
requestTokenUrl="http://localhost:4000/api/v1/auth/twitter/reverse"
3232
showIcon={true}
3333
customHeaders={customHeader}/>
34+
35+
<TwitterLogin loginUrl="http://localhost:4000/api/v1/auth/twitter"
36+
onFailure={this.onFailed}
37+
onSuccess={this.onSuccess}
38+
requestTokenUrl="http://localhost:4000/api/v1/auth/twitter/reverse"
39+
showIcon={true}
40+
customHeaders={customHeader}>
41+
<b>Custom</b> Twitter <i>Login</i> content
42+
</TwitterLogin>
3443
</div>
3544
);
3645
}

0 commit comments

Comments
 (0)