Skip to content

Commit 76eea63

Browse files
use createTheme in docs
1 parent 2fc5032 commit 76eea63

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/components/CustomThemeDemo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from 'react';
2-
import { Timeline, Events, TextEvent, themes } from '../index';
3-
import merge from 'lodash.merge';
2+
import { Timeline, Events, TextEvent, themes, createTheme } from '../index';
43

5-
const customTheme = merge({}, themes.default, {
4+
const customTheme = createTheme(themes.default, {
65
card: {
76
backgroundColor: '#efefef',
87
},

src/components/Theming.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import {
66
ImageEvent,
77
UrlButton,
88
themes,
9+
createTheme,
910
} from '../index';
10-
import merge from 'lodash.merge';
1111

1212
export default {
1313
title: 'Timeline/Theming',
1414
};
1515

1616
export const customThemeExample = () => {
17-
const theme = merge({}, themes.default, {
17+
const theme = createTheme(themes.default, {
1818
timeline: {
1919
backgroundColor: '#070D24',
2020
},

src/components/Theming.stories.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ Check out the example below in which we customize some of the elements.
1616

1717
```jsx
1818
import React from 'react';
19-
import { Timeline, Events, TextEvent, themes } from '@merc/react-timeline';
20-
import merge from 'lodash.merge';
19+
import { Timeline, Events, TextEvent, themes, createTheme } from '@merc/react-timeline';
2120

22-
const customTheme = merge({}, themes.default, {
21+
const customTheme = createTheme(themes.default, {
2322
card: {
2423
backgroundColor: '#efefef',
2524
},

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Events from './components/Events';
44
import Timeline from './components/Timeline';
55
import themes from './themes';
66
import LAYOUTS from './constants/layouts';
7+
import { createTheme } from './utils/themes';
78

89
import ImageAtom from './components/atoms/ImageAtom';
910
import MarkdownAtom from './components/atoms/MarkdownAtom';
@@ -40,4 +41,5 @@ export {
4041
YouTubeEvent,
4142
themes,
4243
LAYOUTS,
44+
createTheme,
4345
};

0 commit comments

Comments
 (0)