Skip to content

Commit

Permalink
chore: Remove removeHighContrastHeader global flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Longo committed May 17, 2024
1 parent 4fe3a14 commit a4379b7
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
2 changes: 0 additions & 2 deletions pages/app/app-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ interface AppUrlParams {
direction: 'ltr' | 'rtl';
visualRefresh: boolean;
motionDisabled: boolean;
removeHighContrastHeader: boolean;
appLayoutWidget: boolean;
}

Expand All @@ -31,7 +30,6 @@ const appContextDefaults: AppContextType = {
direction: 'ltr',
visualRefresh: THEME === 'default',
motionDisabled: false,
removeHighContrastHeader: false,
appLayoutWidget: false,
},
setMode: () => {},
Expand Down
4 changes: 1 addition & 3 deletions pages/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import StrictModeWrapper from './components/strict-mode-wrapper';
import AppContext, { AppContextProvider, parseQuery } from './app-context';

interface GlobalFlags {
removeHighContrastHeader?: boolean;
appLayoutWidget?: boolean;
}
const awsuiVisualRefreshFlag = Symbol.for('awsui-visual-refresh-flag');
Expand Down Expand Up @@ -84,14 +83,13 @@ function App() {
}

const history = createHashHistory();
const { direction, visualRefresh, appLayoutWidget, removeHighContrastHeader } = parseQuery(history.location.search);
const { direction, visualRefresh, appLayoutWidget } = parseQuery(history.location.search);

// The VR class needs to be set before any React rendering occurs.
window[awsuiVisualRefreshFlag] = () => visualRefresh;
if (!window[awsuiGlobalFlagsSymbol]) {
window[awsuiGlobalFlagsSymbol] = {};
}
window[awsuiGlobalFlagsSymbol].removeHighContrastHeader = removeHighContrastHeader;
window[awsuiGlobalFlagsSymbol].appLayoutWidget = appLayoutWidget;

// Apply the direction value to the HTML element dir attribute
Expand Down
5 changes: 0 additions & 5 deletions src/internal/utils/content-header-utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { getGlobalFlag } from './global-flags';

export const highContrastHeaderClassName = 'awsui-context-content-header';
export const shouldRemoveHighContrastHeader = (): boolean => !!getGlobalFlag('removeHighContrastHeader');
export const getContentHeaderClassName = (): string =>
shouldRemoveHighContrastHeader() ? '' : highContrastHeaderClassName;
1 change: 0 additions & 1 deletion src/internal/utils/global-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
export const awsuiGlobalFlagsSymbol = Symbol.for('awsui-global-flags');

interface GlobalFlags {
removeHighContrastHeader?: boolean;
appLayoutWidget?: boolean;
}

Expand Down

0 comments on commit a4379b7

Please sign in to comment.