feat: improve side nav item style and fix some UI issues

This commit is contained in:
Sonny
2024-05-22 23:23:12 +02:00
committed by Sonny
parent 3ff7619e94
commit 31b4f22772
6 changed files with 62 additions and 19 deletions

View File

@@ -1,9 +1,20 @@
import styled from '@emotion/styled';
const TextEllipsis = styled.p({
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
const TextEllipsis = styled.p<{ lines?: number }>(({ lines = 1 }) => {
if (lines > 1) {
return {
overflow: 'hidden',
display: '-webkit-box',
WebkitLineClamp: lines,
WebkitBoxOrient: 'vertical',
};
}
return {
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
};
});
export default TextEllipsis;