-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove size limits in title
- Loading branch information
Showing
14 changed files
with
90 additions
and
69 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
26 changes: 15 additions & 11 deletions
26
apps/client/src/common/components/title-card/TitleCard.tsx
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 |
---|---|---|
@@ -1,28 +1,32 @@ | ||
import { ForwardedRef, forwardRef } from 'react'; | ||
|
||
import { useTranslation } from '../../../translation/TranslationProvider'; | ||
|
||
import './TitleCard.scss'; | ||
|
||
interface TitleCardProps { | ||
label: 'now' | 'next'; | ||
title: string; | ||
label?: 'now' | 'next'; | ||
secondary?: string; | ||
className?: string; | ||
} | ||
|
||
export default function TitleCard(props: TitleCardProps) { | ||
const { label, title, secondary } = props; | ||
const TitleCard = forwardRef((props: TitleCardProps, ref: ForwardedRef<HTMLDivElement>) => { | ||
const { label, title, secondary, className = '' } = props; | ||
const { getLocalizedString } = useTranslation(); | ||
|
||
const accent = label === 'now'; | ||
|
||
return ( | ||
<div className='title-card'> | ||
<div className='inline'> | ||
<span className='title-card__title'>{title}</span> | ||
<span className={accent ? 'title-card__label title-card__label--accent' : 'title-card__label'}> | ||
{getLocalizedString(`common.${label}`)} | ||
</span> | ||
</div> | ||
<div className={`title-card ${className}`} ref={ref}> | ||
<span className='title-card__title'>{title}</span> | ||
<span className={accent ? 'title-card__label title-card__label--accent' : 'title-card__label'}> | ||
{label && getLocalizedString(`common.${label}`)} | ||
</span> | ||
<div className='title-card__secondary'>{secondary}</div> | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
TitleCard.displayName = 'TitleCard'; | ||
export default TitleCard; |
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
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
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