Skip to content

Commit ecc2715

Browse files
author
Artur Bien
committed
fix(themes): fix theme export issue
1 parent 7894b70 commit ecc2715

File tree

5 files changed

+12
-18
lines changed

5 files changed

+12
-18
lines changed

example/src/examples/PanelExample.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { StyleSheet } from 'react-native';
3-
import { Panel, Text, original } from 'react95-native';
3+
import { Panel, Text, themes } from 'react95-native';
44

55
import Container from '../util/Container';
66

@@ -57,7 +57,7 @@ const styles = StyleSheet.create({
5757
padding,
5858
},
5959
label: {
60-
color: original.borderLightest,
60+
color: themes.original.borderLightest,
6161
marginBottom: 4,
6262
},
6363
});

example/src/util/Container.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
StyleProp,
77
ViewStyle,
88
} from 'react-native';
9-
import { original, Text } from 'react95-native';
9+
import { themes, Text } from 'react95-native';
1010

1111
const styles = StyleSheet.create({
1212
container: {
@@ -17,7 +17,7 @@ const styles = StyleSheet.create({
1717
padding: 16,
1818
},
1919
label: {
20-
color: original.borderDarkest,
20+
color: themes.original.borderDarkest,
2121
marginBottom: 4,
2222
},
2323
section: {

src/common/theming/Theme.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import React, { createContext } from 'react';
22

33
import type { Theme } from '../../types';
4-
import originalTheme from './themes/original';
4+
import themes from './themes';
55

66
import {
77
border as borderStylesBuilder,
88
text as textStylesBuilder,
99
} from '../styles';
1010

11+
const defaultTheme = themes.original;
12+
1113
type ThemeProviderProps = {
1214
children: React.ReactNode;
1315
theme: Theme;
1416
};
1517

1618
const ThemeContext = createContext({
17-
...originalTheme,
18-
border: borderStylesBuilder(originalTheme),
19-
text: textStylesBuilder(originalTheme),
19+
...defaultTheme,
20+
border: borderStylesBuilder(defaultTheme),
21+
text: textStylesBuilder(defaultTheme),
2022
});
2123

2224
const ThemeProvider = ({ children, theme }: ThemeProviderProps) => {

src/common/theming/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export { Select, SelectBox } from './Select';
2626
export { Text, Title, Anchor } from './Typography';
2727

2828
export * from './Icons';
29-
export * from './common/theming';
29+
export { ThemeProvider } from './common/theming/Theme';
30+
export { default as themes } from './common/theming/themes';
3031

3132
export { Theme } from './types';
3233
export { fontNames } from './common/styles';

0 commit comments

Comments
 (0)