mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(selfhost): branding image origins and theme colour (#3389)
This commit is contained in:
1 parent
cca8227ca6
commit
edc913096a
27 files changed
+724
-49
No files matched your search
+2
-11
@@ -1,11 +1,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import RuntimeConfig from '@app/features/app/state/RuntimeConfig';
|
||||
import {getUserAccentColor} from '@app/features/theme/utils/AccentColorUtils';
|
||||
import {ProfileBody} from '@app/features/user/components/modals/user_profile_modal/ProfileBody';
|
||||
import {ProfileMediaHeader} from '@app/features/user/components/modals/user_profile_modal/ProfileMediaHeader';
|
||||
import type {ProfileModalContentProps} from '@app/features/user/components/modals/user_profile_modal/UserProfileModalShared';
|
||||
import * as AvatarUtils from '@app/features/user/utils/AvatarUtils';
|
||||
import * as ProfileDisplayUtils from '@app/features/user/utils/ProfileDisplayUtils';
|
||||
import {resolveProfileGuildMembership, toProfileDisplayContext} from '@app/features/user/utils/ProfileGuildMembership';
|
||||
import {FLUXERBOT_ID} from '@fluxer/constants/src/AppConstants';
|
||||
@@ -30,11 +28,7 @@ export const ProfileModalContent: React.FC<ProfileModalContentProps> = observer(
|
||||
}) => {
|
||||
const effectiveProfile = profile?.getEffectiveProfile() ?? null;
|
||||
const isSystemUser = user.id === FLUXERBOT_ID;
|
||||
const systemThemeColor =
|
||||
isSystemUser && RuntimeConfig.isSelfHosted()
|
||||
? RuntimeConfig.getSnapshotOrNull()?.appPublic.branding.theme_color
|
||||
: null;
|
||||
const bannerColor = systemThemeColor ?? getUserAccentColor(user, effectiveProfile?.accent_color);
|
||||
const bannerColor = getUserAccentColor(user, effectiveProfile?.accent_color);
|
||||
const membership = resolveProfileGuildMembership(profile);
|
||||
const profileContext = useMemo<ProfileDisplayUtils.ProfileDisplayContext>(
|
||||
() =>
|
||||
@@ -46,13 +40,10 @@ export const ProfileModalContent: React.FC<ProfileModalContentProps> = observer(
|
||||
}),
|
||||
[user, profile, membership],
|
||||
);
|
||||
const {avatarUrl: profileAvatarUrl, hoverAvatarUrl: profileHoverAvatarUrl} = useMemo(
|
||||
const {avatarUrl, hoverAvatarUrl} = useMemo(
|
||||
() => ProfileDisplayUtils.getProfileAvatarUrls(profileContext, previewOverrides, MEDIA_PROXY_AVATAR_SIZE_PROFILE),
|
||||
[profileContext, previewOverrides],
|
||||
);
|
||||
const systemAvatarUrl = AvatarUtils.getSystemUserBrandingAvatarURL(user.id);
|
||||
const avatarUrl = systemAvatarUrl ?? profileAvatarUrl;
|
||||
const hoverAvatarUrl = systemAvatarUrl ?? profileHoverAvatarUrl;
|
||||
const {bannerUrl, hoverBannerUrl} = useMemo(
|
||||
() =>
|
||||
ProfileDisplayUtils.getProfileBannerUrls(
|
||||
|
||||
Reference in new issue
Block a user