lbry-desktop/ui/component/claimPreviewTitle/view.jsx
infinite-persistence 49fc238e4c
Use titles vs names on channel claim previews, but show name in channel areas (#962)
* use titles

* Sidebar: show "title + name"

Co-authored-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
2022-02-25 09:04:23 -05:00

26 lines
564 B
JavaScript

// @flow
import React from 'react';
import TruncatedText from 'component/common/truncated-text';
import { stripLeadingAtSign } from 'util/string';
type Props = {
uri: string,
claim: ?Claim,
title: string,
};
function ClaimPreviewTitle(props: Props) {
const { title, claim } = props;
return (
<div className="claim-preview__title">
{claim ? (
<TruncatedText text={title || stripLeadingAtSign(claim.name)} lines={2} />
) : (
<span>{__('Nothing here')}</span>
)}
</div>
);
}
export default ClaimPreviewTitle;