Skip to content

Commit 6c26b28

Browse files
committed
Fix styling issues
1 parent 02de214 commit 6c26b28

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

example/src/@types/redux-devtools-themes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ declare module 'redux-devtools-themes' {
33

44
declare module 'react-base16-styling' {
55
export const createStyling: any;
6+
export const invertTheme: any;
67
}

example/src/ReactNativeMonitor.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ function createIntermediateState(
107107
}
108108

109109
function createThemeState(props: any) {
110-
const base16Theme = getBase16Theme(props.theme, base16Themes);
111-
console.warn(base16Theme);
112-
console.warn(props);
113-
const styling = createStylingFromTheme(props.theme);
114-
console.warn(styling('inspector').style);
110+
const base16Theme = getBase16Theme('nicinabox', base16Themes);
111+
const styling = createStylingFromTheme('nicinabox');
115112
return { base16Theme, styling };
116113
}
117114

@@ -123,7 +120,7 @@ export class ReactNativeMonitor extends React.Component<
123120
static defaultProps = {
124121
select: (state: any) => state,
125122
supportImmutable: false,
126-
theme: 'inspector',
123+
theme: 'nicinabox',
127124
invertTheme: false
128125
};
129126

@@ -179,7 +176,7 @@ export class ReactNativeMonitor extends React.Component<
179176
const { action, nextState, delta, error, themeState } = this.state;
180177
const { base16Theme, styling } = themeState;
181178
return (
182-
<View style={styles.container}>
179+
<View {...styling('inspector')}>
183180
<ActionList
184181
{...{
185182
actions,

example/src/themes/inspector.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ export default {
1818
base0E: '#EC31C0',
1919
base0F: '#a16946'
2020
};
21-

example/src/utils/createStylingFromTheme.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { createStyling } from 'react-base16-styling';
1+
import { createStyling, invertTheme } from 'react-base16-styling';
22
import rgba from 'hex-rgba';
33
import inspector from '../themes/inspector';
44
import * as reduxThemes from 'redux-devtools-themes';
5-
import * as inspectorThemes from '../themes';
65
import { StyleSheet } from 'react-native';
76

87
const colorMap = (theme: any) => ({
@@ -33,7 +32,15 @@ const colorMap = (theme: any) => ({
3332

3433
const getSheetFromColorMap = (map: ReturnType<typeof colorMap>) => ({
3534
inspector: {
36-
flex: 1
35+
position: 'absolute',
36+
bottom: 0,
37+
right: 0,
38+
left: 0,
39+
height: 200,
40+
padding: 5,
41+
borderTopWidth: 1,
42+
borderTopColor: map.BORDER_COLOR,
43+
backgroundColor: map.BACKGROUND_COLOR
3744
}
3845
// 'flex-direction': 'column',
3946
// width: '100%',
@@ -368,27 +375,20 @@ const getSheetFromColorMap = (map: ReturnType<typeof colorMap>) => ({
368375
// }
369376
});
370377

371-
let themeSheet;
372378

373379
const getDefaultThemeStyling = (theme: string) => {
374-
themeSheet = getSheetFromColorMap(colorMap(theme));
380+
const themeSheet = getSheetFromColorMap(colorMap(theme));
375381
return StyleSheet.create(themeSheet as any);
376382
};
377383

378-
export const base16Themes = { ...reduxThemes, ...inspectorThemes };
384+
export const base16Themes = reduxThemes;
379385

380386
export const createStylingFromTheme = createStyling(getDefaultThemeStyling, {
381-
defaultBase16: inspector,
387+
defaultBase16: (reduxThemes as any).nicinabox,
382388
reduxThemes
383389
});
384390

385-
const styling = createStylingFromTheme('inspector');
386-
console.warn(styling);
387-
console.warn(styling('rightSliderRotateShown'));
388-
389-
390-
391391
// export const createStylingFromTheme = createStyling(getStylingFromBase16, {
392392
// defaultBase16: inspector,
393393
// base16Themes
394-
// });
394+
// });

0 commit comments

Comments
 (0)