Add ReactIcons (#149)

This commit is contained in:
Riccardo Graziosi
2022-08-22 10:38:03 +02:00
committed by GitHub
parent 4c73b398e8
commit 6198d814d8
32 changed files with 267 additions and 226 deletions

View File

@@ -8,6 +8,8 @@ import IPostStatus from '../../interfaces/IPostStatus';
import IBoard from '../../interfaces/IBoard';
import Button from '../common/Button';
import Spinner from '../common/Spinner';
import ActionLink from '../common/ActionLink';
import { CancelIcon } from '../common/Icons';
interface Props {
title: string;
@@ -93,9 +95,9 @@ const PostEditForm = ({
/>
<div className="postEditFormButtons">
<a onClick={toggleEditMode}>
{ I18n.t('common.buttons.cancel') }
</a>
<ActionLink onClick={toggleEditMode} icon={<CancelIcon />}>
{I18n.t('common.buttons.cancel')}
</ActionLink>
&nbsp;
<Button onClick={() => handleUpdatePost(title, description, boardId, postStatusId)}>
{ isUpdating ? <Spinner /> : I18n.t('common.buttons.update') }

View File

@@ -5,6 +5,8 @@ import I18n from 'i18n-js';
import { MutedText } from '../common/CustomTexts';
import friendlyDate from '../../helpers/datetime';
import Separator from '../common/Separator';
import ActionLink from '../common/ActionLink';
import { DeleteIcon, EditIcon } from '../common/Icons';
interface Props {
createdAt: string;
@@ -27,26 +29,29 @@ const PostFooter = ({
}: Props) => (
<div className="postFooter">
<div className="postAuthor">
<span>{ I18n.t('post.published_by').toLowerCase() } &nbsp;</span>
<span>{I18n.t('post.published_by').toLowerCase()} &nbsp;</span>
<Gravatar email={authorEmail} size={24} className="postAuthorAvatar" /> &nbsp;
{authorFullName}
<Separator />
{friendlyDate(createdAt)}
</div>
{
isPowerUser || authorEmail === currentUserEmail ?
<>
<a onClick={toggleEditMode}>
{ I18n.t('common.buttons.edit') }
</a>
<Separator />
<a onClick={() => confirm(I18n.t('common.confirmation')) && handleDeletePost()}>
{ I18n.t('common.buttons.delete') }
</a>
<Separator />
</>
<div className="postFooterActions">
<ActionLink onClick={toggleEditMode} icon={<EditIcon />}>
{I18n.t('common.buttons.edit')}
</ActionLink>
<ActionLink
onClick={() => confirm(I18n.t('common.confirmation')) && handleDeletePost()}
icon={<DeleteIcon />}
>
{I18n.t('common.buttons.delete')}
</ActionLink>
</div>
:
null
}
<MutedText>{friendlyDate(createdAt)}</MutedText>
</div>
);