Skip to content

Commit

Permalink
feat: add establishment name ellipsis + reduce menu width
Browse files Browse the repository at this point in the history
  • Loading branch information
loicguillois committed Jan 9, 2025
1 parent c2ad80e commit 2b44095
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Collapse/collapse.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$background-color: var(--grey-975);

line-height: initial;
width: 350px;
width: 300px;
text-align: left;

.header {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Header/SmallHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function SmallHeader() {
): MainNavigationProps.Item {
const link = getUserNavItem(navItem);
return {
className: styles.mainNavigationItem,
linkProps: {
to: link.url
},
Expand Down Expand Up @@ -116,7 +117,7 @@ function SmallHeader() {
}}
/>
) : (
<Typography component="span" mr={2} variant="body2">
<Typography className={styles.establishmentName} component="span" mr={2} variant="body2">
{establishment?.name}
</Typography>
)
Expand Down
37 changes: 37 additions & 0 deletions frontend/src/components/Header/small-header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,40 @@
position: relative;
top: -2px;
}

.mainNavigationItem {
margin-left: 0px !important;
}

@media screen and (max-width: 1484px) {
.establishmentName {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

@media screen and (max-width: 1412px) {
.establishmentName {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

@media screen and (max-width: 1362px) {
.establishmentName {
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

@media screen and (max-width: 1312px) {
.establishmentName {
display: none;
}
}
4 changes: 0 additions & 4 deletions frontend/src/dsfr-fix.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,3 @@ span.fr-icon-checkbox-circle-line.ds-fr-tag-icon {
}
}
}

.fr-nav__list > :first-child:nth-last-child(4) ~ * {
margin-left: 0px;
}
3 changes: 2 additions & 1 deletion frontend/src/views/Account/AccountSideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { logOut } from '../../store/actions/authenticationAction';
import { useUser } from '../../hooks/useUser';
import { useLocation } from 'react-router-dom';
import classNames from 'classnames';
import styles from './account-side-menu.module.scss';

const AccountSideMenu = () => {
const location = useLocation();
Expand All @@ -31,7 +32,7 @@ const AccountSideMenu = () => {
</AppLink>
</div>
<hr className="fr-py-1w" />
<Text className="color-grey-625" size="sm" bold spacing="mb-0">
<Text className={`color-grey-625 ${styles.establishmentName}`} size="sm" bold spacing="mb-0">
{establishment?.name}
</Text>
<div className="fr-py-2w">
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/views/Account/account-side-menu.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.establishmentName {
overflow: hidden;
text-overflow: ellipsis;
}

0 comments on commit 2b44095

Please sign in to comment.