Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add object names to favorites #8593

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ export const CurrentWorkspaceMemberFavorites = ({
/>
}
isDraggable
isFavorite
objectName={favorite.objectNameSingular}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ export const CurrentWorkspaceMemberFavoritesFolders = () => {
/>
}
isDraggable={true}
isFavorite
objectName={favorite.objectNameSingular}
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export type NavigationDrawerItemProps = {
keyboard?: string[];
rightOptions?: ReactNode;
isDraggable?: boolean;
isFavorite?: boolean;
objectName?: string | undefined;
};

type StyledItemProps = Pick<
Expand Down Expand Up @@ -129,6 +131,13 @@ const StyledItemLabel = styled.span`
white-space: nowrap;
`;

const StyledItemLabelWithObjectName = styled.span`
color: ${({ theme }) => theme.font.color.light};
font-weight: ${({ theme }) => theme.font.weight.regular};
text-overflow: ellipsis;
white-space: nowrap;
`;
Comment on lines +134 to +139
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing overflow property and max-width constraint needed for text-overflow: ellipsis to work. Add overflow: hidden and max-width.


const StyledItemCount = styled.span`
align-items: center;
background-color: ${({ theme }) => theme.color.blue};
Expand Down Expand Up @@ -199,6 +208,8 @@ export const NavigationDrawerItem = ({
subItemState,
rightOptions,
isDraggable,
isFavorite,
objectName,
}: NavigationDrawerItemProps) => {
const theme = useTheme();
const isMobile = useIsMobile();
Expand Down Expand Up @@ -254,6 +265,12 @@ export const NavigationDrawerItem = ({

<NavigationDrawerAnimatedCollapseWrapper>
<StyledItemLabel>{label}</StyledItemLabel>
{isFavorite && objectName && (
<StyledItemLabelWithObjectName>
{' '}
· {objectName.charAt(0).toUpperCase() + objectName.slice(1)}
</StyledItemLabelWithObjectName>
)}
</NavigationDrawerAnimatedCollapseWrapper>

<StyledSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const NavigationDrawerSubItem = ({
subItemState,
rightOptions,
isDraggable,
objectName,
}: NavigationDrawerSubItemProps) => {
return (
<NavigationDrawerItem
Expand All @@ -36,6 +37,8 @@ export const NavigationDrawerSubItem = ({
keyboard={keyboard}
rightOptions={rightOptions}
isDraggable={isDraggable}
isFavorite
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Setting isFavorite to true by default may be too restrictive - consider making this configurable via props like the other properties

objectName={objectName}
/>
);
};
Loading