Skip to content

Commit 0970113

Browse files
authored
Merge to main 4.7.0 (#200)
2 parents 87748b0 + e656acb commit 0970113

File tree

7 files changed

+26
-21
lines changed

7 files changed

+26
-21
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ui",
3-
"version": "4.6.0",
3+
"version": "4.7.0",
44
"description": "",
55
"scripts": {
66
"start": "vite --open",

src/common-components/account-short-entry.jsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,16 @@ import './account-short-entry.css';
3434
*/
3535
export function AccountShortEntry({ account, ...rest }) {
3636
const resolved = useResolveHandleOrDid(account);
37-
if (!resolved) return undefined;
38-
37+
3938
if (resolved.isLoading) return (
40-
<LoadingAccount {...rest} handle={account} />
39+
<LoadingAccount {...rest} handle={account} />
4140
);
42-
else if (resolved.isError) return (
43-
<ErrorAccount {...rest} error={resolved.error} handle={account} />
41+
else if (resolved.isError || !resolved.data) return (
42+
<ErrorAccount {...rest} error={resolved.error || { message: "not found" }} handle={account} />
4443
);
4544
else {
46-
const { did, handle } = distinguishDidFromHandle(account);
4745
return (
48-
<ResolvedAccount {...rest} account={resolved.data || { shortDID: did || '', shortHandle: handle || '' }} />
46+
<ResolvedAccount {...rest} account={resolved.data} />
4947
);
5048
}
5149
}

src/detail-panels/account-header/account-header.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ export function AccountHeader({
6262
}
6363

6464
<div className='account-banner' style={{
65-
backgroundImage: resolved.data?.bannerUrl ? `url(${resolved.data?.bannerUrl})` : 'transparent'
65+
backgroundImage: resolved.data?.bannerUrl ? `url(${resolved.data.bannerUrl})` : 'transparent'
6666
}}>
6767
</div>
6868

69+
{
70+
resolved.isSuccess && !resolved.data
71+
? <span>Account not found</span> :
6972
<span className='account-avatar-and-displayName-line'>
7073
<span className='account-banner-overlay'></span>
7174
<span className='account-avatar' style={{
@@ -95,6 +98,7 @@ export function AccountHeader({
9598
<span className='info-icon'></span>
9699
</Button>
97100
</span>
101+
}
98102
</h1>
99103
<div>
100104
</div>

src/detail-panels/account-resolver.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { useParams } from 'react-router-dom';
33
import { useResolveHandleOrDid } from '../api';
44

55
export function useAccountResolver() {
6-
let { handle } = useParams();
6+
const { handle } = useParams();
77
return useResolveHandleOrDid(handle);
88
}

src/detail-panels/block-panel-generic/block-panel-generic.css

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.account-info-panel-blocked-timestamp {
22
font-size: 80%;
3-
text-shadow: 0 0 1px white, 0 0 1px white, 0 0 1px white, 0 0 1px white, 0 0 12px white, 0 0 12px white, 0 0 12px white, 0 0 12px white;
3+
text-shadow: 0 0 1px white, 0 0 1px white, 0 0 1px white, 0 0 1px white,
4+
0 0 12px white, 0 0 12px white, 0 0 12px white, 0 0 12px white;
45
border-top: solid 1px #ededed;
56
padding-top: 0.5em;
67
}
@@ -52,15 +53,16 @@
5253

5354
li.blocking-list-entry:nth-child(even) {
5455
background-color: #0000000a;
55-
background-image: linear-gradient(to top, #00000024, transparent 1px), linear-gradient(to bottom, #0000000a, transparent 1px);
56+
background-image: linear-gradient(to top, #00000024, transparent 1px),
57+
linear-gradient(to bottom, #0000000a, transparent 1px);
5658
}
5759

5860
.blocking-list-entry .blocking-account-link {
5961
color: inherit;
6062
text-decoration: inherit;
6163
}
6264

63-
.blocking-list-entry .blocking-account-link:hover {
65+
.blocking-list-entry a.blocking-account-link:hover {
6466
text-decoration: underline;
6567
}
6668

@@ -70,7 +72,10 @@ li.blocking-list-entry:nth-child(even) {
7072
grid-template-columns: auto 1fr;
7173
}
7274

73-
.blocking-list-entry .account-short-entry-content .account-short-entry-handle .account-short-entry-display-name {
75+
.blocking-list-entry
76+
.account-short-entry-content
77+
.account-short-entry-handle
78+
.account-short-entry-display-name {
7479
opacity: 0.7;
7580
}
7681

src/detail-panels/block-panel-generic/block-panel-generic.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export function BlockPanelGeneric({
6868
setQ
6969
/> */}
7070
<PanelHeader
71+
loading={isLoading}
7172
count={count}
7273
blocklist={blocklist}
7374
header={header}
@@ -109,8 +110,8 @@ class PanelHeader extends React.Component {
109110
direction = +1;
110111

111112
render() {
112-
let count = this.props.count;
113-
if (typeof this.props.count !== 'number') {
113+
let count = this.props.count || 0;
114+
if (this.props.loading) {
114115
clearTimeout(this.timeout);
115116
this.timeout = setTimeout(() => this.forceUpdate(), 10);
116117
count = this.state?.count || 0;

src/detail-panels/layout.jsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const accountTabs = /** @type {const} */ ([
2525
]);
2626

2727
export function AccountLayout() {
28-
const account = useAccountResolver();
28+
const { handle } = useParams();
2929
let { tab } = useParams();
3030
if (!tab) tab = accountTabs[0];
3131

@@ -36,10 +36,7 @@ export function AccountLayout() {
3636
selectedTab={tab}
3737
onSetSelectedTab={(selectedTab) => {
3838
navigate(
39-
'/' +
40-
unwrapShortHandle(account.data?.shortHandle) +
41-
'/' +
42-
selectedTab,
39+
`/${handle}/` + selectedTab,
4340
{ replace: true }
4441
);
4542
}}

0 commit comments

Comments
 (0)