mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 06:42:14 +00:00
Merge branch 'feature/mvp' of https://github.com/storytold/storyteller-frontend into feature/mvp
This commit is contained in:
commit
3835bab034
4 files changed
+68
-52
No files matched your search
@@ -97,7 +97,6 @@ import { PasswordResetEmailPage } from "./pages/password_reset/PasswordResetEmai
|
||||
import { PasswordResetVerificationPage } from "./pages/password_reset/PasswordResetVerificationPage";
|
||||
import DevUpload from "./pages/dev_upload/DevUpload";
|
||||
import { NewProfilePage } from "./pages/profile/profile_view/NewProfilePage";
|
||||
import { ProfilePage } from "./pages/profile/profile_view/ProfilePage";
|
||||
import { ModerationJobControlPage } from "./pages/moderation/job_control/ModerationJobControlPage";
|
||||
import WeightPage from "./pages/weight/WeightPage";
|
||||
import ExplorePage from "./pages/explore/ExplorePage";
|
||||
@@ -300,17 +299,8 @@ class PageContainer extends React.Component<
|
||||
<ProfileBanFc sessionWrapper={this.props.sessionWrapper} />
|
||||
</Route>
|
||||
|
||||
<Route path="/profile/:username">
|
||||
<ProfilePage
|
||||
sessionWrapper={this.props.sessionWrapper}
|
||||
sessionSubscriptionsWrapper={
|
||||
this.props.sessionSubscriptionsWrapper
|
||||
}
|
||||
/>
|
||||
</Route>
|
||||
|
||||
{/* New Profile Page */}
|
||||
<Route path="/dev-profile/:username">
|
||||
<Route path="/profile/:username">
|
||||
<NewProfilePage
|
||||
sessionWrapper={this.props.sessionWrapper}
|
||||
sessionSubscriptionsWrapper={
|
||||
|
||||
@@ -17,20 +17,21 @@ export default function FeaturedTab() {
|
||||
const [list, listSet] = useState<MediaFile[]>([]);
|
||||
// const [showMasonryGrid, setShowMasonryGrid] = useState(true);
|
||||
const [status, statusSet] = useState(FetchStatus.ready);
|
||||
const isLoading = status === FetchStatus.ready || status === FetchStatus.in_progress;
|
||||
const isLoading =
|
||||
status === FetchStatus.ready || status === FetchStatus.in_progress;
|
||||
|
||||
useEffect(() => {
|
||||
if (status === FetchStatus.ready) {
|
||||
statusSet(FetchStatus.in_progress);
|
||||
ListFeaturedMediaFiles("",{}).then((res: any) => {
|
||||
console.log("🏮",res);
|
||||
ListFeaturedMediaFiles("", {}).then((res: any) => {
|
||||
console.log("🏮", res);
|
||||
statusSet(FetchStatus.success);
|
||||
if (res.results) {
|
||||
listSet(res.results);
|
||||
}
|
||||
});
|
||||
}
|
||||
},[status]);
|
||||
}, [status]);
|
||||
|
||||
return (
|
||||
<div className="d-flex flex-column gap-4">
|
||||
@@ -43,35 +44,47 @@ export default function FeaturedTab() {
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{ isLoading && !list.length ? (
|
||||
{isLoading && !list.length ? (
|
||||
<div className="row gx-3 gy-3">
|
||||
{Array.from({ length: 12 }).map((_, index) => (
|
||||
<SkeletonCard key={index} />
|
||||
))}
|
||||
</div>
|
||||
) : ( <>
|
||||
{ list.length === 0 && status === 3 ? (
|
||||
<div className="text-center mt-4 opacity-75">
|
||||
No featured media.
|
||||
</div>
|
||||
) : (
|
||||
<MasonryGrid
|
||||
gridRef={gridContainerRef}
|
||||
onLayoutComplete={() => console.log("Layout complete!")}
|
||||
>
|
||||
{ list.map((data: any, key: number) => {
|
||||
let props = { bookmarks, data, origin, ratings, type: "media" };
|
||||
) : (
|
||||
<>
|
||||
{list.length === 0 && status === 3 ? (
|
||||
<div className="text-center mt-4 opacity-75">
|
||||
No featured media.
|
||||
</div>
|
||||
) : (
|
||||
<MasonryGrid
|
||||
gridRef={gridContainerRef}
|
||||
onLayoutComplete={() => console.log("Layout complete!")}
|
||||
>
|
||||
{list.map((data: any, key: number) => {
|
||||
let props = {
|
||||
bookmarks,
|
||||
data,
|
||||
origin,
|
||||
ratings,
|
||||
type: "media",
|
||||
showCreator: true,
|
||||
};
|
||||
|
||||
return <div {...{
|
||||
className: "col-12 col-sm-6 col-xl-4 grid-item",
|
||||
key
|
||||
}}>
|
||||
return (
|
||||
<div
|
||||
{...{
|
||||
className: "col-12 col-sm-6 col-xl-4 grid-item",
|
||||
key,
|
||||
}}
|
||||
>
|
||||
<MediaCards {...{ type: data.media_type, props }} />
|
||||
</div>;
|
||||
}) }
|
||||
</MasonryGrid>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</MasonryGrid>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{/* <div>
|
||||
|
||||
@@ -118,16 +118,29 @@ export default function MediaTab() {
|
||||
<MasonryGrid
|
||||
gridRef={gridContainerRef}
|
||||
onLayoutComplete={() => console.log("Layout complete!")}
|
||||
> { media.list.map((data: any, key: number) => {
|
||||
let props = { bookmarks, data, origin, ratings, type: "media" };
|
||||
>
|
||||
{" "}
|
||||
{media.list.map((data: any, key: number) => {
|
||||
let props = {
|
||||
bookmarks,
|
||||
data,
|
||||
origin,
|
||||
ratings,
|
||||
type: "media",
|
||||
showCreator: true,
|
||||
};
|
||||
|
||||
return <div {...{
|
||||
className: "col-12 col-sm-6 col-xl-4 grid-item",
|
||||
key
|
||||
}}>
|
||||
<MediaCards {...{ type: data.media_type, props }} />
|
||||
</div>;
|
||||
}) }
|
||||
return (
|
||||
<div
|
||||
{...{
|
||||
className: "col-12 col-sm-6 col-xl-4 grid-item",
|
||||
key,
|
||||
}}
|
||||
>
|
||||
<MediaCards {...{ type: data.media_type, props }} />
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</MasonryGrid>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -86,10 +86,10 @@ function NewProfilePage(this: any, props: Props) {
|
||||
usePrefixedDocumentTitle(documentTitle);
|
||||
|
||||
if (
|
||||
pathname === `/dev-profile/${username}` ||
|
||||
pathname === `/dev-profile/${username}/`
|
||||
pathname === `/profile/${username}` ||
|
||||
pathname === `/profile/${username}/`
|
||||
) {
|
||||
return <Redirect to={`/dev-profile/${username}/media`} />;
|
||||
return <Redirect to={`/profile/${username}/media`} />;
|
||||
}
|
||||
|
||||
if (notFoundState) {
|
||||
@@ -355,21 +355,21 @@ function NewProfilePage(this: any, props: Props) {
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
to: `/dev-profile/${username}/media`,
|
||||
to: `/profile/${username}/media`,
|
||||
label: "Media",
|
||||
content: <MediaTab {...{ username }} />,
|
||||
icon: faPhotoFilmMusic,
|
||||
padding: true,
|
||||
},
|
||||
{
|
||||
to: `/dev-profile/${username}/weights`,
|
||||
to: `/profile/${username}/weights`,
|
||||
label: "Weights",
|
||||
content: <WeightsTab {...{ username }} />,
|
||||
icon: faLayerGroup,
|
||||
padding: true,
|
||||
},
|
||||
{
|
||||
to: `/dev-profile/${username}/bookmarks`,
|
||||
to: `/profile/${username}/bookmarks`,
|
||||
label: "Bookmarks",
|
||||
content: <BookmarksTab {...{ username }} />,
|
||||
icon: faBookmark,
|
||||
|
||||
Reference in new issue
Block a user