pyramid-scheme-ceo / react-teams-tab

Example of a React-based MS Teams tab
19 stars 14 forks source link

@fluentui/react-northstar/dist/es\"' has no exported member 'themes'." #2

Open rickblommetjes opened 4 years ago

rickblommetjes commented 4 years ago

Hi Matt,

I liked your example, but I'm running into an issue in teams-theme-helper.ts

I seems something has changed at the site of Fluent UI Northstar, I keep getting the error message

@fluentui/react-northstar/dist/es\"' has no exported member 'themes'."

the current version of this framework in the package.json is: "@fluentui/react-northstar": "^0.50.0"

Do you have the same issue or is it something at my side?

pyramid-scheme-ceo commented 3 years ago

Hi @Easystep2, thanks for finding this issue (and sorry for not responding earlier), I'm getting the same error when upgrading to the latest fluent ui too. However I'm not exactly sure where the themes have moved to... and the fluent ui docs haven't changed yet, so I'll leave this repo on v0.48.0 until I know how to fix it.

TobiKr commented 3 years ago

Hi @Easystep2 and @pyramid-scheme-ceo,

I fixed it with changing teams-theme-helper.ts in this way. I am aware that the solution is not quite nice due to the missing type of the return value. This is my first typescript project and I am happy if anyone has a better solution :-)


import { teamsTheme,teamsDarkTheme, teamsHighContrastTheme } from '@fluentui/react-northstar';
import { TeamsThemes } from '../constants';

export default class TeamsThemeHelper {
    public static getTheme(themeStr: string | undefined): any {
        themeStr = themeStr || '';

        switch (themeStr) {
            case TeamsThemes.dark:
                return teamsDarkTheme;
            case TeamsThemes.contrast:
                return teamsHighContrastTheme;
            case TeamsThemes.default:
            default:
                return teamsTheme;
        }
    }
}