mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add ReactIcons (#149)
This commit is contained in:
committed by
GitHub
parent
4c73b398e8
commit
6198d814d8
@@ -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>
|
||||
|
||||
<Button onClick={() => handleUpdatePost(title, description, boardId, postStatusId)}>
|
||||
{ isUpdating ? <Spinner /> : I18n.t('common.buttons.update') }
|
||||
|
||||
@@ -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() } </span>
|
||||
<span>{I18n.t('post.published_by').toLowerCase()} </span>
|
||||
<Gravatar email={authorEmail} size={24} className="postAuthorAvatar" />
|
||||
{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>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user