Skip to content

Commit

Permalink
Merge branch 'amenconi-get-all-member-transactions' of https://github…
Browse files Browse the repository at this point in the history
….com/soonaverse/app into amenconi-get-all-member-transactions
  • Loading branch information
amenconi committed Mar 15, 2024
2 parents 71f5c89 + 8f8ec39 commit 2632b74
Show file tree
Hide file tree
Showing 54 changed files with 4,318 additions and 211 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ User | PR | SOON Reward | SMR Address | Authorized By | Comments |
---- | -- | ----------- | ----------- | ------------- | -------- |
[@emmap3-do](https://github.com/emmap3-do) | https://github.com/soonaverse/app/pull/47 | 500 | smr1qzt5qs6m6s2us8ll0hdfefzpr43cdz2xmjzywmrkz0sc2uyegvzjwazr6f8 | [@adam_unchained](https://github.com/adam_unchained) | Testing, continuous support in #dev channel
[@emmap3-do](https://github.com/emmap3-do) | https://github.com/soonaverse/app/pull/56 | 75 | smr1qzt5qs6m6s2us8ll0hdfefzpr43cdz2xmjzywmrkz0sc2uyegvzjwazr6f8 | [@adam_unchained](https://github.com/adam_unchained) | Minor fixes
[@amenconi](https://github.com/amenconi) | https://github.com/soonaverse/app/pull/128 | 76'000 | smr1qrncyy5lcfpr4hta0hg7qp2cmw6ssm0ycllx5nnz5pwcup8rxs0zzp2jp64 | [SOON_COMMITTEE - request 83](https://github.com/soonaverse/foundation/issues/83) | Bulk Buying feature
[@emmap3-do](https://github.com/emmap3-do) | https://github.com/soonaverse/app/pull/128 | 15'200 | smr1qzt5qs6m6s2us8ll0hdfefzpr43cdz2xmjzywmrkz0sc2uyegvzjwazr6f8 | [SOON_COMMITTEE - request 83](https://github.com/soonaverse/foundation/issues/83) | Bulk Buying feature
4 changes: 4 additions & 0 deletions src/app/@api/collection.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export class CollectionApi extends BaseApi<Collection> {
super(Dataset.COLLECTION, httpClient);
}

public getCollectionById(collectionId: string): Observable<Collection | undefined> {
return this.listen(collectionId);
}

public mintCollection = (
req: Build5Request<CollectionMintRequest>,
): Observable<Transaction | undefined> => this.request(WEN_FUNC.mintCollection, req);
Expand Down
4 changes: 4 additions & 0 deletions src/app/@api/nft.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export class NftApi extends BaseApi<Nft> {
public stakeNft = (req: Build5Request<NftStakeRequest>): Observable<Transaction | undefined> =>
this.request(WEN_FUNC.stakeNft, req);

public getNftById(nftId: string): Observable<Nft | undefined> {
return this.listen(nftId);
}

public successfullOrders(
nftId: string,
network?: Network,
Expand Down
5 changes: 5 additions & 0 deletions src/app/@api/order.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
WEN_FUNC,
Build5Request,
NftPurchaseRequest,
NftPurchaseBulkRequest,
OrderTokenRequest,
AddressValidationRequest,
NftBidRequest,
Expand All @@ -27,6 +28,10 @@ export class OrderApi extends BaseApi<Transaction> {
public orderNft = (req: Build5Request<NftPurchaseRequest>): Observable<Transaction | undefined> =>
this.request(WEN_FUNC.orderNft, req);

public orderNfts = (
req: Build5Request<NftPurchaseBulkRequest>,
): Observable<Transaction | undefined> => this.request(WEN_FUNC.orderNftBulk, req);

public orderToken = (
req: Build5Request<OrderTokenRequest>,
): Observable<Transaction | undefined> => this.request(WEN_FUNC.orderToken, req);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface MarketCollectionsFilters {
access?: string[];
space?: string[];
category?: string[];
status?: string[];
};
range?: {
price: string;
Expand Down Expand Up @@ -194,7 +195,9 @@ export class FilterStorageService {
public marketNftsResetVisible$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public marketNftsFilters$: BehaviorSubject<MarketNftsFilters> =
new BehaviorSubject<MarketNftsFilters>({
sortBy: this.marketNftsFiltersOptions.sortItems[0].value,
sortBy:
this.marketNftsFiltersOptions.sortItems.find((item) => item.value === 'nft_price_asc')
?.value || 'nft_availableFrom_asc',
});

public marketCollectionsFiltersOptions = {
Expand Down
9 changes: 8 additions & 1 deletion src/app/@core/services/router/router.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Injectable } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { NavigationEnd, Router, Event } from '@angular/router';
import { ROUTER_UTILS } from '@core/utils/router.utils';
import { BehaviorSubject } from 'rxjs';
import { DeviceService } from '../device';
import { filter } from 'rxjs/operators';

@Injectable({
providedIn: 'root',
Expand All @@ -21,6 +22,12 @@ export class RouterService {
public urlToNewToken = '/' + ROUTER_UTILS.config.token.root + '/new';

constructor(private router: Router, private deviceService: DeviceService) {
// this.router.events.pipe(
// filter((event: Event): event is NavigationEnd => event instanceof NavigationEnd)
// ).subscribe((event: NavigationEnd) => {
// console.log('Navigation Event:', event);
// });

this.updateVariables();

this.router.events.subscribe((obj) => {
Expand Down
19 changes: 19 additions & 0 deletions src/app/@core/utils/local-storage.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export enum StorageItem {
SelectedTradePriceOption = 'App/selectedTradePriceOption',
DepositNftTransaction = 'App/depositNftTransaction-',
StakeNftTransaction = 'App/stakeNftTransaction-',
CartItems = 'App/cartItems',
}

interface CheckoutTransactionData {
transactionId: string | null;
source: 'nftCheckout' | 'cartCheckout' | 'bulkNftCheckout' | null;
}

export const getBitItemItem = (nftId: string): unknown | null => {
Expand Down Expand Up @@ -134,3 +140,16 @@ export const setItem = (itemName: StorageItem, value: unknown): void => {
export const removeItem = (itemName: StorageItem): void => {
localStorage.removeItem(itemName);
};

export const getCheckoutTransaction = (): CheckoutTransactionData | null => {
const item = localStorage.getItem(StorageItem.CheckoutTransaction);
return item ? JSON.parse(item) : { transactionId: null, source: null };
};

export const setCheckoutTransaction = (value: CheckoutTransactionData): void => {
if (value.transactionId === null && value.source === null) {
localStorage.removeItem(StorageItem.CheckoutTransaction);
} else {
localStorage.setItem(StorageItem.CheckoutTransaction, JSON.stringify(value));
}
};
41 changes: 41 additions & 0 deletions src/app/@shell/ui/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[getNotificationDetails]="getNotificationDetails"
(wenOnVisibleChange)="isMobileMenuVisible = !isMobileMenuVisible"
(wenOnNotificationVisibleChange)="notificationVisibleChange()"
[cartItemCount]="cartItemCount"
>
</wen-mobile-header>

Expand All @@ -43,6 +44,24 @@
</button>
</nz-badge>

<button
nz-button
nzType="default"
nzShape="circle"
class="relative inline-flex items-center justify-center border-0 wen-header-button ml-0 mr-2"
(click)="handleOpenCartModal()"
>
<nz-badge *ngIf="cartItemCount > 0" [nzCount]="cartItemCount">
<wen-icon-cart
class="text-foregrounds-primary dark:text-foregrounds-primary-dark"
></wen-icon-cart>
</nz-badge>
<wen-icon-cart
*ngIf="cartItemCount === 0"
class="text-foregrounds-primary dark:text-foregrounds-primary-dark"
></wen-icon-cart>
</button>

<button
nz-button
nzShape="circle"
Expand All @@ -53,6 +72,7 @@
<wen-icon-menu></wen-icon-menu>
</button>
</div>

<wen-mobile-menu
[enableCreateAwardProposal]="enableCreateAwardProposal"
[isVisible]="isMobileMenuVisible"
Expand Down Expand Up @@ -163,6 +183,24 @@
</button>
</nz-badge>

<button
nz-button
nzType="default"
nzShape="circle"
class="relative inline-flex items-center justify-center border-0 wen-header-button ml-0 mr-1"
(click)="handleOpenCartModal()"
>
<nz-badge *ngIf="cartItemCount > 0" [nzCount]="cartItemCount">
<wen-icon-cart
class="text-foregrounds-primary dark:text-foregrounds-primary-dark"
></wen-icon-cart>
</nz-badge>
<wen-icon-cart
*ngIf="cartItemCount === 0"
class="text-foregrounds-primary dark:text-foregrounds-primary-dark"
></wen-icon-cart>
</button>

<button
nz-button
nz-dropdown
Expand Down Expand Up @@ -245,12 +283,15 @@
</header>

<wen-sign-in-modal></wen-sign-in-modal>
<wen-app-cart-modal (openCartModal)="handleOpenCartModal()"></wen-app-cart-modal>
<!-- <wen-app-checkout-overlay *ngIf="cartService.checkoutOverlayOpen$ | async" (openCartCheckoutOverlay)="handleOpenCartCheckoutModal()"></wen-app-checkout-overlay> -->

<wen-nft-checkout
*ngIf="isCheckoutOpen"
[isOpen]="isCheckoutOpen"
[nft]="currentCheckoutNft"
[collection]="currentCheckoutCollection"
[nftQuantity]="nftQty ?? 1"
(wenOnClose)="closeCheckout()"
></wen-nft-checkout>

Expand Down
Loading

0 comments on commit 2632b74

Please sign in to comment.