gpietro / react-numpad

A numpad for number, date and time, built with and for React.
MIT License
138 stars 38 forks source link

Can't find fontFamily - theme prop #123

Closed miltonbo closed 3 years ago

miltonbo commented 5 years ago

I have a problem rendering the NumPad, please help me.

Uncaught TypeError: Cannot read property 'fontFamily' of undefined
    at eval (Wrapper.js:131)
    at flatten (styled-components.browser.esm.js:1323)
    at flatten (styled-components.browser.esm.js:1303)
    at ComponentStyle.generateAndInjectStyles (styled-components.browser.esm.js:1512)
    at StyledComponent.generateAndInjectStyles (styled-components.browser.esm.js:2131)
    at StyledComponent.renderInner (styled-components.browser.esm.js:2036)
    at updateContextConsumer (react-dom.development.js:15278)
    at beginWork (react-dom.development.js:15466)
    at performUnitOfWork (react-dom.development.js:19106)
    at workLoop (react-dom.development.js:19146)

I copied the sample in the documentation and that happened.

miltonbo commented 5 years ago

It is necessary to add one field in the sample. This solve my problem:

export const numpadKeynumTheme = {
    header: {
      primaryColor: '#263238',
      secondaryColor: '#f9f9f9',
      highlightColor: '#FFC107',
      backgroundColor: '#607D8B',
    },
    body: {
      primaryColor: '#263238',
      secondaryColor: '#32a5f2',
      highlightColor: '#FFC107',
      backgroundColor: '#f9f9f9',
    },
    panel: {
      backgroundColor: '#CFD8DC'
    },
    global: {
    }
};