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

Palette not optional #1951

Merged
merged 7 commits into from
Jun 7, 2017
Merged

Conversation

christiango
Copy link
Member

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Some recent changes to the styling package made palette and font optional, which means you'll need to null check if if you re using the strict options in Typescript. In reality, those types should always be defined. Updating the APIs that allow overriding the theme to take a Partial to make things work without making props optional.

Focus areas to test

(optional)

@@ -115,7 +115,7 @@ export class ThemePage extends React.Component<any, any> {
private _onColorChanged(index: number, newColor: string) {
let { colors } = this.state;
let color = colors[index];
let theme: ITheme = {};
let theme: Partial<IPalette> = {};
Copy link
Member Author

@christiango christiango Jun 7, 2017

Choose a reason for hiding this comment

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

I believe there's a bug here. Either this is a palette (in which case the theme variable should be renames) or we are in correctly creating an object to pass to loadTheme. I assumed palette, so I changed the type, but would like confirmation.

Copy link
Member

@dzearing dzearing Jun 7, 2017

Choose a reason for hiding this comment

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

Huh, you're right. Can you rename this variable to pallete or something? Then you can just loadTheme({ pallete })

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I left it that way to make sure we noticed. I'll update it

@dzearing
Copy link
Member

dzearing commented Jun 7, 2017

Awesome catch, sorry about that. Didn't even know about Partial!

@christiango christiango merged commit 58ebffa into microsoft:master Jun 7, 2017
@christiango christiango deleted the palette-not-optional branch June 7, 2017 15:54
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants