{noResultComponent ? React.createElement(noResultComponent) : "No more result"}
-
+ */}
})
\ No newline at end of file
diff --git a/packages/app/src/components/LoadMore/index.less b/packages/app/src/components/LoadMore/index.less
index 020606cb..1557a48e 100755
--- a/packages/app/src/components/LoadMore/index.less
+++ b/packages/app/src/components/LoadMore/index.less
@@ -1,5 +1,8 @@
.infinite-scroll {
min-height: 32vw;
+
+ width: 100%;
+
position: relative;
.no-result {
diff --git a/packages/app/src/components/PostCard/components/attachments/index.jsx b/packages/app/src/components/PostCard/components/attachments/index.jsx
index c63cea74..312b0bde 100755
--- a/packages/app/src/components/PostCard/components/attachments/index.jsx
+++ b/packages/app/src/components/PostCard/components/attachments/index.jsx
@@ -9,7 +9,6 @@ import ContentFailed from "../contentFailed"
import BearCarousel from "bear-react-carousel"
import "bear-react-carousel/dist/index.css"
-import "react-responsive-carousel/lib/styles/carousel.min.css"
import "plyr-react/dist/plyr.css"
import "./index.less"
diff --git a/packages/app/src/components/PostCard/components/attachments/index.less b/packages/app/src/components/PostCard/components/attachments/index.less
index 35bb0101..98ae6a35 100755
--- a/packages/app/src/components/PostCard/components/attachments/index.less
+++ b/packages/app/src/components/PostCard/components/attachments/index.less
@@ -46,9 +46,9 @@
justify-content: center;
width: 100%;
- height: 100%;
+ height: 50vh;
- max-height: 50vh;
+ max-height: 700px;
.plyr {
width: 100%;
diff --git a/packages/app/src/components/PostCard/index.jsx b/packages/app/src/components/PostCard/index.jsx
index d7800f65..2b98042a 100755
--- a/packages/app/src/components/PostCard/index.jsx
+++ b/packages/app/src/components/PostCard/index.jsx
@@ -198,9 +198,10 @@ export default class PostCard extends React.PureComponent {
{
- this.props.data.attachments && this.props.data.attachments.length > 0 && 0 &&
+
}
diff --git a/packages/app/src/components/PostCard/index.less b/packages/app/src/components/PostCard/index.less
index 08a0dcbd..cd604be8 100644
--- a/packages/app/src/components/PostCard/index.less
+++ b/packages/app/src/components/PostCard/index.less
@@ -4,14 +4,19 @@
display: flex;
flex-direction: column;
+ //max-height: 500px;
+ //height: fit-content;
+
width: 100%;
- max-width: 800px;
+ max-width: 700px;
gap: 15px;
padding: 17px 17px 0px 17px;
background-color: var(--background-color-accent);
- border-bottom: 2px solid var(--border-color);
+
+ //border-bottom: 2px solid var(--border-color);
+ border-radius: 8px;
color: rgba(var(--background-color-contrast));
@@ -68,16 +73,4 @@
}
}
}
-
- &:first-child {
- border-top-left-radius: 8px;
- border-top-right-radius: 8px;
- }
-
- &:last-child {
- border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
-
- border-bottom: none;
- }
}
\ No newline at end of file
diff --git a/packages/app/src/components/PostCreator/index.jsx b/packages/app/src/components/PostCreator/index.jsx
index 0b58a092..2a270795 100755
--- a/packages/app/src/components/PostCreator/index.jsx
+++ b/packages/app/src/components/PostCreator/index.jsx
@@ -28,7 +28,7 @@ export default class PostCreator extends React.Component {
postAttachments: [],
fileList: [],
- postingPolicy: DEFAULT_POST_POLICY
+ postingPolicy: DEFAULT_POST_POLICY,
}
creatorRef = React.createRef()
diff --git a/packages/app/src/components/PostsList/index.jsx b/packages/app/src/components/PostsList/index.jsx
index 17ff590f..857f3c6f 100755
--- a/packages/app/src/components/PostsList/index.jsx
+++ b/packages/app/src/components/PostsList/index.jsx
@@ -6,29 +6,28 @@ import PostCard from "components/PostCard"
import PlaylistTimelineEntry from "components/Music/PlaylistTimelineEntry"
import LoadMore from "components/LoadMore"
-//import { ViewportList } from "react-viewport-list"
-import AutoSizer from "react-virtualized-auto-sizer"
+import { For } from "million/react"
import PostModel from "models/post"
import "./index.less"
const LoadingComponent = () => {
- return
}
const NoResultComponent = () => {
- return
+ return
}
const typeToComponent = {
@@ -36,9 +35,27 @@ const typeToComponent = {
"playlist": (args) => ,
}
+const Entry = React.memo((props) => {
+ const { data } = props
+
+ return React.createElement(typeToComponent[data.type ?? "post"] ?? PostCard, {
+ key: data._id,
+ data: data,
+ //disableAttachments: true,
+ events: {
+ onClickLike: props.onLikePost,
+ onClickSave: props.onSavePost,
+ onClickDelete: props.onDeletePost,
+ onClickEdit: props.onEditPost,
+ },
+ })
+})
+
const PostList = (props) => {
+ const parentRef = React.useRef()
+
return {
}
- {
- props.list.map((data) => {
- return React.createElement(typeToComponent[data.type ?? "post"] ?? PostCard, {
- key: data._id,
- data: data,
- events: {
- onClickLike: props.onLikePost,
- onClickSave: props.onSavePost,
- onClickDelete: props.onDeletePost,
- onClickEdit: props.onEditPost,
- }
- })
- })
- }
+
+
+ {
+ (data) =>
+ }
+
}
diff --git a/packages/app/src/components/PostsList/index.less b/packages/app/src/components/PostsList/index.less
index ea738c35..b97b7ac6 100755
--- a/packages/app/src/components/PostsList/index.less
+++ b/packages/app/src/components/PostsList/index.less
@@ -73,6 +73,58 @@ html {
//margin: auto;
z-index: 150;
+ slot {
+ slot {
+ .post_card {
+ border-radius: 0;
+ border-bottom: 2px solid var(--border-color);
+ }
+
+ .playlistTimelineEntry {
+ border-radius: 0;
+ border-bottom: 2px solid var(--border-color);
+ }
+ }
+
+ &:first-child {
+ slot {
+ .post_card {
+ border-radius: 8px;
+
+ border-bottom-left-radius: 0px;
+ border-bottom-right-radius: 0px;
+ }
+
+ .playlistTimelineEntry {
+ border-radius: 8px;
+
+ border-bottom-left-radius: 0px;
+ border-bottom-right-radius: 0px;
+ }
+ }
+ }
+
+ &:last-child {
+ slot {
+ .post_card {
+ border-top-left-radius: 0px;
+ border-top-right-radius: 0px;
+
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ }
+
+ .playlistTimelineEntry {
+ border-top-left-radius: 0px;
+ border-top-right-radius: 0px;
+
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ }
+ }
+ }
+ }
+
.postCard {
width: 100%;
min-width: 0;
diff --git a/packages/app/src/components/Searcher/index.jsx b/packages/app/src/components/Searcher/index.jsx
index 08274057..073ff74b 100755
--- a/packages/app/src/components/Searcher/index.jsx
+++ b/packages/app/src/components/Searcher/index.jsx
@@ -19,11 +19,14 @@ const ResultsTypeDecorators = {
users: {
icon: "Users",
label: "Users",
+ onClick: (item) => {
+ app.navigation.goToAccount(item.username)
+ },
renderItem: (props) => {
const { item, onClick } = props
return
-
+ onClick(item)} user={item} />
}
},
@@ -73,9 +76,13 @@ const Results = (props) => {
}
- const handleClick = (props) => {
- if (props.close) {
- props.close()
+ const handleClick = async (decorator, data) => {
+ if (typeof decorator.onClick === "function") {
+ await decorator.onClick(data)
+ }
+
+ if (typeof props.onClose === "function") {
+ return props.onClose()
}
}
@@ -116,7 +123,7 @@ const Results = (props) => {
return decorator.renderItem({
key: index,
item,
- onClick: handleClick,
+ onClick: (...data) => handleClick(decorator, ...data),
...decorator.props,
})
})
@@ -199,28 +206,6 @@ export default (props) => {
}
}
- const handleResultClick = (type, value) => {
- switch (type) {
- case "users": {
- app.navigation.goToAccount(value.username)
- break
- }
- case "posts": {
- app.navigation.goToPost(value)
- break
- }
-
- default: {
- console.warn("Searcher: cannot handle clicks on result of type :", type)
- break
- }
- }
-
- if (typeof props.close === "function") {
- props.close()
- }
- }
-
React.useEffect(() => {
if (props.useUrlQuery) {
if (typeof query === "string") {
@@ -244,7 +229,7 @@ export default (props) => {
onChange={handleOnSearch}
value={searchValue}
prefix={}
- autoFocus={props.autoFocus ?? false}
+ autoFocus={props.autoFocus ?? true}
onFocus={props.onFocus}
onBlur={props.onUnfocus}
/>
@@ -254,7 +239,8 @@ export default (props) => {
{
!loading &&
+ onClose={props.close}
+ />
}
}
diff --git a/packages/app/src/layouts/default/index.jsx b/packages/app/src/layouts/default/index.jsx
index c15c892e..c0b96c89 100755
--- a/packages/app/src/layouts/default/index.jsx
+++ b/packages/app/src/layouts/default/index.jsx
@@ -32,14 +32,11 @@ const DesktopLayout = (props) => {
className={classnames(
...props.contentClassnames ?? [],
"content_layout",
- {
- ["floating-sidebar"]: window.app?.cores.settings.get("sidebar.floating")
- },
"fade-transverse-active",
)}
>
{
- React.cloneElement(props.children, props)
+ props.children && React.cloneElement(props.children, props)
}
@@ -60,7 +57,7 @@ const MobileLayout = (props) => {
)}
>
{
- React.cloneElement(props.children, props)
+ props.children && React.cloneElement(props.children, props)
}
diff --git a/packages/app/src/pages/login/index.jsx b/packages/app/src/pages/login/index.jsx
index 0b9eab75..f5c549b1 100755
--- a/packages/app/src/pages/login/index.jsx
+++ b/packages/app/src/pages/login/index.jsx
@@ -79,7 +79,7 @@ export default (props) => {
{
- props.user && {
app.navigation.goMain()
}}
>
- Continue as {props.user.username}
+ Continue as {app.userData.username}
}
@@ -131,7 +131,7 @@ export default (props) => {
- Registering a new account accepts the Terms and Conditions and Privacy policy for the services provided by {config.author}
+ Registering a new account accepts the app.location.push("/terms")}>Terms and Conditions and app.location.push("/privacy")}>Privacy policy for the services provided by {config.author}
diff --git a/packages/app/src/router.jsx b/packages/app/src/router.jsx
index f716d6fd..2d601249 100755
--- a/packages/app/src/router.jsx
+++ b/packages/app/src/router.jsx
@@ -93,19 +93,6 @@ function generatePageElementWrapper(route, element, bindProps) {
}
}
- if (typeof routeDeclaration.requiredRoles !== "undefined") {
- const isAdmin = bindProps.user?.roles?.includes("admin") ?? false
-
- if (!isAdmin && !routeDeclaration.requiredRoles.some((role) => bindProps.user?.roles?.includes(role))) {
- return window.app.location.push("/")}>Back Home}
- />
- }
- }
-
if (routeDeclaration.useLayout) {
app.layout.set(routeDeclaration.useLayout)
}
diff --git a/packages/app/src/theme/index.less b/packages/app/src/theme/index.less
index 3845812e..4a0ac2b1 100755
--- a/packages/app/src/theme/index.less
+++ b/packages/app/src/theme/index.less
@@ -114,8 +114,6 @@ html {
&.centered-content {
.content_layout {
- container-type: inline-size;
-
margin: auto;
min-width: 400px;
@@ -124,22 +122,22 @@ html {
padding-left: 0;
padding-right: 0;
- .post_card {
- max-width: 900px;
+ .post-list {
+ max-width: 700px;
}
@media screen and (max-width: 2000px) {
max-width: 1100px;
- .post_card {
- max-width: 750px;
+ .post-list {
+ max-width: 700px;
}
}
@media screen and (max-width: 1444px) {
max-width: 800px;
- .post_card {
+ .post-list {
max-width: 550px;
}
}
@@ -147,7 +145,7 @@ html {
@media screen and (max-width: 1170px) {
max-width: 700px;
- .post_card {
+ .post-list {
max-width: 450px;
}
}
@@ -155,7 +153,7 @@ html {
@media screen and (max-width: 1024px) {
max-width: 600px;
- .post_card {
+ .post-list {
max-width: 350px;
}
}
diff --git a/packages/app/vite.config.js b/packages/app/vite.config.js
index 392f7820..0c67da7b 100755
--- a/packages/app/vite.config.js
+++ b/packages/app/vite.config.js
@@ -1,5 +1,4 @@
import { defineConfig } from "vite"
-
import react from "@vitejs/plugin-react"
import getConfig from "./.config.js"