mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
some improvements to post list render lifecycle
This commit is contained in:
parent
5ec40e0163
commit
ee6138b58e
@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
width: 35vw;
|
width: 35vw;
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
max-width: 600px;
|
max-width: 800px;
|
||||||
|
|
||||||
|
//max-width: 600px;
|
||||||
//min-height: 165px;
|
//min-height: 165px;
|
||||||
//height: 100%;
|
//height: 100%;
|
||||||
max-width: 800px;
|
|
||||||
|
|
||||||
background-color: var(--background-color-accent);
|
background-color: var(--background-color-accent);
|
||||||
|
|
||||||
|
@ -366,6 +366,46 @@ export class PostsListsComponent extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return <div className="post-list_wrapper">
|
||||||
|
<LoadMore
|
||||||
|
ref={this.listRef}
|
||||||
|
className="post-list"
|
||||||
|
loadingComponent={LoadingComponent}
|
||||||
|
noResultComponent={NoResultComponent}
|
||||||
|
hasMore={this.state.hasMore}
|
||||||
|
fetching={this.state.loading}
|
||||||
|
onBottom={this.onLoadMore}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
!this.state.realtimeUpdates && <div className="resume_btn_wrapper">
|
||||||
|
<antd.Button
|
||||||
|
type="primary"
|
||||||
|
shape="round"
|
||||||
|
onClick={this.onResumeRealtimeUpdates}
|
||||||
|
loading={this.state.resumingLoading}
|
||||||
|
icon={<Icons.SyncOutlined />}
|
||||||
|
>
|
||||||
|
Resume
|
||||||
|
</antd.Button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
this.state.list.map((data) => {
|
||||||
|
return React.createElement(typeToComponent[data.type ?? "post"] ?? PostCard, {
|
||||||
|
key: data._id,
|
||||||
|
data: data,
|
||||||
|
events: {
|
||||||
|
onClickLike: this.onLikePost,
|
||||||
|
onClickSave: this.onSavePost,
|
||||||
|
onClickDelete: this.onDeletePost,
|
||||||
|
onClickEdit: this.onEditPost,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</LoadMore>
|
||||||
|
</div>
|
||||||
|
|
||||||
return <AutoSizer
|
return <AutoSizer
|
||||||
disableWidth
|
disableWidth
|
||||||
style={{
|
style={{
|
||||||
|
@ -1,13 +1,28 @@
|
|||||||
.postList {
|
.post-list_wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
width: fit-content;
|
||||||
|
|
||||||
|
//overflow: hidden;
|
||||||
|
overflow-y: overlay;
|
||||||
|
|
||||||
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-list {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
// WARN: Only use if is a performance issue (If is using virtualized list)
|
// WARN: Only use if is a performance issue (If is using virtualized list)
|
||||||
//will-change: transform;
|
//will-change: transform;
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-y: overlay;
|
overflow-y: overlay;
|
||||||
|
|
||||||
height: max-content;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -17,17 +32,25 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
z-index: 150;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.resume_btn_wrapper {
|
.resume_btn_wrapper {
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
|
|
||||||
position: absolute;
|
position: sticky;
|
||||||
|
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
||||||
transform: translate(0, -50%);
|
padding: 10px;
|
||||||
|
background-color: rgba(var(--background-color-accent-values), 0.8);
|
||||||
|
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
-webkit-backdrop-filter: blur(10px);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
@ -36,6 +59,10 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
width: 35vw;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 800px;
|
||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
animation: fadeIn 150ms ease-in-out forwards;
|
animation: fadeIn 150ms ease-in-out forwards;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user