Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

allow any kind of theme for themeProvider and helper methods #544

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-ignore: Needed for ThemeProvider
import * as React from 'react'
import * as styledComponents from 'styled-components'
import IThemeProps, { BraveThemedStyledProps as ThemedStyledProps } from './theme-interface'
import { BraveThemedStyledProps as ThemedStyledProps } from './theme-interface'
// theme for testing
import TestTheme from './brave-default'

Expand All @@ -17,7 +17,7 @@ const {
// see: https://github.com/palantir/tslint/issues/3505
// It's possibly due to the rule upstream in tslint-config-standard
// tslint:disable-next-line
} = styledComponents as styledComponents.ThemedStyledComponentsModule<IThemeProps>
} = styledComponents as styledComponents.ThemedStyledComponentsModule<any>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's got to be a better way than just using any here, right? Wouldn't this lose all intellisense for theme props in all brave components (${p => p.theme.xyz})? Perhaps Partial<IThemeProps> would work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial won't work. <IThemeProps & any> might, but not sure what that will get us. Maybe it's good. Either way seem comment on brave/brave-core#3300 as to whether this is needed yet.


export default styled

Expand Down