-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Federation): Show some icon for federated users on shares
Signed-off-by: fenn-cs <[email protected]>
- Loading branch information
Showing
7 changed files
with
60 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/*! | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
import { generateUrl } from '@nextcloud/router' | ||
|
||
const isDarkMode = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches === true | ||
|| document.querySelector('[data-themes*=dark]') !== null | ||
|
||
export const generateAvatarSvg = (userId: string, isExternalUser = false) => { | ||
console.log('User ID:', userId) | ||
const url = isDarkMode ? '/avatar/{userId}/32/dark' : '/avatar/{userId}/32' | ||
const avatarUrl = generateUrl(isExternalUser ? url + '?guestFallback=true' : url, { userId }) | ||
return `<svg width="32" height="32" viewBox="0 0 32 32" | ||
xmlns="http://www.w3.org/2000/svg" class="sharing-status__avatar"> | ||
<image href="${avatarUrl}" height="32" width="32" /> | ||
</svg>` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters