Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Fixed width of play all text #77

Merged
merged 2 commits into from
Jul 25, 2023
Merged
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
2 changes: 1 addition & 1 deletion packages/app/components/My.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ $search-input-wudth-coeff: 1.5;
.content {
position: relative;
display: inline;
width: auto;
width: fit-content;

&.animate {
animation-name: moving;
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/My.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function My({
className={clsx(s.content, ticker ? s.animate : '')}
style={{ animationDuration: `${animationDuration}s` }}
>
<Typography nowrap theme={theme} variant="span" disabled fullWidth>
<Typography nowrap theme={theme} variant="span" disabled fitContent>
{!played && !paused ? locale.playAll : playedText}
</Typography>
</div>
Expand Down
4 changes: 4 additions & 0 deletions packages/app/components/ui/Typography.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
&.full_width {
width: 100%;
}

&.fit_content {
width: fit-content;
}

p, h1, h2, h3, h4, h5, h6, label, span {
word-wrap: break-word;
Expand Down
4 changes: 4 additions & 0 deletions packages/app/components/ui/Typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Typography<T extends TypographyVariant>({
fullWidth,
id,
smaller,
fitContent,
}: {
variant: TypographyVariant;
children: string | React.ReactNode;
Expand All @@ -40,6 +41,7 @@ function Typography<T extends TypographyVariant>({
fullWidth?: boolean;
id?: T extends 'label' ? string : string | undefined;
smaller?: boolean;
fitContent?: boolean;
}) {
return (
<div
Expand All @@ -54,6 +56,7 @@ function Typography<T extends TypographyVariant>({
large ? s.large : '',
nowrap ? s.nowrap : '',
fullWidth ? s.full_width : '',
fitContent ? s.fit_content : '',
align
? align === 'center'
? s.center
Expand Down Expand Up @@ -120,6 +123,7 @@ Typography.defaultProps = {
fullWidth: undefined,
id: undefined,
smaller: undefined,
fitContent: undefined,
};

export default Typography;