2017-12-31 86 views
-2

ここに私のApp.jsファイルがあります。テーマは変更されていません。[admin-on-rest] [aor-graqhql]を使用したカスタムテーマ

import getMuiTheme from 'material-ui/styles/getMuiTheme'; 

import { 
    blue400, blue700, 
    pinkA200, 
    grey100, grey300, grey400, grey500, 
    white, darkBlack, fullBlack, 
} from 'material-ui/styles/colors'; 
import { fade } from 'material-ui/utils/colorManipulator'; 
import spacing from 'material-ui/styles/spacing'; 

const myTheme = { 
    spacing: spacing, 
    fontFamily: 'Roboto, sans-serif', 
    palette: { 
     primary1Color: blue400, 
     primary2Color: blue700, 
     primary3Color: grey400, 
     accent1Color: pinkA200, 
     accent2Color: grey100, 
     accent3Color: grey500, 
     textColor: darkBlack, 
     alternateTextColor: white, 
     canvasColor: white, 
     borderColor: grey300, 
     disabledColor: fade(darkBlack, 0.3), 
     pickerHeaderColor: blue400, 
     clockCircleColor: fade(darkBlack, 0.07), 
     shadowColor: fullBlack, 
    }, 
} 

class App extends Component { 

    constructor() { 
     super(); 
     this.state = { restClient: null }; 
    } 
    componentWillMount() { 
     buildApolloClient() 
      .then(restClient => this.setState({ restClient })); 
    } 

    render() { 
     if (!this.state.restClient) { 
      return <div>Loading</div>; 
     } 

     return (
      <Admin 
       title="Cruceritis HQ" 
       restClient={this.state.restClient} 
       customReducers={{ theme: themeReducer }} 
       theme={getMuiTheme(myTheme)} 
       customSagas={sagas} 
       customRoutes={customRoutes} 
       authClient={authClient} 
       dashboard={Dashboard} 
       loginPage={Login} 
       appLayout={Layout} 
       menu={Menu} 
       messages={translations} 
       locale="es" 

      > 
       <Resource name="Customer" list={VisitorList} edit={VisitorEdit} remove={VisitorDelete} icon={VisitorIcon} /> 
       <Resource name="Command" list={CommandList} edit={CommandEdit} remove={Delete} icon={CommandIcon} options={{ label: 'Orders' }} /> 
       <Resource name="Product" list={ProductList} create={ProductCreate} edit={ProductEdit} remove={Delete} icon={ProductIcon} /> 
       <Resource name="Category" list={CategoryList} edit={CategoryEdit} remove={Delete} icon={CategoryIcon} /> 
       <Resource name="Review" list={ReviewList} edit={ReviewEdit} icon={ReviewIcon} /> 
       <Resource name="Segment" list={SegmentList} icon={SegmentIcon} /> 
       <Resource name="CommandItem" /> 
      </Admin> 
     ); 
    } 
} 

export default App; 

私は私が間違っているかもしれないもので無知だ...

私はdarkThemeをインポートしようとしたとも

私は何を修正する必要が動作しませんか?

+0

使用している素材のバージョンは? –

+0

私はaor-graphqlを使用しています。それ自体はlernaプロジェクトです。3 npmパッケージ:admin-on-rest-graphql-demo、aor-pgraphql-client、aor-graphql-client-grahpcool 最初のものはonですデープ素材として追加 - ui "material-ui": "〜0.19.3"、 –

答えて

0

テーマが適用されていないようです。あなたは(v0.x用)このアプローチに従う必要があります。

import React from 'react'; 
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; 
import getMuiTheme from 'material-ui/styles/getMuiTheme'; 
import App from './App'; 

const myTheme = { 
    palette: { 
    primary1Color: 'red', 
    }, 
} 

const Main =() => (
    <MuiThemeProvider muiTheme={getMuiTheme(myTheme)}> 
    <App /> 
    </MuiThemeProvider> 
); 

export default Main; 

将来的にはあなたはまだ問題をexibits、あまりノイズが含まれている簡単な例を提供することができます。

関連する問題