From: Dessalines Date: Fri, 9 Aug 2019 22:52:32 +0000 (-0700) Subject: Second front end pass. X-Git-Url: http://these/git/%24%7BgetStaticDir%28%29%7D/styles/%7B%60/feeds/%7B%7D/%7BimageThumbnailer%28this.getImage%28%29%29%7D?a=commitdiff_plain;h=3060608a45bdbb2bd08f5a2ec95f4312ff2c98a7;p=lemmy.git Second front end pass. --- diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 9f3476a8..ed62fcf5 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -88,7 +88,7 @@ export class CommentForm extends Component { if (i.props.node) { i.props.onReplyCancel(); } - + autosize.update(document.querySelector('textarea')); } diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index a05286ed..a1ac93b3 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -195,10 +195,10 @@ export class CommentNode extends Component { {/* TODO hold off on expires until later */} {/*
*/} {/* */} - {/* */} + {/* */} {/*
*/}
- +
} @@ -389,9 +389,6 @@ export class CommentNode extends Component { handleModBanBothSubmit(i: CommentNode) { event.preventDefault(); - console.log(BanType[i.state.banType]); - console.log(i.props.node.comment.banned); - if (i.state.banType == BanType.Community) { let form: BanFromCommunityForm = { user_id: i.props.node.comment.creator_id, diff --git a/ui/src/components/comment-nodes.tsx b/ui/src/components/comment-nodes.tsx index da67bbc7..fca323e3 100644 --- a/ui/src/components/comment-nodes.tsx +++ b/ui/src/components/comment-nodes.tsx @@ -32,7 +32,7 @@ export class CommentNodes extends Component + /> )} ) diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index 066d524a..f10dd10d 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -5,6 +5,7 @@ import { retryWhen, delay, take } from 'rxjs/operators'; import { UserOperation, Community, ListCommunitiesResponse, CommunityResponse, FollowCommunityForm, ListCommunitiesForm, SortType } from '../interfaces'; import { WebSocketService } from '../services'; import { msgOp } from '../utils'; +import { i18n } from '../i18next'; import { T } from 'inferno-i18next'; declare const Sortable: any; @@ -27,12 +28,12 @@ export class Communities extends Component { super(props, context); this.state = this.emptyState; this.subscription = WebSocketService.Instance.subject - .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10)))) - .subscribe( - (msg) => this.parseMessage(msg), + .pipe(retryWhen(errors => errors.pipe(delay(3000), take(10)))) + .subscribe( + (msg) => this.parseMessage(msg), (err) => console.error(err), () => console.log('complete') - ); + ); this.refetch(); @@ -47,7 +48,7 @@ export class Communities extends Component { } componentDidMount() { - document.title = `Communities - ${WebSocketService.Instance.site.name}`; + document.title = `${i18n.t('communities')} - ${WebSocketService.Instance.site.name}`; } // Necessary for back button for some reason diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx index f6520fc6..5db2fcb6 100644 --- a/ui/src/components/community-form.tsx +++ b/ui/src/components/community-form.tsx @@ -171,8 +171,7 @@ export class CommunityForm extends Component { { checked={this.state.type_ == ListingType.All} onChange={linkEvent(this, this.handleTypeChange)} /> - All + {i18n.t('all')} ) @@ -316,9 +317,9 @@ export class Main extends Component { return (
{this.state.page > 1 && - + } - +
); } diff --git a/ui/src/components/moment-time.tsx b/ui/src/components/moment-time.tsx index b35ceea8..021cf5f7 100644 --- a/ui/src/components/moment-time.tsx +++ b/ui/src/components/moment-time.tsx @@ -1,6 +1,6 @@ import { Component } from 'inferno'; import * as moment from 'moment'; -import 'moment/locale/de.js'; +// import 'moment/locale/de.js'; import { getLanguage } from '../utils'; import { i18n } from '../i18next'; @@ -16,7 +16,6 @@ export class MomentTime extends Component { constructor(props: any, context: any) { super(props, context); - // console.log(moment.locales()); moment.locale(getLanguage()); } diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx index ac23e361..5738483d 100644 --- a/ui/src/components/navbar.tsx +++ b/ui/src/components/navbar.tsx @@ -155,6 +155,7 @@ export class Navbar extends Component { parseMessage(msg: any) { let op: UserOperation = msgOp(msg); if (msg.error) { + // TODO if (msg.error == "Not logged in.") { UserService.Instance.logout(); location.reload(); diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index dc8f4cfa..ff70783c 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -76,7 +76,7 @@ export class PostListing extends Component {
{post.url ? {post.name} : - {post.name} + {post.name} }
{post.url && @@ -176,7 +176,7 @@ export class PostListing extends Component { } {this.state.showRemoveDialog &&
- +
} diff --git a/ui/src/components/search.tsx b/ui/src/components/search.tsx index 67202dba..ae29fd0b 100644 --- a/ui/src/components/search.tsx +++ b/ui/src/components/search.tsx @@ -54,7 +54,7 @@ export class Search extends Component { } componentDidMount() { - document.title = `Search - ${WebSocketService.Instance.site.name}`; + document.title = `${i18n.t('search')} - ${WebSocketService.Instance.site.name}`; } render() { @@ -62,7 +62,7 @@ export class Search extends Component {
-
Search
+
#
{this.selects()} {this.searchForm()} {this.state.type_ == SearchType.Both && @@ -85,7 +85,7 @@ export class Search extends Component { searchForm() { return (
- + diff --git a/ui/src/components/sponsors.tsx b/ui/src/components/sponsors.tsx index 898efa2c..3fd55c2f 100644 --- a/ui/src/components/sponsors.tsx +++ b/ui/src/components/sponsors.tsx @@ -65,7 +65,7 @@ export class Sponsors extends Component { bitcoin() { return (
-
Crypto
+
#
diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index 4193175c..f0034a47 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -219,7 +219,7 @@ export class User extends Component { return (
{user.name}
-
Joined
+
{i18n.t('joined')}
#