mirror of
https://github.com/strapi/strapi.git
synced 2025-12-29 08:04:51 +00:00
Fix DZ alignement
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
954852fac6
commit
7cdb688cd7
@ -0,0 +1,33 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import styled from 'styled-components';
|
||||
|
||||
// You can see in the index.js file that I used the design system to do the UI integration but
|
||||
// sometimes, we need to create some "temporary" custom style to fix the baseline alignment.
|
||||
// -----
|
||||
// TODO : remove this component. I think that this kind components should not exist in Strapi.
|
||||
// I create it to temporary fix the baseline alignment until we have the design system.
|
||||
|
||||
const BaselineAlignment = styled.div`
|
||||
padding-top: ${({ size, top }) => top && size};
|
||||
padding-right: ${({ size, right }) => right && size};
|
||||
padding-bottom: ${({ size, bottom }) => bottom && size};
|
||||
padding-left: ${({ size, left }) => left && size};
|
||||
`;
|
||||
|
||||
BaselineAlignment.defaultProps = {
|
||||
bottom: false,
|
||||
left: false,
|
||||
right: false,
|
||||
size: '0',
|
||||
top: false,
|
||||
};
|
||||
|
||||
BaselineAlignment.propTypes = {
|
||||
bottom: PropTypes.bool,
|
||||
left: PropTypes.bool,
|
||||
right: PropTypes.bool,
|
||||
size: PropTypes.string,
|
||||
top: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default BaselineAlignment;
|
||||
@ -7,6 +7,7 @@ export { default as routerPropTypes } from './commonPropTypes/router';
|
||||
export { default as themePropTypes } from './commonPropTypes/themeShape';
|
||||
// Components
|
||||
export { default as BackHeader } from './components/BackHeader';
|
||||
export { default as BaselineAlignement } from './components/BaselineAlignement';
|
||||
export { default as BlockerComponent } from './components/BlockerComponent';
|
||||
export { default as Button } from './components/Button';
|
||||
export { default as ButtonModal } from './components/ButtonModal';
|
||||
|
||||
@ -3,6 +3,7 @@ import styled from 'styled-components';
|
||||
const Wrapper = styled.div`
|
||||
position: relative;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 3px;
|
||||
text-align: center;
|
||||
.info {
|
||||
position: absolute;
|
||||
|
||||
@ -2,7 +2,7 @@ import styled from 'styled-components';
|
||||
|
||||
const Wrapper = styled.div`
|
||||
position: relative;
|
||||
padding-bottom: 23px;
|
||||
padding-bottom: 27px;
|
||||
`;
|
||||
|
||||
export default Wrapper;
|
||||
|
||||
@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { get } from 'lodash';
|
||||
import {
|
||||
BackHeader,
|
||||
BaselineAlignement,
|
||||
LiLink,
|
||||
LoadingIndicatorPage,
|
||||
CheckPermissions,
|
||||
@ -139,14 +140,18 @@ const EditView = ({ isSingleType, goBack, layout, slug, state, id, origin }) =>
|
||||
0: { name, fieldSchema, metadatas },
|
||||
},
|
||||
} = block;
|
||||
const baselineAlignementSize = blockIndex === 0 ? '3px' : '0';
|
||||
|
||||
return (
|
||||
<DynamicZone
|
||||
key={blockIndex}
|
||||
name={name}
|
||||
fieldSchema={fieldSchema}
|
||||
metadatas={metadatas}
|
||||
/>
|
||||
<>
|
||||
<BaselineAlignement top size={baselineAlignementSize} />
|
||||
<DynamicZone
|
||||
key={blockIndex}
|
||||
name={name}
|
||||
fieldSchema={fieldSchema}
|
||||
metadatas={metadatas}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user