Skip to content

Commit b9fb07c

Browse files
authored
Merge pull request #3528 from czwe-01/thulasizwe/en/container-container
fix: migrated base64 background
2 parents 7ad5f0c + bc19087 commit b9fb07c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

shesha-reactjs/src/designer-components/_common-migrations/migrateStyles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const migrateStyles = <T extends ExtendedType>(prev: T, defaults?: Omit<I
5656
type: backgroundType,
5757
color: backgroundColor || defaults?.background?.color,
5858
repeat: backgroundRepeat || defaults?.background?.repeat || 'no-repeat',
59-
size: backgroundCover || defaults?.background?.size || 'cover',
59+
size: backgroundCover || defaults?.background?.size || 'auto',
6060
position: 'center',
6161
gradient: { direction: 'to right', colors: {} },
6262
url: backgroundUrl || defaults?.background?.url || '',

shesha-reactjs/src/designer-components/_settings/utils/background/utils.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export const getBackgroundStyle = (input: IBackgroundValue, jsStyle: React.CSSPr
5252
} else if (input?.type === 'url') {
5353
style.backgroundImage = `url(${input?.url})`;
5454
} else if (input?.type === 'image') {
55-
style.backgroundImage = `url(${input?.uploadFile})`;
55+
const uploadFile = input?.uploadFile;
56+
style.backgroundImage = `url(${uploadFile?.url || uploadFile})`;
5657
} else if (input?.type === 'storedFile') {
5758
style.backgroundImage = `url(${url})`;
5859
}

shesha-reactjs/src/designer-components/container/containerComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const ContainerComponent: IToolboxComponent<IContainerComponentProps> = {
2323
Factory: ({ model }) => {
2424
const { data: formData } = useFormData();
2525
const { globalState } = useGlobalState();
26-
const { borderRadius, borderTopRightRadius, borderBottomLeftRadius, borderTopLeftRadius, borderBottomRightRadius } = model.allStyles.borderStyles;
27-
const { styles, cx } = useStyles({ radius: { borderRadius, borderTopRightRadius, borderBottomLeftRadius, borderTopLeftRadius, borderBottomRightRadius } });
26+
const { styles, cx } = useStyles();
27+
2828
const {
2929
dimensionsStyles,
3030
borderStyles,

shesha-reactjs/src/designer-components/container/styles.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { createStyles } from '@/styles';
22
import { getOverflowStyle } from '../_settings/utils/overflow/util';
33

4-
export const useStyles = createStyles(({ css, cx }, { radius }) => {
4+
export const useStyles = createStyles(({ css, cx }) => {
55

66
const overflow = getOverflowStyle(true, false);
77
const overflowStyles = {
88
...overflow
99
};
1010

1111
const container = cx("sha-container-component", css`
12-
${radius}
1312
overflow: hidden;
1413
.sha-components-container-inner {
1514
${overflowStyles}

0 commit comments

Comments
 (0)