2022-11-11 16:17:49 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { Card, CardBody } from '@wordpress/components';
|
|
|
|
import styled from '@emotion/styled';
|
2023-03-02 14:26:00 +00:00
|
|
|
import type { ReactNode } from 'react';
|
2022-11-11 16:17:49 +00:00
|
|
|
|
|
|
|
const StyledCard = styled( Card )`
|
|
|
|
border-radius: 3px;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledCardBody = styled( CardBody )`
|
2022-12-07 15:52:02 +00:00
|
|
|
padding: 24px;
|
|
|
|
|
2022-11-11 16:17:49 +00:00
|
|
|
// increasing the specificity of the styles to override the Gutenberg ones
|
|
|
|
&.is-size-medium.is-size-medium {
|
|
|
|
padding: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
h4 {
|
|
|
|
margin-top: 0;
|
|
|
|
margin-bottom: 1em;
|
|
|
|
}
|
|
|
|
|
|
|
|
> * {
|
|
|
|
margin-top: 0;
|
2022-12-07 15:52:02 +00:00
|
|
|
margin-bottom: 1.5em;
|
2022-11-11 16:17:49 +00:00
|
|
|
|
|
|
|
// fixing the spacing on the inputs and their help text, to ensure it is consistent
|
|
|
|
&:last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
> :last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
input,
|
|
|
|
select {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// spacing adjustment on "Express checkouts > Show express checkouts on" list
|
|
|
|
ul > li:last-child {
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
.components-base-control__field {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const SettingsCard = ( {
|
|
|
|
children,
|
|
|
|
...props
|
|
|
|
}: {
|
2022-12-07 15:52:02 +00:00
|
|
|
children: ReactNode;
|
2022-11-11 16:17:49 +00:00
|
|
|
} ): JSX.Element => (
|
|
|
|
<StyledCard>
|
|
|
|
<StyledCardBody { ...props }>{ children }</StyledCardBody>
|
|
|
|
</StyledCard>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default SettingsCard;
|