Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(guide): theme usage typo #440

Closed
skryl opened this issue Jun 12, 2019 · 2 comments

Comments

Projects
2 participants
@skryl
Copy link

commented Jun 12, 2019

https://akveo.github.io/react-native-ui-kitten/docs/guides/add-into-existing-project

Configure Application Root

import React from 'react';
import {
  mapping,
  theme,
} from '@eva-design/eva';
import { ApplicationProvider } from 'react-native-ui-kitten';
import { Application } from './path-to/root.component';

export default class App extends React.Component {

   public render(): React.ReactNode {
     return (
       <ApplicationProvider
         mapping={mapping}
         theme={theme}>
         <Application/>
       </ApplicationProvider>
     );
   }
}

should actually be

import React from 'react';
import {
  mapping,
  light as theme, // select light or dark theme
} from '@eva-design/eva';
import { ApplicationProvider } from 'react-native-ui-kitten';
import { Application } from './path-to/root.component';

export default class App extends React.Component {

   public render(): React.ReactNode {
     return (
       <ApplicationProvider
         mapping={mapping}
         theme={theme}>
         <Application/>
       </ApplicationProvider>
     );
   }
}
@skryl

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

https://github.com/eva-design/eva/blob/master/packages/eva/index.ts

export const mapping = require('./mapping.json');
export const light = require('./themes/light.json');
export const dark = require('./themes/dark.json');

Seems like eva only exports light and dark, using theme causes an obscure error deep down in styleConsumer.

@artyorsh artyorsh added this to To do in Kitten via automation Jun 12, 2019

@artyorsh artyorsh self-assigned this Jun 12, 2019

@artyorsh

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

Thanks for report @skryl

Yes. With Eva you can now use light and dark themes with following code:

import { mapping, light as theme } from '@eva-design/eva'; 

or to use Dark Theme

import { mapping, dark as theme } from '@eva-design/eva'; 

Looks like, it should be fixed everywhere

@artyorsh artyorsh changed the title Add Into Existing Project Guide Typo docs(guide): theme usage typo Jun 12, 2019

@artyorsh artyorsh moved this from To do to Backlog in Kitten Jun 12, 2019

Kitten automation moved this from Backlog to Done Jun 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.