diff --git a/src/hooks/useReleaseNotesQuery.ts b/src/hooks/useReleaseNotesQuery.ts index 7e82143..79301c2 100644 --- a/src/hooks/useReleaseNotesQuery.ts +++ b/src/hooks/useReleaseNotesQuery.ts @@ -12,9 +12,8 @@ interface ReleaseNotesQueryProps { } export function useReleaseNotesQuery(options?: ReleaseNotesQueryProps) { - const applicationName = options?.overrideAppName - ? options?.overrideAppName - : getAppName(import.meta.env.VITE_NAME); + const applicationName = + options?.overrideAppName ?? getAppName(import.meta.env.VITE_NAME); return useQuery({ queryKey: ['get-all-release-notes'], diff --git a/src/providers/FeatureToggleProvider.tsx b/src/providers/FeatureToggleProvider.tsx index db826b8..ac68c4c 100644 --- a/src/providers/FeatureToggleProvider.tsx +++ b/src/providers/FeatureToggleProvider.tsx @@ -54,12 +54,11 @@ export const FeatureToggleProvider: FC = ({ overrideAppName, overrideEnvironment, }) => { - const applicationName = overrideAppName - ? overrideAppName - : getAppName(import.meta.env.VITE_NAME); - const environmentName = overrideEnvironment - ? overrideEnvironment - : getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME); + const applicationName = + overrideAppName ?? getAppName(import.meta.env.VITE_NAME); + const environmentName = + overrideEnvironment ?? + getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME); const { data: featureToggle, diff --git a/src/providers/TutorialProvider/TutorialProvider.stories.tsx b/src/providers/TutorialProvider/TutorialProvider.stories.tsx index 92a1e7b..a0059a9 100644 --- a/src/providers/TutorialProvider/TutorialProvider.stories.tsx +++ b/src/providers/TutorialProvider/TutorialProvider.stories.tsx @@ -5,7 +5,7 @@ import { Button, Typography } from '@equinor/eds-core-react'; import { StoryFn } from '@storybook/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import TutorialProvider from './TutorialProvider'; +import { TutorialProvider } from './TutorialProvider'; import { CustomTutorialComponent } from './TutorialProvider.types'; import { Tutorial } from 'src/api'; diff --git a/src/providers/TutorialProvider/TutorialProvider.tsx b/src/providers/TutorialProvider/TutorialProvider.tsx index 53c8d6e..af93a6d 100644 --- a/src/providers/TutorialProvider/TutorialProvider.tsx +++ b/src/providers/TutorialProvider/TutorialProvider.tsx @@ -78,12 +78,10 @@ export const TutorialProvider: FC = ({ >(undefined); const [viewportWidth, setViewportWidth] = useState(window.innerWidth); const dialogRef = useRef(null); - const appName = overrideAppName - ? overrideAppName - : getAppName(import.meta.env.VITE_NAME); - const environmentName = overrideEnvironmentName - ? overrideEnvironmentName - : getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME); + const appName = overrideAppName ?? getAppName(import.meta.env.VITE_NAME); + const environmentName = + overrideEnvironmentName ?? + getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME); const currentStepObject = useMemo(() => { if (!activeTutorial) return; return activeTutorial.steps.at(currentStep); diff --git a/src/utils/environment.stories.tsx b/src/utils/environment.stories.tsx index 17596a4..374aa83 100644 --- a/src/utils/environment.stories.tsx +++ b/src/utils/environment.stories.tsx @@ -20,13 +20,6 @@ export const GetAppName: StoryFn = () => { return ; }; -export const GetClientId: StoryFn = () => { - const codeText = ` - getClientId() => gets CLIENT_ID env variable - `; - return ; -}; - export const GetApiUrl: StoryFn = () => { const codeText = ` getApiUrl() => gets API_URL env variable @@ -34,23 +27,9 @@ export const GetApiUrl: StoryFn = () => { return ; }; -export const GetApiScope: StoryFn = () => { - const codeText = ` - getApiScope() => gets API_SCOPE env variable - `; - return ; -}; - export const GetEnvironmentName: StoryFn = () => { const codeText = ` getEnvironmentName() => gets ENVIRONMENT_NAME env variable `; return ; }; - -export const GetIsMock: StoryFn = () => { - const codeText = ` - getIsMock() => gets IS_MOCK env variable - `; - return ; -};