Skip to content

Commit

Permalink
build(common): update eva dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
artyorsh authored and malashkevich committed Jun 11, 2019
1 parent 9fc1c6c commit b734930
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 76 deletions.
113 changes: 48 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ci:build": "npm run env:set -- prod && npm run build"
},
"dependencies": {
"@eva-design/eva": "github:akveo/eva#package/eva",
"@eva-design/eva": "1.0.0-beta.2",
"expo": "^32.0.0",
"expo-analytics": "^1.0.8",
"react": "16.5.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Router } from './core/navigation/routes';
import { trackScreenTransition } from './core/utils/analytics';
import { getCurrentStateName } from './core/navigation/routeUtil';
import {
ContextType,
ThemeContextType,
ThemeContext,
ThemeKey,
themes,
Expand Down Expand Up @@ -81,7 +81,7 @@ export default class App extends React.Component<{}, State> {
};

public render(): React.ReactNode {
const contextValue: ContextType = {
const contextValue: ThemeContextType = {
currentTheme: this.state.theme,
toggleTheme: this.onSwitchTheme,
};
Expand Down
4 changes: 2 additions & 2 deletions src/containers/menu/themes/themes.container.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Themes } from './themes.component';
import {
ContextType,
ThemeContextType,
ThemeContext,
ThemeKey,
themes,
Expand Down Expand Up @@ -31,7 +31,7 @@ export class ThemesContainer extends React.Component {
return { name: theme, theme: themes[theme] };
};

private renderContent = (context: ContextType): React.ReactElement<any> => {
private renderContent = (context: ThemeContextType): React.ReactElement<any> => {
return (
<Themes
data={this.data}
Expand Down
2 changes: 1 addition & 1 deletion src/core/themes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const themes: ThemeRegistry = {

export {
ThemeContext,
ContextType,
ThemeContextType,
} from './themeContext';

export { ThemeStore } from './theme.store';
Expand Down
12 changes: 7 additions & 5 deletions src/core/themes/themeContext.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import { ThemeKey } from '@src/core/themes/index';

export interface ContextType {
export interface ThemeContextType {
currentTheme: ThemeKey;
toggleTheme: (theme: string) => void;
toggleTheme: (theme: ThemeKey) => void;
}

export const ThemeContext: React.Context<ContextType> = React.createContext({
const initialValue: ThemeContextType = {
currentTheme: 'Eva Light',
toggleTheme: (theme: string) => {},
});
toggleTheme: (theme: ThemeKey) => {},
};

export const ThemeContext: React.Context<ThemeContextType> = React.createContext(initialValue);

0 comments on commit b734930

Please sign in to comment.