Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions components/fields/FileField.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ const FileField = (props) => {
document.body.onfocus = checkIfUnfocused;
};

const onRemoveImage = () => {
setFieldValue(field.name, "");
setStaticLink("");
}

return (
<div>
<div className="field_base">
Expand All @@ -69,25 +74,26 @@ const FileField = (props) => {
)}
{!props.hideUpload && <AppButtonLg
title={props.buttonPlaceholder ?? "Browse..."}
className="btn_general_lg--invert_colors field_btn"
className="btn_general_lg--invert_colors field_btn btn-upload"
onClick={openUploadMenu}
isDisabled={isFetching || props.disableAllButtons}
/>}
{props.showDeleteButton && (
{props.showDeleteButton && (staticLink || value) && (
<button
className={`new_entry_block_button_delete logo ${isFetching && `delete`}`}
onClick={()=>{props.onDelete(setStaticLink)}}
onClick={() => onRemoveImage()}
type="button"
disabled={isFetching || props.disableAllButtons}
>
<div>
<div className="btn-upload-text-container">
{props.isDeleting ? (
<AppButtonSpinner height={10} />
) : (
<FaTrash className="icon_block_button" />
)}
<p className="btn-upload-text">Remove</p>
</div>
<p>Remove</p>

</button>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions components/renderers/admin/UploadRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const UploadRenderer = ({
}
{...params}
hideUpload={disabled}
showDeleteButton
/>
{!isErrorDisabled && (
<ErrorRenderer name={name} errors={errors} touched={touched} />
Expand Down
25 changes: 23 additions & 2 deletions styles/klaudsolcms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1133,11 +1133,15 @@ $onFocus: #323C4E;
.new_entry_block_button_delete, .button_delete {
background-color: maroon;
color: white;

display: flex;
align-items: center;
justify-content: center;
border-radius: 5px !important;

&.logo {
width: 93px;
border-radius: 3px;
height: 38.5px;
height: 42px;
margin-left: 10px;
display: flex;

Expand All @@ -1148,6 +1152,23 @@ $onFocus: #323C4E;
}
}

.btn-upload {
border: none;
margin-left: 10px;

&-text {
margin: 0;
padding: 0;
&-container {
display: flex;
align-items: center;
justify-content: flex-start;
flex-direction: row;
margin-left: -5px;
}
}
}

.block_bar {
width: 100%;
border-bottom: 1px solid lightgray;
Expand Down