-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/nft showcase preview #371
base: main
Are you sure you want to change the base?
Conversation
src/app/backend-api.service.ts
Outdated
@@ -64,6 +64,7 @@ export class BackendRoutes { | |||
static RoutePathGetNFTsForUser = "/api/v0/get-nfts-for-user"; | |||
static RoutePathGetNFTBidsForUser = "/api/v0/get-nft-bids-for-user"; | |||
static RoutePathGetNFTShowcase = "/api/v0/get-nft-showcase"; | |||
static RoutePathGetNFTShowcasePreview = "/api/v0/admin/get-nft-showcase-preview"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to live with the rest of the admin routes below.
src/app/creator-profile-page/creator-profile-top-card/creator-profile-top-card.component.html
Outdated
Show resolved
Hide resolved
this.activeTab = tab; | ||
this.router.navigate([], { | ||
relativeTo: this.route, | ||
queryParams: { feedTab: this.activeTab }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not call the query param feedTab. I think we call it feedTab in the feed component and this could cause some issues when merging queryParams.
showShowcaseManagementTab() { | ||
return ( | ||
this.activeTab === NftDropMgrComponent.SHOWCASE_MANAGEMENT && | ||
this.posts.length > 0 && | ||
(!this.loading || this.loadingNewDrop) | ||
); | ||
} | ||
|
||
showShowcasePreviewTab() { | ||
return ( | ||
this.activeTab === NftDropMgrComponent.SHOWCASE_PREVIEW_TAB && | ||
this.posts.length > 0 && | ||
(!this.loading || this.loadingNewDrop) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should avoid using these functions to determine what should be shown. Instead, we should have a container div that is conditionally shown *ngIf="posts.length && (!loading || loadingNewDrop)"
, inside of which we show the showcase management *ngIf="activeTab === NftDropMgrComponent.SHOWCASE_MANAGEMENT"
and show the preview *ngIf="activeTab === NftDropMgrComponent.SHOWCASE_PREVIEW_TAB"
@@ -1,14 +1,17 @@ | |||
import { Component, OnInit } from "@angular/core"; | |||
import {Component, Input, OnInit} from "@angular/core"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {Component, Input, OnInit} from "@angular/core"; | |
import { Component, Input, OnInit } from "@angular/core"; |
showcaseComingSoon() { | ||
return !this.loading && (!this.nftCollections || !has(this.nftCollections, length)); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be able to kill this function and just use the constants to define the conditional
import { BackendApiService, NFTCollectionResponse } from "../backend-api.service"; | ||
import { GlobalVarsService } from "../global-vars.service"; | ||
import { InfiniteScroller } from "../infinite-scroller"; | ||
import { IAdapter, IDatasource } from "ngx-ui-scroll"; | ||
import { has } from "lodash"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { has } from "lodash"; |
console.log('Here is the showcase idx'); | ||
console.log(this.showcaseIdx); | ||
console.log(this.showcaseIdx === undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log('Here is the showcase idx'); | |
console.log(this.showcaseIdx); | |
console.log(this.showcaseIdx === undefined); |
<div *ngIf="posts.length > 0 && (!loading || loadingNewDrop)" class="p-15px fs-15px"> | ||
<tab-selector [tabs]="feedTabs" [activeTab]="activeTab" (tabClick)="_handleTabClick($event)"></tab-selector> | ||
<!--Admin panel--> | ||
<div *ngIf="showShowcaseManagementTab()" class="p-15px fs-15px"> | ||
<b *ngIf="!loadingNewDrop">NFTs in this drop:</b> | ||
<div #uiScroll *uiScroll="let post of datasource" [ngClass]="{'d-flex align-items-center mt-15px border border-color-grey br-8px': !loadingNewDrop}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this uiScroll directive needs to be moved into a separate component. If you switch back and forth between the tabs, you're going to lose the Showcase Management view. You'll see an error that looks like the below:
ERROR TypeError: Cannot read property 'dispose' of undefined
at UiScrollComponent.ngOnDestroy (ngx-ui-scroll.js:57)
at executeOnDestroys (core.js:7405)
at cleanUpView (core.js:7318)
at destroyViewTree (core.js:7144)
at destroyLView (core.js:7296)
at ViewContainerRef.remove (core.js:23208)
at ViewContainerRef.clear (core.js:23116)
at NgIf._updateView (common.js:3535)
at NgIf.set ngIf [as ngIf] (common.js:3502)
at setInputsForProperty (core.js:10961)
some weird behavior when switching between drops still. let's revisit this later. |
Shouldn't be deployed until deso-protocol/backend#98 is deployed