Skip to content

Commit aff2b67

Browse files
authored
Merge pull request #64288 from nextcloud/backport/64184/stable35
[stable35] fix: update shared resource calendar icon for different theme
2 parents 8df0831 + 1e3ae96 commit aff2b67

6 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎apps/profile/lib/Controller/ProfileApiController.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ private function getSharedCalendarEvents(string $userId) {
125125
'label' => $event['objects'][0]['SUMMARY'][0],
126126
'text' => $this->formatter->formatTimeSpan($start, \DateTime::createFromImmutable($now)),
127127
'href' => $href,
128-
'img' => $this->urlGenerator->getAbsoluteURL($this->appManager->getAppIcon('calendar')),
128+
'img' => $this->urlGenerator->getAbsoluteURL($this->appManager->getAppIcon('calendar', true)),
129+
'themedIcon' => true,
129130
];
130131
}
131132
return $result;

‎apps/profile/lib/ResponseDefinitions.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* label: string,
1515
* text: string,
1616
* href: string,
17-
* img: string
17+
* img: string,
18+
* themedIcon?: bool,
1819
* }
1920
*/
2021
class ResponseDefinitions {

‎apps/profile/openapi.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
},
6565
"img": {
6666
"type": "string"
67+
},
68+
"themedIcon": {
69+
"type": "boolean"
6770
}
6871
}
6972
}

‎apps/profile/src/components/SharedResourcesSection.vue‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const title = computed(() => t('profile', 'You & {user}', { user: props.displayN
3535
<template #icon>
3636
<img
3737
class="shared-resources__icon"
38+
:class="{ 'shared-resources__icon--themed': resource.themedIcon }"
3839
:src="resource.img"
3940
alt=""
4041
decoding="async"
@@ -74,6 +75,10 @@ const title = computed(() => t('profile', 'You & {user}', { user: props.displayN
7475
height: 32px;
7576
object-fit: contain;
7677
border-radius: var(--border-radius);
78+
79+
&--themed {
80+
filter: var(--background-invert-if-dark);
81+
}
7782
}
7883
}
7984

‎apps/profile/src/services/sharedResources.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface SharedResource {
1313
text: string
1414
href: string
1515
img: string
16+
/** Monochrome app icon that should follow the text color via CSS filter. */
17+
themedIcon?: boolean
1618
}
1719

1820
interface OcsResponse<T> {

‎openapi.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,6 +3700,9 @@
37003700
},
37013701
"img": {
37023702
"type": "string"
3703+
},
3704+
"themedIcon": {
3705+
"type": "boolean"
37033706
}
37043707
}
37053708
},

0 commit comments

Comments
 (0)