Skip to content
Merged
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
33 changes: 27 additions & 6 deletions src/components/events/partials/ModalTabsAndPages/NewSourcePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,39 @@ const Upload = <T extends RequiredFormPropsUpload>({
</p>
</td>
<td>
<div className="file-upload">
<div
className="fake-file-input blue-btn"
role="button"
tabIndex={0}
onClick={() => document.getElementById(asset.id)?.click()}
onKeyDown={e => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
document.getElementById(asset.id)?.click();
}
}}
aria-label={t("EVENTS.EVENTS.NEW.SOURCE.UPLOAD.ARIA_FILE_PICKER")}
>
<span className="file-button">
{t("EVENTS.EVENTS.NEW.SOURCE.UPLOAD.FILE_PICKER")}
</span>

<span className="file-text">
{asset.file && asset.file.length > 0
? asset.file[0].name
: t("EVENTS.EVENTS.NEW.SOURCE.UPLOAD.NO_FILE_PICKED")}
</span>

<input
id={asset.id}
className="blue-btn file-select-btn"
type="file"
name={`uploadAssetsTrack.${key}.file`}
hidden
accept={asset.accept}
multiple={asset.multiple}
onChange={e =>
handleChange(e, `uploadAssetsTrack.${key}.file`)
}
type="file"
multiple={asset.multiple}
name={`uploadAssetsTrack.${key}.file`}
tabIndex={0}
/>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,9 @@
"CAPTION": "Upload",
"RECORDING_ELEMENTS": "Recording elements",
"RECORDING_METADATA": "Recording metadata",
"FILE_PICKER": "Upload file...",
"NO_FILE_PICKED": "No file chosen",
"ARIA_FILE_PICKER": "Upload file",
"SEGMENTABLE": {
"SHORT": "Presentation",
"DETAIL": "The file contains a recording of a what is shown to an audience (Keynote, Powerpoint, etc)."
Expand Down
34 changes: 34 additions & 0 deletions src/styles/components/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,37 @@ input[type="radio"].ios {

}

/**
* Fake upload for create event dialog
*/
.fake-file-input {
display: flex;
align-items: center;
width: 100%;
min-width: 256px;
max-width: 320px;
max-height: 34px;
}

/* Left button */
.file-button {
display: flex;
justify-content: center;
align-items: center;
max-height: 22px;
background: variables.$modal-nav-bg-color;
border: 1px solid variables.$main-border-color;
border-radius: 4px;
padding: 0px 8px;
color: variables.$color-black;
margin-right: 8px;
white-space: nowrap;
}

/* Right text */
.file-text {
color: variables.$color-white;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
7 changes: 0 additions & 7 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,3 @@ select {
input.disabled, select.disabled {
background: variables.$modal-nav-bg-color;
}

// Use HTML5 input field for file upload
.file-upload > input[type="file"] {
width: 100%;
visibility: visible !important;
text-align: left;
}
Loading