1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[PM-11903] - add file send component (#11132)

* wip - send file details

* wip - file send

* send file details

* fix click on send list container

* remove popup code

* remove popup code

* finalize send file details

* address PR feedback. add base form to send form

* revert changes to send list items container

* revert changes to send list items container

---------

Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
This commit is contained in:
Jordan Aasen
2024-09-18 14:36:53 -07:00
committed by GitHub
parent 2b85392b0f
commit 00f2317a82
9 changed files with 152 additions and 15 deletions

View File

@@ -1136,6 +1136,9 @@
"file": {
"message": "File"
},
"fileToShare": {
"message": "File to share"
},
"selectFile": {
"message": "Select a file"
},

View File

@@ -117,25 +117,18 @@ export class SendAddEditComponent {
)
.subscribe((config) => {
this.config = config;
this.headerText = this.getHeaderText(config.mode, config.sendType);
this.headerText = this.getHeaderText(config.mode);
});
}
/**
* Gets the header text based on the mode and type.
* Gets the header text based on the mode.
* @param mode The mode of the send form.
* @param type The type of the send form.
* @returns The header text.
*/
private getHeaderText(mode: SendFormMode, type: SendType) {
const headerKey =
mode === "edit" || mode === "partial-edit" ? "editItemHeader" : "newItemHeader";
switch (type) {
case SendType.Text:
return this.i18nService.t(headerKey, this.i18nService.t("sendTypeText"));
case SendType.File:
return this.i18nService.t(headerKey, this.i18nService.t("sendTypeFile"));
}
private getHeaderText(mode: SendFormMode) {
return this.i18nService.t(
mode === "edit" || mode === "partial-edit" ? "editSend" : "createSend",
);
}
}