relays and zaps tweaks

This commit is contained in:
Alejandro Gomez 2023-02-12 13:44:37 +01:00 committed by Kieran
parent 4f222fb813
commit 271d44d92d
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
4 changed files with 13 additions and 12 deletions

View File

@ -8,13 +8,10 @@ import Write from "Icons/Write";
const RelayFavicon = ({ url }: { url: string }) => {
const cleanUrl = url
.replace("wss://relay.", "https://")
.replace("wss://nostr.", "https://")
.replace("wss://", "https://")
.replace("ws://", "http://")
.replace(/^wss:\/\//, "https://")
.replace(/^ws:\/\//, "http://")
.replace(/\/$/, "");
const [faviconUrl, setFaviconUrl] = useState(`${cleanUrl}/favicon.ico`);
return <img className="favicon" src={faviconUrl} onError={() => setFaviconUrl(Nostrich)} />;
};
@ -29,7 +26,7 @@ const RelaysMetadata = ({ relays }: RelaysMetadataProps) => {
return (
<div className="card relay-card">
<RelayFavicon url={url} />
<code className="relay-url">{url}</code>
<code className="relay-url f-ellipsis">{url}</code>
<div className="relay-settings">
<Read className={settings.read ? "enabled" : "disabled"} />
<Write className={settings.write ? "enabled" : "disabled"} />

View File

@ -7,10 +7,6 @@
flex-direction: row;
}
.zap .header .pfp {
overflow: hidden;
}
.zap .header .amount {
font-size: 24px;
}

View File

@ -252,3 +252,11 @@
display: unset;
}
}
.zaps-total {
text-align: right;
padding-right: 12px;
margin-bottom: 8px;
font-weight: 500;
font-size: 24px;
}

View File

@ -204,9 +204,9 @@ export default function ProfilePage() {
case ZAPS: {
return (
<div className="main-content">
<h4 className="zaps-total">
<div className="zaps-total">
<FormattedMessage {...messages.Sats} values={{ n: formatShort(zapsTotal) }} />
</h4>
</div>
{zaps.map(z => (
<ZapElement showZapped={false} zap={z} />
))}