move tabs to folders

This commit is contained in:
SrGooglo 2023-10-12 19:57:52 +00:00
parent c5f2c05c2e
commit ec9594763b
9 changed files with 100 additions and 6 deletions

View File

@ -9,6 +9,7 @@ import { SessionModel, UserModel, FollowsModel } from "models"
import DetailsTab from "./tabs/details" import DetailsTab from "./tabs/details"
import PostsTab from "./tabs/posts" import PostsTab from "./tabs/posts"
import MusicTab from "./tabs/music"
import FollowersTab from "./tabs/followers" import FollowersTab from "./tabs/followers"
import "./index.less" import "./index.less"
@ -17,7 +18,7 @@ const TabsComponent = {
"posts": PostsTab, "posts": PostsTab,
"followers": FollowersTab, "followers": FollowersTab,
"details": DetailsTab, "details": DetailsTab,
"music": DetailsTab, "music": MusicTab,
} }
const TabRender = React.memo((props, ref) => { const TabRender = React.memo((props, ref) => {
@ -200,7 +201,7 @@ export default class Account extends React.Component {
} }
if (!user) { if (!user) {
return <Skeleton /> return <antd.Skeleton active />
} }
return <div return <div

View File

@ -12,10 +12,16 @@
&.noCover { &.noCover {
.panels { .panels {
padding-top: 0;
.leftPanel { .leftPanel {
transform: translate(0, 0) !important; transform: translate(0, 0) !important;
} }
} }
.userCard {
filter: none;
}
} }
&.topHidden { &.topHidden {
@ -117,6 +123,8 @@
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
border: 1px solid var(--border-color);
.followButton { .followButton {
width: fit-content; width: fit-content;
} }
@ -151,7 +159,7 @@
justify-self: center; justify-self: center;
.ant-menu-item-selected { .ant-menu-item-selected {
background-color: var(--background-color-primary)!important; background-color: var(--background-color-primary) !important;
} }
} }
} }
@ -198,7 +206,6 @@
width: fit-content; width: fit-content;
.ant-menu-item { .ant-menu-item {
width: fit-content; width: fit-content;
.ant-menu-title-content { .ant-menu-title-content {

View File

@ -7,7 +7,7 @@ import { UserBadges } from "components"
import { Icons } from "components/Icons" import { Icons } from "components/Icons"
import "./details.less" import "./index.less"
function getJoinLabel(jsDate) { function getJoinLabel(jsDate) {
const date = DateTime.fromJSDate(new Date(jsDate)) const date = DateTime.fromJSDate(new Date(jsDate))

View File

@ -2,7 +2,7 @@ import React from "react"
import { FollowersList } from "components" import { FollowersList } from "components"
import "./followers.less" import "./index.less"
export default React.memo((props) => { export default React.memo((props) => {
return <FollowersList return <FollowersList

View File

@ -0,0 +1,55 @@
import React from "react"
import * as antd from "antd"
import classnames from "classnames"
import PlaylistItem from "components/Music/PlaylistItem"
import MusicModel from "models/music"
import "./index.less"
export default (props) => {
const user_id = props.state.user._id
const [L_Releases, R_Releases, E_Releases, M_Releases] = app.cores.api.useRequest(MusicModel.getReleases, {
user_id: user_id,
})
if (E_Releases) {
return <antd.Result
status="warning"
title="Failed to retrieve releases"
subTitle={E_Releases}
/>
}
if (L_Releases) {
return <antd.Skeleton active />
}
const isEmpty = R_Releases.items.length === 0
return <div
className={classnames(
"profile_releases",
{
["empty"]: isEmpty
}
)}
>
{
isEmpty && <antd.Result
status="warning"
title="This user has no releases yet."
/>
}
{
R_Releases.items.map((r) => {
return <PlaylistItem
key={r._id}
playlist={r}
/>
})
}
</div>
}

View File

@ -0,0 +1,31 @@
.profile_releases {
display: grid;
width: 100%;
grid-auto-columns: auto;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 1fr;
grid-column-gap: 20px;
grid-row-gap: 20px;
@media (min-width: 2000px) {
grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 2300px) {
grid-template-columns: repeat(5, 1fr);
}
.playlistItem {
justify-self: center;
}
&.empty {
display: flex;
align-items: center;
justify-content: center;
}
}