Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
--global committed Nov 15, 2024
1 parent a5038a9 commit 51e1e86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
{{ (hideIcon ? "createSend" : "new") | i18n }}
</button>
<bit-menu #itemOptions>
<a bitMenuItem [routerLink]="['/add-send']" [queryParams]="buildQueryParams(sendType.Text)">
<a
bitMenuItem
[routerLink]="buildRouterLink(sendType.File)"
[queryParams]="buildQueryParams(sendType.Text)"
>
<i class="bwi bwi-file-text" slot="start" aria-hidden="true"></i>
{{ "sendTypeText" | i18n }}
</a>
<a bitMenuItem [routerLink]="['/add-send']" [queryParams]="buildQueryParams(sendType.File)">
<a
bitMenuItem
[routerLink]="buildRouterLink(sendType.File)"
[queryParams]="buildQueryParams(sendType.File)"
>
<i class="bwi bwi-file" slot="start" aria-hidden="true"></i>
{{ "sendTypeFile" | i18n }}
<button type="button" slot="end" *ngIf="hasNoPremium" bitBadge variant="success">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ export class NewSendDropdownComponent implements OnInit {
));
}

buildQueryParams(type: SendType) {
buildRouterLink(type: SendType) {
if (this.hasNoPremium && type === SendType.File) {
return "/premium";
} else {
return "/add-send";
}
}

buildQueryParams(type: SendType) {
if (this.hasNoPremium && type === SendType.File) {
return null;
}
return { type: type, isNew: true };
}
Expand Down

0 comments on commit 51e1e86

Please sign in to comment.