generated from graasp/graasp-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ellipsis and decrease title (#108)
* feat: first implementation for TextInput * feat: get latest user's answer instead of first * test: implement E2E tests of play text with multiple attempts * feat: update PlayFillInTheBlanks to allow multiple attempts * test: update play fillBlanks test to test multiple attempts * feat: translate the number of attempts * fix: update analytics and results for multiple attempts * feat: do not display explanations of multiple choice until the end of the attempts * feat: resize the question size and add ellipsis for TopBar question names * feat: use const to configure max lines * feat: increase the max number of lines * fix: update the utilities file to remove duplicate functions * chore: use component and variant for the Typography of the question's title
- Loading branch information
Showing
7 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
import { Typography, TypographyProps } from '@mui/material'; | ||
|
||
type Props = TypographyProps & { | ||
maxLines: number; | ||
children?: ReactNode; | ||
}; | ||
|
||
export const TypographyMaxLines = ({ | ||
maxLines, | ||
children, | ||
...typographyProps | ||
}: Props) => { | ||
return ( | ||
<Typography | ||
{...typographyProps} | ||
sx={{ | ||
...typographyProps.sx, | ||
display: '-webkit-box', | ||
overflow: 'hidden', | ||
WebkitBoxOrient: 'vertical', | ||
WebkitLineClamp: maxLines, | ||
}} | ||
> | ||
{children} | ||
</Typography> | ||
); | ||
}; | ||
|
||
export default TypographyMaxLines; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters