Skip to content

Commit 44e16b8

Browse files
committed
feat(footer): removal of feature flag for the locale selector in footer
1 parent 55c670b commit 44e16b8

File tree

4 files changed

+24
-26
lines changed

4 files changed

+24
-26
lines changed

packages/react/src/components/Footer/LocaleButton.js

+23-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { DDS_FOOTER_LOCALE_BUTTON } from '../../internal/FeatureFlags.js';
2-
import { featureFlag } from '@carbon/ibmdotcom-utilities';
3-
41
import React, { useState, useEffect } from 'react';
52
import {
63
Button,
@@ -13,18 +10,17 @@ import { settings as ddsSettings } from '@carbon/ibmdotcom-utilities';
1310
import { LocaleAPI } from '@carbon/ibmdotcom-services';
1411
import { settings } from 'carbon-components';
1512
import { Globe20 } from '@carbon/icons-react';
13+
import PropTypes from 'prop-types';
1614

1715
const { stablePrefix } = ddsSettings;
1816
const { prefix } = settings;
1917

2018
/**
21-
* EXPERIMENTAL: Renders the locale button
22-
*
23-
* @private
24-
*
25-
* @param {Function} selectItem method to handle selected item
19+
* Renders the locale button
2620
*
27-
* @returns {object} JSX object
21+
* @param {object} props props object
22+
* @param {Function} props.selectItem method to handle selected item
23+
* @returns {*} {object} JSX object
2824
*/
2925
const LocaleButton = ({ selectItem }) => {
3026
const [isOpen, setIsOpen] = useState(false);
@@ -55,8 +51,7 @@ const LocaleButton = ({ selectItem }) => {
5551
return countryList;
5652
};
5753

58-
return featureFlag(
59-
DDS_FOOTER_LOCALE_BUTTON,
54+
return (
6055
<div className={`${prefix}--locale-btn__container`}>
6156
<Button
6257
data-autoid={`${stablePrefix}--locale-btn`}
@@ -110,4 +105,21 @@ const LocaleButton = ({ selectItem }) => {
110105
}
111106
};
112107

108+
/**
109+
* @property propTypes
110+
* @description Defined property types for component
111+
* @type {{selectItem: shim}}
112+
*/
113+
LocaleButton.propTypes = {
114+
selectItem: PropTypes.func,
115+
};
116+
117+
/**
118+
* @property defaultProps
119+
* @type {{selectItem: Function}}
120+
*/
121+
LocaleButton.defaultProps = {
122+
selectItem: () => {},
123+
};
124+
113125
export default LocaleButton;

packages/react/src/components/Footer/__tests__/LocaleButton.test.js

-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ import LocaleButton from '../LocaleButton';
1111
import { ComposedModal } from 'carbon-components-react';
1212
import mocklist from '../__data__/locale-list.json';
1313

14-
require('../../../internal/FeatureFlags.js');
15-
16-
jest.mock('../../../internal/FeatureFlags.js', () => ({
17-
DDS_FOOTER_LOCALE_BUTTON: true,
18-
}));
19-
2014
jest.mock('@carbon/ibmdotcom-services', () => ({
2115
LocaleAPI: {
2216
getLocale: jest.fn(() => Promise.resolve({ cc: 'us', lc: 'en' })),

packages/react/src/internal/FeatureFlags.js

-8
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ export const DDS_FLAGS_ALL = process.env.DDS_FLAGS_ALL === 'true' || false;
2424
export const DDS_MASTHEAD_L1 =
2525
process.env.DDS_MASTHEAD_L1 === 'true' || DDS_FLAGS_ALL || false;
2626

27-
/**
28-
* This determines if the locale selector will be rendered or not
29-
*
30-
* @type {string | boolean}
31-
*/
32-
export const DDS_FOOTER_LOCALE_BUTTON =
33-
process.env.DDS_FOOTER_LOCALE_BUTTON === 'true' || DDS_FLAGS_ALL || false;
34-
3527
/**
3628
* This flag turns on/off the ButtonGroup component
3729
*

packages/utilities/src/utilities/featureflag/featureflag.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @private
77
* @returns {object} JSX object
88
*
9-
* return featureFlag(DDS_FOOTER_LOCALE_BUTTON, <div>hello world</div>);
9+
* return featureFlag(DDS_FEATURE_NAME, <div>hello world</div>);
1010
*
1111
*/
1212
function featureFlag(flag, jsx) {

0 commit comments

Comments
 (0)