Files
astuto/app/javascript/components/common/CustomTexts.tsx
Riccardo Graziosi 8e75a85873 Refactor CSS (#116)
Refactor CSS files and structure. Also refactors some html and React components for a smarter use of CSS classes.
2022-06-08 10:20:36 +02:00

53 lines
1.3 KiB
TypeScript

import * as React from 'react';
interface Props {
children: string;
}
interface DescriptionTextProps {
children: string;
limit?: number;
}
export const TitleText = ({ children }: Props) => (
<span className="titleText">{children}</span>
);
export const BoxTitleText = ({ children }: Props) => (
<span className="boxTitleText">{children}</span>
);
export const MutedText = ({ children }: Props) => (
<span className="mutedText">{children}</span>
);
export const CenteredMutedText = ({ children }: Props) => (
<p className="centeredText"><span className="mutedText">{children}</span></p>
);
export const SmallMutedText = ({ children }: Props) => (
<p className="smallMutedText">{children}</p>
);
export const UppercaseText = ({ children }: Props) => (
<span className="uppercaseText">{children}</span>
);
export const SuccessText = ({ children }: Props) => (
<span className="successText">{children}</span>
);
export const DangerText = ({ children }: Props) => (
<span className="dangerText">{children}</span>
);
export const DescriptionText = ({ children, limit = 90}: DescriptionTextProps) => (
<span className="descriptionText">
{
children && children.length > limit ?
children.slice(0, limit-1) + '...'
:
children || '<No description provided>'
}
</span>
);