Skip to content

Commit

Permalink
Merge pull request #4008 from crazyserver/MOBILE-4437
Browse files Browse the repository at this point in the history
Mobile 4437
  • Loading branch information
dpalou authored Apr 15, 2024
2 parents 9380d24 + 93f513c commit a03937d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/core/components/mod-icon/mod-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
&.version_40 {
background-color: var(--gray-100);

--color: white;

@each $type, $value in $activity-icon-background-colors {
&.#{$type}:not(.branded) {
background-color: var(--activity-40-#{$type});
::ng-deep svg, img {
filter: brightness(0) invert(1);
}
}
}
}
Expand All @@ -56,10 +57,10 @@
--padding-bottom: var(--module-legacy-icon-padding, 8px);
}

&:not(.branded) {
&.version_current:not(.branded) {
::ng-deep svg,
::ng-deep svg * {
fill: var(--color);
fill: var(--color) !important;
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/core/components/mod-icon/mod-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export class CoreModIconComponent implements OnInit, OnChanges {

this.modNameTranslated = CoreCourse.translateModuleName(this.modname, this.fallbackTranslation);

this.setIsBranded();
this.setPurposeClass();

await this.setIcon();
Expand All @@ -113,7 +112,7 @@ export class CoreModIconComponent implements OnInit, OnChanges {
* @returns wether the icon does not need to be filtered.
*/
protected async setIsBranded(): Promise<void> {
if (!this.colorize || this.isBranded !== undefined) {
if (!this.colorize) {
// It doesn't matter.
return;
}
Expand All @@ -127,7 +126,6 @@ export class CoreModIconComponent implements OnInit, OnChanges {

// No icon or local icon (not legacy), colorize it.
if (!this.iconUrl || this.isLocalUrl) {

// Exception for bigbluebuttonbn, it's the only one that has a branded icon.
if (this.iconVersion === IconVersion.VERSION_4_0 && this.modname === 'bigbluebuttonbn') {
this.isBranded = true;
Expand Down Expand Up @@ -174,6 +172,7 @@ export class CoreModIconComponent implements OnInit, OnChanges {

if (!this.iconUrl) {
this.loadFallbackIcon();
this.setIsBranded();

return;
}
Expand All @@ -189,6 +188,8 @@ export class CoreModIconComponent implements OnInit, OnChanges {
!this.isLocalUrl &&
this.getComponentNameFromIconUrl(this.iconUrl) != this.modname;

this.setIsBranded();

await this.setSVGIcon();
}

Expand Down

0 comments on commit a03937d

Please sign in to comment.