link fe: consistently use "linkIndex"

As opposed to sometimes using just "link", when referring to literal
index numbers.
This commit is contained in:
Fang 2020-02-06 20:38:53 +01:00
parent e6fc59f3df
commit 06a33929b4
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
4 changed files with 7 additions and 7 deletions

View File

@ -70,7 +70,7 @@ export class LinkItem extends Component {
: "~" + props.ship}</span>
<span className="f9 inter gray2 pr3 v-mid">{this.state.timeSinceLinkPost}</span>
<Link to=
{"/~link" + props.popout + "/" + props.channel + "/" + props.page + "/" + props.index + "/" + encodedUrl}
{"/~link" + props.popout + "/" + props.channel + "/" + props.page + "/" + props.linkIndex + "/" + encodedUrl}
className="v-top">
<span className="f9 inter gray2">
{comments}

View File

@ -199,7 +199,7 @@ export class LinkDetail extends Component {
popout={props.popout}
url={props.url}
linkPage={props.page}
linkIndex={props.link}
linkIndex={props.linkIndex}
/>
</div>
</div>

View File

@ -45,14 +45,14 @@ export class Links extends Component {
: 1;
let LinkList = Object.keys(links)
.map((link) => {
.map((linkIndex) => {
let linksObj = props.links[linkPage];
let { title, url, time, ship } = linksObj[link];
let { title, url, time, ship } = linksObj[linkIndex];
let members = {};
const commentCount = props.comments[url]
? props.comments[url].totalItems
: linksObj[link].commentCount || 0;
: linksObj[linkIndex].commentCount || 0;
if (!props.members[ship]) {
members[ship] = {'nickname': '', 'avatar': 'TODO', 'color': '0x0'};
@ -77,7 +77,7 @@ export class Links extends Component {
key={time}
title={title}
page={props.page}
index={link}
linkIndex={linkIndex}
url={url}
timestamp={time}
nickname={nickname}

View File

@ -137,7 +137,7 @@ export class Root extends Component {
{...props}
page={page}
url={url}
link={index}
linkIndex={index}
members={groupMembers}
path={groupPath}
popout={popout}