mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Refactor CSS files and structure. Also refactors some html and React components for a smarter use of CSS classes.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import * as React from 'react';
|
|
import I18n from 'i18n-js';
|
|
import Gravatar from 'react-gravatar';
|
|
|
|
import ILike from '../../interfaces/ILike';
|
|
import Spinner from '../common/Spinner';
|
|
import SidebarBox from '../common/SidebarBox';
|
|
import {
|
|
DangerText,
|
|
CenteredMutedText
|
|
} from '../common/CustomTexts';
|
|
|
|
interface Props {
|
|
likes: Array<ILike>;
|
|
areLoading: boolean;
|
|
error: string;
|
|
}
|
|
|
|
const LikeList = ({ likes, areLoading, error}: Props) => (
|
|
<SidebarBox title={I18n.t('post.likes_box.title')} customClass="likeListContainer">
|
|
{ areLoading ? <Spinner /> : null }
|
|
{ error ? <DangerText>{error}</DangerText> : null }
|
|
|
|
<div className="likeList">
|
|
{ likes.length === 0 ? <CenteredMutedText>{I18n.t('post.likes_box.empty')}</CenteredMutedText> : null }
|
|
{
|
|
likes.map((like, i) => (
|
|
<div className="likeListItem" key={i}>
|
|
<Gravatar email={like.email} size={28} className="gravatar" />
|
|
<span className="likeListItemName">{like.fullName}</span>
|
|
</div>
|
|
))
|
|
}
|
|
</div>
|
|
</SidebarBox>
|
|
);
|
|
|
|
export default LikeList; |