fix: Show workspace logo as square in General settings (#14538)

This commit is contained in:
Tom Moor authored and GitHub committed 2026-11-11 23:37:48 -05:00
1 parent f43d8bcba9
commit bf0dbc8545
2 files changed
+12 -4

No files matched your search

+2
View File
@@ -13,6 +13,7 @@ import type { CustomTheme } from "@shared/types";
import { TOCPosition, TeamPreference, UserPreference } from "@shared/types";
import { getBaseDomain } from "@shared/utils/domains";
import { TeamValidation } from "@shared/validations";
import { AvatarVariant } from "~/components/Avatar/Avatar";
import Button from "~/components/Button";
import ButtonLink from "~/components/ButtonLink";
import DefaultCollectionInputSelect from "~/components/DefaultCollectionInputSelect";
@@ -221,6 +222,7 @@ function Details() {
onError={handleAvatarError}
model={team}
borderRadius={0}
variant={AvatarVariant.Square}
/>
</SettingRow>
<SettingRow
+10 -4
View File
@@ -20,6 +20,8 @@ type Props = ImageUploadProps & {
* existing avatar. Defaults to true.
*/
showRemoveOption?: boolean;
/** The shape of the avatar preview. Defaults to round. */
variant?: AvatarVariant;
};
export default function ImageInput({
@@ -27,13 +29,14 @@ export default function ImageInput({
onSuccess,
alt,
showRemoveOption = true,
variant = AvatarVariant.Round,
...rest
}: Props) {
const { t } = useTranslation();
return (
<Flex gap={8} justify="space-between">
<ImageBox>
<ImageBox $variant={variant}>
<ImageUpload
onSuccess={onSuccess}
submitText={t("Crop image")}
@@ -42,7 +45,7 @@ export default function ImageInput({
<Avatar
model={model}
size={AvatarSize.Upload}
variant={AvatarVariant.Round}
variant={variant}
alt={alt}
/>
<Flex auto align="center" justify="center" className="upload">
@@ -64,11 +67,14 @@ const avatarStyles = `
height: ${AvatarSize.Upload}px;
`;
const ImageBox = styled(Flex)`
const ImageBox = styled(Flex)<{ $variant: AvatarVariant }>`
${avatarStyles};
position: relative;
font-size: 14px;
border-radius: 50%;
border-radius: ${(props) =>
props.$variant === AvatarVariant.Round
? "50%"
: `${AvatarSize.Upload / 8}px`};
box-shadow: 0 0 0 1px ${s("backgroundSecondary")};
background: ${s("background")};
overflow: hidden;