diff --git a/README.md b/README.md
index 71e3021..523518c 100644
--- a/README.md
+++ b/README.md
@@ -50,7 +50,7 @@ class Example extends React.Component {
| designProp.scale | number | 1 | The scale of the button image. The minimum and maximum values are 1 and 6, respectively. |
| designProp.locale | string | en_US | The language used for text on the button. |
| render | function | - | Render prop to use a custom element, use renderProps.onClick |
-| callback | function | - | - |
+| callback | function | - | callback only work with Response Mode query. |
## Production Bundle
diff --git a/example/src/App.js b/example/src/App.js
index ec319f2..e3e1ad5 100644
--- a/example/src/App.js
+++ b/example/src/App.js
@@ -12,7 +12,7 @@ const App = () => {
const [settings, setSettings] = useState({
clientId: 'com.react.apple.login',
redirectURI: 'https://redirectUrl.com',
- scope: 'name email',
+ scope: '',
state: '',
responseType: 'code',
responseMode: 'query',
@@ -30,25 +30,25 @@ const App = () => {
});
useEffect(() => {
+
const buildDesignProps = (designProps) => {
- let string = `{`;
+ let string = ` {`;
Object.keys(designProps).map((prop) => {
string +=`
- ${prop}: ${(typeof designProps[prop] === 'string') ? `${ JSON.stringify(designProps[prop])}` : JSON.stringify(designProps[prop])},`;
+ ${prop}: ${(typeof designProps[prop] === 'string') ? `${ JSON.stringify(designProps[prop])}` : JSON.stringify(designProps[prop])},`;
});
- string += `}`;
+ string += ` \n }`;
return string;
}
const buildProps = `${Object.keys(settings).reduce((string, prop) => (
- `${string}
- ${prop === 'designProp' ? `${prop}={
- ${buildDesignProps(settings[prop])}
- }` : `${prop}={${JSON.stringify(settings[prop])}}`}`
+ `${string} ${(settings[prop] !== '') ? `
+ ${(prop === 'designProp') ? `${prop}={
+ ${buildDesignProps(settings[prop])}
+ }` : `${prop}={${JSON.stringify(settings[prop])}}`}` : ``}`
), `