react-teams-tab icon indicating copy to clipboard operation
react-teams-tab copied to clipboard

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

Open rickblommetjes opened this issue 4 years ago • 2 comments

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?

rickblommetjes avatar Jul 27 '20 12:07 rickblommetjes

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.

pyramid-scheme-ceo avatar Apr 17 '21 00:04 pyramid-scheme-ceo

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;
        }
    }
}

TobiKr avatar May 08 '21 16:05 TobiKr