add subscribed icon to files on homepage

This commit is contained in:
Sean Yesmunt 2018-10-31 12:57:22 -04:00
parent 3f9a2057f1
commit 32d110cb1f
4 changed files with 20 additions and 6 deletions

View file

@ -42,6 +42,7 @@
"jsx-a11y/no-noninteractive-element-to-interactive-role": 0,
"class-methods-use-this": 0,
"jsx-a11y/interactive-supports-focus": 0,
"jsx-a11y/click-events-have-key-events": 0
"jsx-a11y/click-events-have-key-events": 0,
"consistent-return": 0
}
}

View file

@ -262,12 +262,19 @@ class CategoryList extends React.PureComponent<Props, State> {
this.rowItems = ref;
}}
>
{names && names.map(name => <FileCard key={name} uri={normalizeURI(name)} />)}
{names &&
names.map(name => (
<FileCard showSubscribedLogo key={name} uri={normalizeURI(name)} />
))}
{channelClaims &&
channelClaims.length &&
channelClaims.map(claim => (
<FileCard key={claim.claim_id} uri={`lbry://${claim.name}#${claim.claim_id}`} />
<FileCard
showSubcribedLogo
key={claim.claim_id}
uri={`lbry://${claim.name}#${claim.claim_id}`}
/>
))}
</div>
)}

View file

@ -20,7 +20,7 @@ class ToolTip extends React.PureComponent<Props, State> {
direction: 'bottom',
};
constructor(props) {
constructor(props: Props) {
super(props);
this.tooltip = React.createRef();
this.state = {
@ -33,6 +33,10 @@ class ToolTip extends React.PureComponent<Props, State> {
}
getVisibility = () => {
if (!this.tooltip.current) {
return;
}
const node = this.tooltip.current;
const rect = node.getBoundingClientRect();
@ -81,6 +85,8 @@ class ToolTip extends React.PureComponent<Props, State> {
}
};
tooltip: { current: null | HTMLSpanElement };
render() {
const { direction } = this.state;
const { children, label, body, icon, onComponent } = this.props;

View file

@ -12,11 +12,11 @@
@media (min-width: $medium-breakpoint) {
padding-left: $spacing-width;
width: calc(var(--side-nav-width) * 1.4);
min-width: calc(var(--side-nav-width) * 1.4);
}
@media (min-width: $large-breakpoint) {
width: calc(var(--side-nav-width) * 1.6);
min-width: calc(var(--side-nav-width) * 1.6);
}
}