PromucFlow_constructor/app/client/src/pages/AppViewer/PageMenu.styled.tsx
Dhruvik Neharia 5fd34dcca9
fix: Page name cutoff (#23394)
## Description
Previously, page names were being hidden behind overflow, and additional
"..." was appended if they were long. This made the truncation look
unnatural at times. We now use the CSS' text-overflow ellipsis property
to avoid this.

<img width="683" alt="CleanShot 2023-05-16 at 16 09 41@2x"
src="https://github.com/appsmithorg/appsmith/assets/22471214/464c1f1f-0f02-41fb-8823-445d0354cbe1">

#### PR fixes following issue(s)
Fixes #19984

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing
>
#### How Has This Been Tested?
- [x] Manual
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [x] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change)
have been covered
- [x] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-05-24 12:02:58 +05:30

67 lines
1.8 KiB
TypeScript

import styled from "styled-components";
import type { NavigationSetting } from "constants/AppConstants";
import { NAVIGATION_SETTINGS } from "constants/AppConstants";
import {
getMenuContainerBackgroundColor,
getMenuItemBackgroundColorOnHover,
getMenuItemBackgroundColorWhenActive,
getMenuItemTextColor,
} from "./utils";
import { NavLink } from "react-router-dom";
export const PageMenuContainer = styled.div<{
primaryColor: string;
navColorStyle: NavigationSetting["colorStyle"];
}>`
background-color: ${({ navColorStyle, primaryColor }) =>
getMenuContainerBackgroundColor(primaryColor, navColorStyle)};
${({ navColorStyle, primaryColor }) => {
const isThemeColorStyle =
navColorStyle === NAVIGATION_SETTINGS.COLOR_STYLE.THEME;
return (
isThemeColorStyle &&
`
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: ${getMenuContainerBackgroundColor(
primaryColor,
navColorStyle,
)};
}
&::-webkit-scrollbar-thumb {
background: ${primaryColor};
&:hover {
background: ${getMenuItemBackgroundColorOnHover(
primaryColor,
navColorStyle,
)};
}
}
&:hover::-webkit-scrollbar-thumb {
background: ${getMenuItemBackgroundColorWhenActive(
primaryColor,
navColorStyle,
)};
}
`
);
}}
`;
export const StyledNavLink = styled(NavLink)<{
primaryColor: string;
navColorStyle: NavigationSetting["colorStyle"];
}>`
color: ${({ navColorStyle, primaryColor }) =>
getMenuItemTextColor(primaryColor, navColorStyle, true)};
word-wrap: break-word;
`;