Skip to content

Commit

Permalink
style: update user profile button alignment. (makeplane#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekshourya29 authored Nov 7, 2023
1 parent 86379c5 commit 6e461dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions packages/ui/src/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ type Props = {
* The source of the avatar image
*/
src?: string;
/**
* The custom CSS class name to apply to the component
*/
className?: string;
};

/**
Expand Down Expand Up @@ -94,7 +98,7 @@ export const getBorderRadius = (shape: "circle" | "square") => {
case "circle":
return "rounded-full";
case "square":
return "rounded-md";
return "rounded";
default:
return "rounded-full";
}
Expand All @@ -119,6 +123,7 @@ export const Avatar: React.FC<Props> = (props) => {
size = "md",
shape = "circle",
src,
className = ""
} = props;

// get size details based on the size prop
Expand All @@ -145,14 +150,14 @@ export const Avatar: React.FC<Props> = (props) => {
{src ? (
<img
src={src}
className={`h-full w-full ${getBorderRadius(shape)}`}
className={`h-full w-full ${getBorderRadius(shape)} ${className}`}
alt={name}
/>
) : (
<div
className={`${
sizeInfo.fontSize
} grid place-items-center h-full w-full ${getBorderRadius(shape)}`}
} grid place-items-center h-full w-full ${getBorderRadius(shape)} ${className}`}
style={{
backgroundColor:
fallbackBackgroundColor ?? "rgba(var(--color-primary-500))",
Expand Down
6 changes: 3 additions & 3 deletions web/components/workspace/sidebar-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export const WorkspaceSidebarDropdown = observer(() => {

return (
<div className="flex items-center gap-2 px-4 pt-4">
<Menu as="div" className="relative col-span-4 text-left flex-grow truncate">
<Menu.Button className="text-custom-sidebar-text-200 rounded-sm text-sm font-medium focus:outline-none w-full truncate">
<Menu as="div" className="relative col-span-4 text-left flex-grow h-full truncate">
<Menu.Button className="text-custom-sidebar-text-200 rounded-sm text-sm font-medium focus:outline-none w-full h-full truncate">
<div
className={`flex items-center gap-x-2 rounded-sm bg-custom-sidebar-background-80 p-1 truncate ${
themeStore.sidebarCollapsed ? "justify-center" : ""
Expand Down Expand Up @@ -227,7 +227,7 @@ export const WorkspaceSidebarDropdown = observer(() => {
{!themeStore.sidebarCollapsed && (
<Menu as="div" className="relative flex-shrink-0">
<Menu.Button className="grid place-items-center outline-none">
<Avatar name={user?.display_name} src={user?.avatar} size={32} shape="square" />
<Avatar name={user?.display_name} src={user?.avatar} size={30} shape="square" className="!text-base" />
</Menu.Button>

<Transition
Expand Down

0 comments on commit 6e461dd

Please sign in to comment.