mirror of
https://github.com/strapi/strapi.git
synced 2025-08-03 06:18:37 +00:00
Fix dropdown indicator
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
d28c184daf
commit
48ab9bff46
@ -3,17 +3,18 @@ import ReactSelect, { components } from 'react-select';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Carret from '../Carret';
|
import Carret from '../Carret';
|
||||||
import { useTheme } from 'styled-components';
|
import { useTheme } from 'styled-components';
|
||||||
|
import DropdownIndicator from './DropdownIndicator';
|
||||||
import getStyles from './styles';
|
import getStyles from './styles';
|
||||||
|
|
||||||
export const DropdownIndicator = props => {
|
// export const DropdownIndicator = props => {
|
||||||
const theme = useTheme();
|
// const theme = useTheme();
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<components.DropdownIndicator {...props}>
|
// <components.DropdownIndicator {...props}>
|
||||||
<Carret fill={theme.main.colors.grey} />
|
// <Carret fill={theme.main.colors.grey} />
|
||||||
</components.DropdownIndicator>
|
// </components.DropdownIndicator>
|
||||||
);
|
// );
|
||||||
};
|
// };
|
||||||
|
|
||||||
export const Select = ({ children, onChange, selectedValue, ...props }) => {
|
export const Select = ({ children, onChange, selectedValue, ...props }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
@ -28,6 +28,8 @@ export { default as InputAddon } from './components/InputAddon';
|
|||||||
export { default as EmptyState } from './components/EmptyState';
|
export { default as EmptyState } from './components/EmptyState';
|
||||||
export * from './components/Tabs';
|
export * from './components/Tabs';
|
||||||
export * from './components/Select';
|
export * from './components/Select';
|
||||||
|
|
||||||
|
export { default as DropdownIndicator } from './components/Select/DropdownIndicator';
|
||||||
export * from './components/InjectionZone';
|
export * from './components/InjectionZone';
|
||||||
|
|
||||||
export { default as InputAddonWithErrors } from './components/InputAddonWithErrors';
|
export { default as InputAddonWithErrors } from './components/InputAddonWithErrors';
|
||||||
|
@ -56,6 +56,11 @@
|
|||||||
"@buffetjs/icons": "3.3.5-next.1",
|
"@buffetjs/icons": "3.3.5-next.1",
|
||||||
"@buffetjs/styles": "3.3.5-next.1",
|
"@buffetjs/styles": "3.3.5-next.1",
|
||||||
"@buffetjs/utils": "3.3.5-next.1",
|
"@buffetjs/utils": "3.3.5-next.1",
|
||||||
|
"@fortawesome/fontawesome-free": "^5.15.2",
|
||||||
|
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||||
|
"@fortawesome/free-brands-svg-icons": "^5.15.2",
|
||||||
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||||
|
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||||
"bootstrap": "^4.6.0",
|
"bootstrap": "^4.6.0",
|
||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
"immutable": "^3.8.2",
|
"immutable": "^3.8.2",
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
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;
|
|
||||||
background: #fafafb;
|
|
||||||
> svg {
|
|
||||||
align-self: center;
|
|
||||||
font-size: 11px;
|
|
||||||
color: #b3b5b9;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const DropdownIndicator = ({ selectProps: { menuIsOpen } }) => {
|
|
||||||
const icon = menuIsOpen ? 'caret-up' : 'caret-down';
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Wrapper>
|
|
||||||
<FontAwesomeIcon icon={icon} />
|
|
||||||
</Wrapper>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
DropdownIndicator.propTypes = {
|
|
||||||
selectProps: PropTypes.shape({
|
|
||||||
menuIsOpen: PropTypes.bool.isRequired,
|
|
||||||
}).isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
Wrapper.defaultProps = {
|
|
||||||
flexDirection: 'column',
|
|
||||||
justifyContent: 'center',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DropdownIndicator;
|
|
@ -4,6 +4,7 @@ import { FormattedMessage, useIntl } from 'react-intl';
|
|||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
import { findIndex, get, isArray, isEmpty, set } from 'lodash';
|
import { findIndex, get, isArray, isEmpty, set } from 'lodash';
|
||||||
import {
|
import {
|
||||||
|
DropdownIndicator,
|
||||||
LabelIconWrapper,
|
LabelIconWrapper,
|
||||||
NotAllowedInput,
|
NotAllowedInput,
|
||||||
request,
|
request,
|
||||||
@ -16,7 +17,6 @@ import pluginId from '../../pluginId';
|
|||||||
import SelectOne from '../SelectOne';
|
import SelectOne from '../SelectOne';
|
||||||
import SelectMany from '../SelectMany';
|
import SelectMany from '../SelectMany';
|
||||||
import ClearIndicator from './ClearIndicator';
|
import ClearIndicator from './ClearIndicator';
|
||||||
import DropdownIndicator from './DropdownIndicator';
|
|
||||||
import IndicatorSeparator from './IndicatorSeparator';
|
import IndicatorSeparator from './IndicatorSeparator';
|
||||||
import Option from './Option';
|
import Option from './Option';
|
||||||
import { A, BaselineAlignment } from './components';
|
import { A, BaselineAlignment } from './components';
|
||||||
|
@ -8,13 +8,13 @@ import { useTheme } from 'styled-components';
|
|||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import {
|
import {
|
||||||
BaselineAlignment,
|
BaselineAlignment,
|
||||||
|
DropdownIndicator,
|
||||||
ModalConfirm,
|
ModalConfirm,
|
||||||
selectStyles,
|
selectStyles,
|
||||||
useContentManagerEditViewDataManager,
|
useContentManagerEditViewDataManager,
|
||||||
request,
|
request,
|
||||||
} from 'strapi-helper-plugin';
|
} from 'strapi-helper-plugin';
|
||||||
import { getTrad } from '../../utils';
|
import { getTrad } from '../../utils';
|
||||||
import DropdownIndicator from '../DropdownIndicator';
|
|
||||||
import { cleanData, generateOptions } from './utils';
|
import { cleanData, generateOptions } from './utils';
|
||||||
|
|
||||||
const CMEditViewCopyLocale = ({ appLocales, currentLocale, localizations, readPermissions }) => {
|
const CMEditViewCopyLocale = ({ appLocales, currentLocale, localizations, readPermissions }) => {
|
||||||
|
@ -5,13 +5,12 @@ import get from 'lodash/get';
|
|||||||
import Select, { components } from 'react-select';
|
import Select, { components } from 'react-select';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { useTheme } from 'styled-components';
|
import { useTheme } from 'styled-components';
|
||||||
import { BaselineAlignment, selectStyles } from 'strapi-helper-plugin';
|
import { DropdownIndicator, BaselineAlignment, selectStyles } from 'strapi-helper-plugin';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { stringify } from 'qs';
|
import { stringify } from 'qs';
|
||||||
import { getTrad } from '../../utils';
|
import { getTrad } from '../../utils';
|
||||||
import { addStatusColorToLocale, createLocalesOption } from './utils';
|
import { addStatusColorToLocale, createLocalesOption } from './utils';
|
||||||
import CMEditViewCopyLocale from '../CMEditViewCopyLocale';
|
import CMEditViewCopyLocale from '../CMEditViewCopyLocale';
|
||||||
import DropdownIndicator from '../DropdownIndicator';
|
|
||||||
import OptionComponent from './Option';
|
import OptionComponent from './Option';
|
||||||
import Wrapper from './Wrapper';
|
import Wrapper from './Wrapper';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user