Skip to content

Commit

Permalink
Merge pull request #471 from golos-blockchain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Lex-Ai authored Nov 18, 2022
2 parents 5c65594 + f062d34 commit 29242f8
Show file tree
Hide file tree
Showing 62 changed files with 1,029 additions and 3,368 deletions.
4 changes: 2 additions & 2 deletions app/ResolveRoute.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const routeRegex = {
PostsIndex: /^\/(@[\w\.\d-]+)\/feed\/?$/,
UserProfile1: /^\/(@[\w\.\d-]+)\/?$/,
UserProfile2: /^\/(@[\w\.\d-]+)\/(blog|posts|comments|reputation|mentions|created|recent-replies|feed|followed|followers|settings)\/??(?:&?[^=&]*=[^=&]*)*$/,
UserProfile2: /^\/(@[\w\.\d-]+)\/(blog|posts|comments|reputation|mentions|created|recent-replies|discussions|feed|followed|followers|settings)\/??(?:&?[^=&]*=[^=&]*)*$/,
UserProfile3: /^\/(@[\w\.\d-]+)\/[\w\.\d-]+/,
UserEndPoints: /^(blog|posts|comments|reputation|mentions|created|recent-replies|feed|followed|followers|settings)$/,
UserEndPoints: /^(blog|posts|comments|reputation|mentions|created|recent-replies|discussions|feed|followed|followers|settings)$/,
CategoryFilters: /^\/(hot|responses|donates|forums|trending|promoted|allposts|allcomments|created|active)\/?$/ig,
PostNoCategory: /^\/(@[\w\.\d-]+)\/([\w\d-]+)/,
Post: /^\/([\w\d\-\/]+)\/(\@[\w\d\.-]+)\/([\w\d-]+)\/?($|\?)/,
Expand Down
4 changes: 2 additions & 2 deletions app/appUpdater.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import semver from 'semver'
import tt from 'counterpart'

import fetchWithTimeout from 'shared/fetchWithTimeout'
import { fetchEx } from 'golos-lib-js/lib/utils'

export async function checkUpdates() {
const url = new URL(
'/blogs-' + ($STM_Config.platform === 'linux' ? 'linux' : 'win'),
$STM_Config.app_updater.host
).toString()
let res = await fetchWithTimeout(url, 3000)
let res = await fetchEx(url, { timeout: 3000 })
res = await res.text()
const doc = document.createElement('html')
doc.innerHTML = res
Expand Down
1 change: 1 addition & 0 deletions app/assets/icons/dropdown-center.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/icons/editor/coin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/icons/hf/hf8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion app/client_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export const CATEGORIES = [
'трейдинг',
'философия',
'фотография',
'хобби',
'экономика',
'юмор',
'прочее',
Expand Down
6 changes: 4 additions & 2 deletions app/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class App extends React.Component {
const n = nextProps;
return (
p.location !== n.location ||
p.visitor !== n.visitor ||
p.new_visitor !== n.new_visitor ||
p.flash !== n.flash ||
this.state !== nextState ||
p.nightmodeEnabled !== n.nightmodeEnabled
Expand Down Expand Up @@ -427,7 +427,9 @@ export default connect(
};
},
dispatch => ({
loginUser: () => dispatch(user.actions.usernamePasswordLogin()),
loginUser: () => {
dispatch(user.actions.usernamePasswordLogin())
},
logoutUser: () => dispatch(user.actions.logout()),
depositSteem: () => {
dispatch(
Expand Down
2 changes: 1 addition & 1 deletion app/components/all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
@import "./elements/VerticalMenu";
@import "./elements/VotesAndComments";
@import "./elements/Voting";
@import "./elements/WitnessSettings";
@import "./elements/common/YoutubePlayer/YoutubePlayer";
@import "./elements/common/TelegramPlayer/TelegramPlayer";
@import "./elements/common/Button/index";
Expand All @@ -48,6 +47,7 @@
@import "./elements/common/DialogManager/index";
@import "./elements/common/TooltipManager/index";
@import "./elements/market/CMCWidget";
@import "./elements/donate/Donate";
@import "./elements/postEditor/MarkdownEditor/MarkdownEditor";
@import "./elements/postEditor/MarkdownEditorToolbar/index";
@import "./elements/postEditor/EditorSwitcher/EditorSwitcher";
Expand Down
22 changes: 19 additions & 3 deletions app/components/cards/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import cn from 'classnames';
import tt from 'counterpart';
import { FormattedPlural } from 'react-intl';

import { isBlocked } from 'app/utils/blacklist'
import { sortComments } from 'app/utils/comments';
import user from 'app/redux/User';
import transaction from 'app/redux/Transaction';
Expand Down Expand Up @@ -78,6 +79,11 @@ class CommentImpl extends PureComponent {

if (content) {
this._checkHide(content)
const sub_event = content.get('sub_event')
if (sub_event && !this.state.highlight && !this.wasHighlighted) {
this.setState({ highlight: true })
this.wasHighlighted = true
}
}
}

Expand Down Expand Up @@ -153,7 +159,7 @@ class CommentImpl extends PureComponent {
let body = null;
let controls = null;

if ($STM_Config.blocked_users.includes(comment.author)) {
if (isBlocked(comment.author, $STM_Config.blocked_users)) {
return null;
} else if (!this.state.collapsed && !hideBody) {
body = (
Expand All @@ -168,8 +174,10 @@ class CommentImpl extends PureComponent {
controls = this._renderControls(post, comment);
}

const isHighlight = process.env.BROWSER && window.location.search.includes('&highlight=1')

if (!this.state.collapsed && comment.children > 0) {
if ((depth > 0 && depth % 8 === 0) && this.state.depthCollapsed) {
if ((depth > 0 && depth % 8 === 0) && this.state.depthCollapsed && !isHighlight) {
const comment_permlink = `/${comment.category}/@${
comment.author
}/${comment.permlink}`;
Expand Down Expand Up @@ -220,6 +228,8 @@ class CommentImpl extends PureComponent {
);
}

const { sub_event } = comment

return (
<div
className={cn(
Expand Down Expand Up @@ -331,7 +341,7 @@ class CommentImpl extends PureComponent {
);

return (
<div>
<div onClick={this.onClick}>
<Voting post={post} />
{controls}
</div>
Expand All @@ -356,6 +366,12 @@ class CommentImpl extends PureComponent {
}
}

onClick = () => {
this.setState({
highlight: false
})
}

onShowReply = () => {
this.setState({ showReply: !this.state.showReply, showEdit: false });
};
Expand Down
2 changes: 1 addition & 1 deletion app/components/cards/Comment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
.Comment__negative_group {
color: $medium-gray;
border-top: 1px solid $light-gray;
padding-top: 1rem;
padding-top: 3rem;
clear: none;
button {
opacity: 0.35;
Expand Down
17 changes: 16 additions & 1 deletion app/components/cards/PostFull.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Author from 'app/components/elements/Author';
import Userpic from 'app/components/elements/Userpic';
import PostFormLoader from 'app/components/modules/PostForm/loader';
import CommentFormLoader from 'app/components/modules/CommentForm/loader';
import { isBlocked } from 'app/utils/blacklist'
import { getEditDraftPermLink } from 'app/utils/postForm';
import { proxifyImageUrl } from 'app/utils/ProxifyUrl';
import PostSummaryThumb from 'app/components/elements/PostSummaryThumb';
Expand All @@ -47,6 +48,9 @@ function TimeAuthorCategory({ content, authorRepLog10, showTags }) {
function TimeAuthorCategoryLarge({ content, authorRepLog10 }) {
return (
<span className="PostFull__time_author_category_large vcard">
<span className="float-right eye">
<Icon name='eye' /> {content.views}
</span>
<TimeVersions content={content} className='float-right' />
<Userpic account={content.author} reputation={authorRepLog10} />
<div className="right-side">
Expand Down Expand Up @@ -346,7 +350,7 @@ class PostFull extends React.Component {
const url = `/${category}/@${author}/${permlink}`;
let contentBody;

if ($STM_Config.blocked_posts.includes(url) && !username) {
if (isBlocked(url, $STM_Config.blocked_posts) && !username) {
contentBody = tt(
'postfull_jsx.this_post_is_not_available_due_to_breach_of_legislation'
);
Expand Down Expand Up @@ -494,6 +498,17 @@ class PostFull extends React.Component {
) : null}
</span>

<span className="PostFull__responses">
<Link
to={link}
title={tt('votesandcomments_jsx.view_count', {
count: content.views,
})}
>
<Icon name="eye" className="space-right" />
{content.views}
</Link>
</span>
<span className="PostFull__responses">
<Link
to={link}
Expand Down
7 changes: 6 additions & 1 deletion app/components/cards/PostFull.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
}

.PostFull__time_author_category_large {
margin: 1.75rem 1.5rem 1.2rem 0;
margin: 1.75rem 0 1.2rem 0;
color: #aaa;
strong, a {color: #999}
font-size: 120%;
display: block;
> .eye {
margin-left: .4rem;
padding-left: .4rem;
border-left: 1px solid $medium-gray;
}
> .Userpic {
margin-top: -4px;
float: left;
Expand Down
Loading

0 comments on commit 29242f8

Please sign in to comment.