diff --git a/packages/strapi-plugin-i18n/admin/src/components/CMEditViewCopyLocale/index.js b/packages/strapi-plugin-i18n/admin/src/components/CMEditViewCopyLocale/index.js index b6a95978d8..26e410f89c 100644 --- a/packages/strapi-plugin-i18n/admin/src/components/CMEditViewCopyLocale/index.js +++ b/packages/strapi-plugin-i18n/admin/src/components/CMEditViewCopyLocale/index.js @@ -10,11 +10,11 @@ import { BaselineAlignment, ModalConfirm, selectStyles, - DropdownIndicator, useContentManagerEditViewDataManager, request, } from 'strapi-helper-plugin'; import { getTrad } from '../../utils'; +import DropdownIndicator from '../DropdownIndicator'; import { cleanData, generateOptions } from './utils'; const CMEditViewCopyLocale = ({ appLocales, currentLocale, localizations, readPermissions }) => { diff --git a/packages/strapi-plugin-i18n/admin/src/components/CMEditViewLocalePicker/index.js b/packages/strapi-plugin-i18n/admin/src/components/CMEditViewLocalePicker/index.js index 8c11242d92..5ba4b6d3ed 100644 --- a/packages/strapi-plugin-i18n/admin/src/components/CMEditViewLocalePicker/index.js +++ b/packages/strapi-plugin-i18n/admin/src/components/CMEditViewLocalePicker/index.js @@ -5,12 +5,13 @@ import get from 'lodash/get'; import Select, { components } from 'react-select'; import { useIntl } from 'react-intl'; import { useTheme } from 'styled-components'; -import { BaselineAlignment, selectStyles, DropdownIndicator } from 'strapi-helper-plugin'; +import { BaselineAlignment, selectStyles } from 'strapi-helper-plugin'; import { useHistory } from 'react-router-dom'; import { stringify } from 'qs'; import { getTrad } from '../../utils'; import { addStatusColorToLocale, createLocalesOption } from './utils'; import CMEditViewCopyLocale from '../CMEditViewCopyLocale'; +import DropdownIndicator from '../DropdownIndicator'; import OptionComponent from './Option'; import Wrapper from './Wrapper'; diff --git a/packages/strapi-plugin-i18n/admin/src/components/DropdownIndicator/index.js b/packages/strapi-plugin-i18n/admin/src/components/DropdownIndicator/index.js new file mode 100644 index 0000000000..2a6b7a8d5a --- /dev/null +++ b/packages/strapi-plugin-i18n/admin/src/components/DropdownIndicator/index.js @@ -0,0 +1,40 @@ +import React from 'react'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { Flex } from '@buffetjs/core'; +import styled from 'styled-components'; +import PropTypes from 'prop-types'; + +const Wrapper = styled(Flex)` + height: 100%; + width: 32px; + justify-content: space-around; + background: #fafafb; + > svg { + align-self: center; + font-size: 11px; + color: #b3b5b9; + } +`; + +const DropdownIndicator = ({ selectProps: { menuIsOpen } }) => { + const icon = menuIsOpen ? 'caret-up' : 'caret-down'; + + return ( + + + + ); +}; + +DropdownIndicator.propTypes = { + selectProps: PropTypes.shape({ + menuIsOpen: PropTypes.bool.isRequired, + }).isRequired, +}; + +Wrapper.defaultProps = { + flexDirection: 'column', + justifyContent: 'center', +}; + +export default DropdownIndicator;