Fix design relations

This commit is contained in:
soupette 2019-12-04 18:23:07 +01:00
parent 7358d7eaf2
commit 2c2e012b8a
4 changed files with 55 additions and 18 deletions

View File

@ -4,35 +4,54 @@ import { ModalHeader } from 'reactstrap';
const HeaderModal = styled(ModalHeader)` const HeaderModal = styled(ModalHeader)`
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 17px;
width: auto; width: auto;
padding: 0; padding: 0;
z-index: 999; z-index: 999;
border: 0; border: 0;
> button { > button {
margin: 0; margin: 0;
margin-top: 12px !important;
padding: 20px; padding: 20px;
color: #c3c5c8;
opacity: 1; opacity: 1;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: 100; font-weight: 100;
position: relative;
transform: rotate(45deg);
&:hover, &:hover,
&:focus { &:focus {
color: #c3c5c8; opacity: 1 !important;
opacity: 1;
outline: 0 !important; outline: 0 !important;
cursor: pointer; cursor: pointer;
} }
> span { > span {
display: none; z-index: -1;
&:before {
content: ' ';
position: absolute;
display: block;
width: 2px;
left: 13px;
top: 13px;
bottom: 9px;
z-index: 9;
}
&:after {
content: ' ';
position: absolute;
display: block;
height: 2px;
top: 17px;
left: 9px;
right: 8px;
z-index: 9;
}
:before,
:after {
background-color: #9ea7b8;
}
} }
&:before { }
content: '\f00d';
-webkit-font-smoothing: antialiased;
font-family: 'FontAwesome';
font-weight: 400;
font-size: 1.2rem;
}
`; `;
export default HeaderModal; export default HeaderModal;

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Inputs } from '@buffetjs/custom'; import { Inputs } from '@buffetjs/custom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useGlobalContext } from 'strapi-helper-plugin'; import { useGlobalContext } from 'strapi-helper-plugin';
import getTrad from '../../utils/getTrad'; import getTrad from '../../utils/getTrad';
import RelationTargetPicker from '../RelationTargetPicker'; import RelationTargetPicker from '../RelationTargetPicker';
@ -24,7 +25,10 @@ const RelationFormBox = ({
<div className="box-header"> <div className="box-header">
{isMain ? ( {isMain ? (
<p> <p>
<i className="fa fa-caret-square-o-right" /> <FontAwesomeIcon
icon={['far', 'caret-square-right']}
style={{ fontSize: 12, marginTop: '-3px' }}
/>
{header} {header}
</p> </p>
) : ( ) : (

View File

@ -1,5 +1,6 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { get } from 'lodash'; import { get } from 'lodash';
import { import {
Dropdown, Dropdown,
@ -35,11 +36,15 @@ const RelationTargetPicker = ({
> >
<DropdownToggle caret> <DropdownToggle caret>
<p> <p>
<i className="fa fa-caret-square-o-right" /> {/* <i className="fa fa-caret-square-o-right" /> */}
<FontAwesomeIcon
icon={['far', 'caret-square-right']}
style={{ fontSize: 12, marginTop: '-3px' }}
/>
{targetFriendlyName} {targetFriendlyName}
</p> </p>
</DropdownToggle> </DropdownToggle>
<DropdownMenu> <DropdownMenu style={{ paddingTop: '3px' }}>
{sortedContentTypesList.map(({ uid, title }) => { {sortedContentTypesList.map(({ uid, title }) => {
return ( return (
<DropdownItem <DropdownItem
@ -58,7 +63,10 @@ const RelationTargetPicker = ({
}} }}
> >
<p> <p>
<i className="fa fa-caret-square-o-right" /> <FontAwesomeIcon
icon={['far', 'caret-square-right']}
style={{ fontSize: 12, marginTop: '-3px' }}
/>
{title} {title}
</p> </p>
</DropdownItem> </DropdownItem>

View File

@ -1288,7 +1288,13 @@ const FormModal = () => {
: 'primary' : 'primary'
} }
onClick={handleSubmit} onClick={handleSubmit}
icon={isCreatingAttribute} icon={
(isCreatingAttribute &&
!isCreatingComponentFromAView &&
state.step !== '1') ||
(state.modalType === 'addComponentToDynamicZone' &&
isCreatingComponentFromAView)
}
> >
{getButtonSubmitMessage()} {getButtonSubmitMessage()}
</Button> </Button>