From b3b4b7977570edda224003efca5396c10363599d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 3 Mar 2020 10:14:50 -0500 Subject: [PATCH] More additions to icons. - Adding edit and trash icons for sidebars - Adding pencil edit instead of modified. --- ui/src/components/main.tsx | 9 ++++++--- ui/src/components/moment-time.tsx | 11 ++++++++--- ui/src/components/post-listing.tsx | 8 +++++++- ui/src/components/sidebar.tsx | 30 +++++++++++++++++++++++------- ui/src/components/symbols.tsx | 3 +++ 5 files changed, 47 insertions(+), 14 deletions(-) diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 014d82d3..3f7d8fa6 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -268,13 +268,16 @@ export class Main extends Component {
{`${this.state.siteRes.site.name}`}
{this.canAdmin && ( -
    -
  • +
      +
    • - {i18n.t('edit')} + + +
    diff --git a/ui/src/components/moment-time.tsx b/ui/src/components/moment-time.tsx index a256f785..76e5fe28 100644 --- a/ui/src/components/moment-time.tsx +++ b/ui/src/components/moment-time.tsx @@ -1,6 +1,6 @@ import { Component } from 'inferno'; import moment from 'moment'; -import { getMomentLanguage, setupTippy } from '../utils'; +import { getMomentLanguage, setupTippy, capitalizeFirstLetter } from '../utils'; import { i18n } from '../i18next'; interface MomentTimeProps { @@ -28,10 +28,15 @@ export class MomentTime extends Component { if (this.props.data.updated) { return ( - {i18n.t('modified')} {moment.utc(this.props.data.updated).fromNow()} + + + + {moment.utc(this.props.data.updated).fromNow()} ); } else { diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index bc23543a..6e285ee9 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -579,8 +579,14 @@ export class PostListing extends Component { - {i18n.t('view_source')} + + +
  • )} diff --git a/ui/src/components/sidebar.tsx b/ui/src/components/sidebar.tsx index 5c8ef1a9..a78589d5 100644 --- a/ui/src/components/sidebar.tsx +++ b/ui/src/components/sidebar.tsx @@ -13,6 +13,7 @@ import { getUnixTime, pictshareAvatarThumbnail, showAvatars, + setupTippy, } from '../utils'; import { CommunityForm } from './community-form'; import { i18n } from '../i18next'; @@ -46,6 +47,10 @@ export class Sidebar extends Component { this.handleEditCancel = this.handleEditCancel.bind(this); } + componentDidUpdate() { + setupTippy(); + } + render() { return (
    @@ -84,26 +89,37 @@ export class Sidebar extends Component { /c/{community.name} -
      +
        {this.canMod && ( <> -
      • +
      • - {i18n.t('edit')} + + +
      • {this.amCreator && ( -
      • +
      • - {!community.deleted - ? i18n.t('delete') - : i18n.t('restore')} + + +
      • )} diff --git a/ui/src/components/symbols.tsx b/ui/src/components/symbols.tsx index 09efcf68..108fbab3 100644 --- a/ui/src/components/symbols.tsx +++ b/ui/src/components/symbols.tsx @@ -42,6 +42,9 @@ export class Symbols extends Component { + + + -- 2.44.1