1
- import { DDS_FOOTER_LOCALE_BUTTON } from '../../internal/FeatureFlags.js' ;
2
- import { featureFlag } from '@carbon/ibmdotcom-utilities' ;
3
-
4
1
import React , { useState , useEffect } from 'react' ;
5
2
import {
6
3
Button ,
@@ -13,18 +10,17 @@ import { settings as ddsSettings } from '@carbon/ibmdotcom-utilities';
13
10
import { LocaleAPI } from '@carbon/ibmdotcom-services' ;
14
11
import { settings } from 'carbon-components' ;
15
12
import { Globe20 } from '@carbon/icons-react' ;
13
+ import PropTypes from 'prop-types' ;
16
14
17
15
const { stablePrefix } = ddsSettings ;
18
16
const { prefix } = settings ;
19
17
20
18
/**
21
- * EXPERIMENTAL: Renders the locale button
22
- *
23
- * @private
24
- *
25
- * @param {Function } selectItem method to handle selected item
19
+ * Renders the locale button
26
20
*
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
28
24
*/
29
25
const LocaleButton = ( { selectItem } ) => {
30
26
const [ isOpen , setIsOpen ] = useState ( false ) ;
@@ -55,8 +51,7 @@ const LocaleButton = ({ selectItem }) => {
55
51
return countryList ;
56
52
} ;
57
53
58
- return featureFlag (
59
- DDS_FOOTER_LOCALE_BUTTON ,
54
+ return (
60
55
< div className = { `${ prefix } --locale-btn__container` } >
61
56
< Button
62
57
data-autoid = { `${ stablePrefix } --locale-btn` }
@@ -110,4 +105,21 @@ const LocaleButton = ({ selectItem }) => {
110
105
}
111
106
} ;
112
107
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
+
113
125
export default LocaleButton ;
0 commit comments