Skip to content

Commit aa54866

Browse files
committed
fix: file styles
1 parent 6893d2d commit aa54866

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

shesha-reactjs/src/components/fileUpload/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const FileUpload: FC<IFileUploadProps> = ({
198198
return (
199199
<div>
200200
{showThumbnailControls && styledfileControls()}
201-
<span title={file.name}>
201+
<a title={file.name}>
202202
<Space>
203203
<div className="thumbnail-item-name">
204204
{(listType === 'text' || !hideFileName) && (
@@ -214,7 +214,7 @@ export const FileUpload: FC<IFileUploadProps> = ({
214214
{showTextControls && fileControls(theme.application.primaryColor)}
215215
</div>
216216
</Space>
217-
</span>
217+
</a>
218218
</div>
219219
);
220220
};
@@ -244,7 +244,7 @@ export const FileUpload: FC<IFileUploadProps> = ({
244244
icon={!fileInfo ? <UploadOutlined /> : <PictureOutlined />}
245245
type="link"
246246
disabled={!showUploadButton}
247-
style={{width: '100%', height: '100%', justifyContent: props?.style?.textAlign || 'left'}}
247+
style={{width: '100%', height: '100%'}}
248248
>
249249
{listType === 'text' ? `(press to upload)` : null}
250250
</Button>

shesha-reactjs/src/components/fileUpload/styles/styles.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
3838
height,
3939
maxHeight,
4040
minHeight,
41-
textAlign = 'center',
41+
textAlign = 'left',
4242
} = style || {};
4343

4444
const { layout, isDragger, hideFileName, listType } = model;
@@ -183,7 +183,8 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
183183
}
184184
185185
.${prefixCls}-upload {
186-
${layout && !isDragger && 'width: var(--thumbnail-width) !important;'};
186+
187+
width: ${layout && !isDragger ? 'var(--thumbnail-width)' : '100%'} !important;
187188
${layout && !isDragger && 'height: var(--thumbnail-height) !important'};
188189
border-radius: ${borderRadius} !important;
189190
align-items: center;
@@ -201,11 +202,10 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
201202
202203
.ant-btn {
203204
color: ${primaryColor || token.colorPrimary} !important;
205+
${commonTextStyles}
204206
padding: 0;
205207
* {
206-
font-size: ${fontSize} !important;
207-
font-weight: ${fontWeight} !important;
208-
font-family: ${fontFamily} !important;
208+
${commonTextStyles}
209209
}
210210
${listType === 'thumbnail' && style}
211211
width: 100%;

shesha-reactjs/src/designer-components/fileUpload/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const FileUploadComponent: IToolboxComponent<IFileUploadProps> = {
4747
Factory: ({ model }) => {
4848
const { backendUrl } = useSheshaApplication();
4949

50-
const finalStyle = !model.enableStyleOnReadonly && model.readOnly ? {
50+
const finalStyle = (!model.enableStyleOnReadonly && model.readOnly) || model.listType === 'text' ? {
5151
...model.allStyles.fontStyles,
5252
...model.allStyles.dimensionsStyles,
5353
} : model.allStyles.fullStyle;

0 commit comments

Comments
 (0)