Skip to content

Commit

Permalink
feat(docs): expand custom-mapping guide
Browse files Browse the repository at this point in the history
  • Loading branch information
artyorsh authored Jul 2, 2019
1 parent 9e192ea commit 54310b6
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions docs/src/articles/design-system/custom-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,30 @@ The example above demonstrates how you can create a really simple configuration.
}
```

What we did is that we added a rounded [variant](design-system/design-system-glossary#variant) which will make our `CircleButton` not such circle. And this is how it looks:
What we did is that we added a rounded [variant](design-system/design-system-glossary#variant) which will make our `CircleButton` not such circle. Let's now pass it to a component:

```js
import * as React from 'react';
import { ApplicationProvider, Layout } from 'react-native-ui-kitten';
import { mapping, light as lightTheme } from '@eva-design/eva';
import { default as customMapping } from './path-to/custom-mapping.json';
import CircleButton from './path-to/CircleButton';

const App = () => (
<ApplicationProvider
mapping={mapping}
customMapping={customMapping}
theme={lightTheme}>
<Layout style={{padding: 64, alignItems: 'center'}}>
<CircleButton shape='rounded'/> // <-- Apply `rounded` shape variant
</Layout>
</ApplicationProvider>
);

export default App;
```

And this is how it looks:

![image](assets/images/articles/design-system/custom-mapping-variant.png)

Expand Down Expand Up @@ -237,9 +260,10 @@ class CircleButton extends React.Component {

return (
<TouchableOpacity
{...restProps}
style={[themedStyle, style]}
onPressIn={this.onPressIn}
{...restProps}
onPressOut={this.onPressOut}
/>
);
}
Expand Down

0 comments on commit 54310b6

Please sign in to comment.