diff --git a/src/app/auth/components/authentication/authentication.component.ts b/src/app/auth/components/authentication/authentication.component.ts index ec8b4c501..c8f5abe68 100755 --- a/src/app/auth/components/authentication/authentication.component.ts +++ b/src/app/auth/components/authentication/authentication.component.ts @@ -440,7 +440,7 @@ getCookie(key: string){ return this.walletFacade.getUserWallet().pipe( map((myWallet: IResponseWallet) => { if (myWallet.data.totalBalance) - { this.tokenStorageService.setItem('wallet_version', 'v2'); + { //this.tokenStorageService.setItem('wallet_version', 'v2'); } // Return the object after logging myWallet @@ -780,7 +780,7 @@ getCookie(key: string){ return this.walletFacade.getUserWallet().pipe( map((myWallet: IResponseWallet) => { if (myWallet.data.totalBalance) - { this.tokenStorageService.setItem('wallet_version', 'v2'); + { //this.tokenStorageService.setItem('wallet_version', 'v2'); } // Return the object after logging myWallet @@ -796,7 +796,7 @@ getCookie(key: string){ return this.walletFacade.getUserWallet().pipe( map((myWallet: IResponseWallet) => { if (myWallet.data.totalBalance) - { this.tokenStorageService.setItem('wallet_version', 'v2'); + { //this.tokenStorageService.setItem('wallet_version', 'v2'); } // Return the object after logging myWallet diff --git a/src/app/campaigns/campaign-details/campaign-details-routing.module.ts b/src/app/campaigns/campaign-details/campaign-details-routing.module.ts index 3131043ef..a4ca6a9f8 100755 --- a/src/app/campaigns/campaign-details/campaign-details-routing.module.ts +++ b/src/app/campaigns/campaign-details/campaign-details-routing.module.ts @@ -8,7 +8,7 @@ import { CampaignDetailsContainerComponent } from './components/campaign-details import { PublicPagesGuard } from '@core/services/public-pages.guard'; const routes: Routes = [ - { + /*{ path: '', component: CampaignDetailsContainerComponent, children: [ @@ -18,16 +18,14 @@ const routes: Routes = [ }, { path: 'verify-link', - component: VerifyLinkComponent, - canActivate: [AuthGuardService] + component: VerifyLinkComponent }, { path: 'recover-my-gains', - component: RecoverGainsComponent, - canActivate: [AuthGuardService] + component: RecoverGainsComponent } ] - } + }*/ ]; @NgModule({ diff --git a/src/app/campaigns/campaign-details/components/campaign-detail/campaign-detail.component.html b/src/app/campaigns/campaign-details/components/campaign-detail/campaign-detail.component.html index 2356e6a09..0cdd73afe 100755 --- a/src/app/campaigns/campaign-details/components/campaign-detail/campaign-detail.component.html +++ b/src/app/campaigns/campaign-details/components/campaign-detail/campaign-detail.component.html @@ -1,3 +1,8 @@ + + + + +
- - - + + + + + + + + + + + + + + +
diff --git a/src/app/campaigns/campaign-details/components/campaign-details-container/campaign-details-container.component.ts b/src/app/campaigns/campaign-details/components/campaign-details-container/campaign-details-container.component.ts index db262b72e..627f53ea6 100755 --- a/src/app/campaigns/campaign-details/components/campaign-details-container/campaign-details-container.component.ts +++ b/src/app/campaigns/campaign-details/components/campaign-details-container/campaign-details-container.component.ts @@ -27,6 +27,7 @@ export class CampaignDetailsContainerComponent implements OnInit { private isDestroyed = new Subject(); constructor( + private campaignsStoreService: CampaignsStoreService, private route: ActivatedRoute, private meta: Meta, @@ -54,7 +55,7 @@ export class CampaignDetailsContainerComponent implements OnInit { ) .subscribe(); this.campaign$ = this.campaignsStoreService.campaign$; - if (isPlatformServer(this.platformId)) { + /*if (isPlatformServer(this.platformId)) { this.meta.addTag({ name: 'og:image:secure_url', content: `` @@ -138,7 +139,7 @@ export class CampaignDetailsContainerComponent implements OnInit { name: 'twitter:image', content: 'https://safeimagekit.com/picture.png' }); - } + }*/ this.campaign$.pipe(takeUntil(this.isDestroyed)).subscribe((campaign) => { this.campaign = campaign; @@ -146,15 +147,17 @@ export class CampaignDetailsContainerComponent implements OnInit { setTimeout(() => { this.showmoonboy = campaign.id === this.campaignId; }, 1000); - this.ogImageUrl = campaign.coverSrcMobile.includes('ipfs') ? ipfsURL + campaign.coverSrcMobile.substring(27, campaign.coverSrcMobile.length) : campaign.coverSrcMobile; - + /*this.ogImageUrl = campaign.coverSrcMobile.includes('ipfs') ? ipfsURL + campaign.coverSrcMobile.substring(27, campaign.coverSrcMobile.length) : campaign.coverSrcMobile; + this.meta.updateTag({ property: 'og:title', content: campaign.title }); + this.meta.updateTag({ property: 'og:description', content: campaign.description }); + this.meta.updateTag({ property: 'og:image', content: this.ogImageUrl });*/ - this.meta.updateTag( + /*this.meta.updateTag( { - itemprop: 'image', + property: 'og:image', content: this.ogImageUrl }, - `itemprop='image'` + ); this.meta.updateTag( @@ -279,14 +282,16 @@ export class CampaignDetailsContainerComponent implements OnInit { content: this.ogImageUrl }, `name='twitter'` - ); + );*/ }); } imageImported(image: any) { this.campaignsStoreService.updateOneById({ cover: image }); } - + limitDescription(description: string | undefined, maxLength: number = 200): string { + return description ? description.slice(0, maxLength) : ''; + } ngOnDestroy(): void { this.isDestroyed.next(''); this.isDestroyed.unsubscribe(); diff --git a/src/app/campaigns/campaigns-routing.module.ts b/src/app/campaigns/campaigns-routing.module.ts index 662898c42..d5b54a586 100755 --- a/src/app/campaigns/campaigns-routing.module.ts +++ b/src/app/campaigns/campaigns-routing.module.ts @@ -12,6 +12,9 @@ import { TransactionMessageStatusComponent } from '@app/campaigns/components/tra import { CanLoadPublicModule } from '@core/services/public-pages-module.guard'; import { WelcomePageGuardService } from '@core/services/welcome-page-guard.service'; import { SocialsComponent } from './socials/socials.component'; +import { CampaignDetailComponent } from './campaign-details/components/campaign-detail/campaign-detail.component'; +import { RecoverGainsComponent } from './components/recover-gains/recover-gains.component'; +import { VerifyLinkComponent } from './components/verify-link/verify-link.component'; const routes: Routes = [ { @@ -35,12 +38,27 @@ const routes: Routes = [ ] }, { + path:'campaign/:id', + component: CampaignDetailComponent + }, + { + path: 'campaign/:id/verify-link', + component: VerifyLinkComponent, + canActivate: [AuthGuardService] + }, + { + path: 'campaign/:id/recover-my-gains', + component: RecoverGainsComponent, + canActivate: [AuthGuardService] + }, + /*{ path: 'campaign/:id', loadChildren: () => import('./campaign-details/campaign-details.module').then( (m) => m.CampaignDetailsModule ), - }, + canLoad: [CanLoadPublicModule] + },*/ { path: 'welcome', component: FarmWelcomeComponent diff --git a/src/app/campaigns/campaigns.module.ts b/src/app/campaigns/campaigns.module.ts index ceba3a0c7..8d5673b5e 100755 --- a/src/app/campaigns/campaigns.module.ts +++ b/src/app/campaigns/campaigns.module.ts @@ -40,6 +40,7 @@ import { cryptoReducerList } from '@app/core/store/crypto-prices/reducer/crypto. import { CryptoEffectsList } from '@app/core/store/crypto-prices/effects/crypto.effects'; +import { CampaignDetailsModule } from './campaign-details/campaign-details.module'; @NgModule({ declarations: [ @@ -69,6 +70,7 @@ import { CryptoEffectsList } from '@app/core/store/crypto-prices/effects/crypto. CommonModule, CampaignsRoutingModule, CampaignsSharedUiModule, + CampaignDetailsModule, NgxTweetModule, EffectsModule.forFeature([LinksListEffects]), StoreModule.forFeature( diff --git a/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.html b/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.html index fca651a55..cd9db015f 100755 --- a/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.html +++ b/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.html @@ -36,7 +36,7 @@
{{ 'Wallet_updated_Warning' | translate }}
-
+
diff --git a/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.scss b/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.scss index 9b752cdc3..f3ef90ab1 100755 --- a/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.scss +++ b/src/app/campaigns/components/campaigns-dashboard/campaigns-dashboard.component.scss @@ -183,10 +183,11 @@ } .bloc-cover { margin-top: 43vh; - margin-left: 20%; + margin-left: 5%; } .title-cover { - left: 5%; + // width: 14em; + // left: 5%; font-weight: 700; font-size: 28px; line-height: 120%; @@ -199,8 +200,13 @@ line-height: 130%; padding-right: 10%; } + .button_container{ + width: fit-content; + margin: auto; + } .button-cover { - margin-top: 2.5% !important; + margin: auto; + margin-top: 1% !important; } @media only screen { diff --git a/src/app/campaigns/components/farm-post-card/farm-post-card.component.html b/src/app/campaigns/components/farm-post-card/farm-post-card.component.html index f4d431f99..c001743a4 100755 --- a/src/app/campaigns/components/farm-post-card/farm-post-card.component.html +++ b/src/app/campaigns/components/farm-post-card/farm-post-card.component.html @@ -636,13 +636,13 @@ {{ 'wait_harvest' | translate }} - {{ harvestAvailableIn }} + {{ this.prom.campaign.remuneration === 'publication' ? countHarvestDownTimerForPublication(): harvestAvailableIn }} diff --git a/src/app/campaigns/components/farm-post-card/farm-post-card.component.ts b/src/app/campaigns/components/farm-post-card/farm-post-card.component.ts index 37ea1229e..63e0c3d63 100755 --- a/src/app/campaigns/components/farm-post-card/farm-post-card.component.ts +++ b/src/app/campaigns/components/farm-post-card/farm-post-card.component.ts @@ -82,6 +82,25 @@ export class FarmPostCardComponent implements OnInit { [atLastOneChecked(), requiredDescription()] ); } + countHarvestDownTimerForPublication() { + // Provided end date in UNIX timestamp format (e.g., 1698192000) + const endDateTimestamp = this.prom.campaign.endDate * 1000; // Convert to milliseconds + + // Current date + const currentDate = Date.now(); + + // Calculate the time difference in milliseconds + const timeDifference = endDateTimestamp - currentDate; + + // Calculate days, hours, and minutes + const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); + const hours = Math.floor((timeDifference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60)); + if(days === 0 && hours === 0 && minutes === 0) { + this.harvestAvailable = false; + } else this.harvestAvailable = true; + return `${days}d ${hours}h ${minutes}min`; + } private countDownTimer(): void { const timestampAcceptedDate: number = this.prom.acceptedDate * 1000; @@ -142,11 +161,12 @@ export class FarmPostCardComponent implements OnInit { ) .subscribe((prom: any) => { this.prom = new Participation(prom); - + this.countHarvestDownTimerForPublication(); }); let currencyName = this.prom.campaign.currency; this.intervalId = setInterval(() => { this.countDownTimer(); + }, 1000); if (currencyName === 'SATTBEP20') currencyName = 'SATT'; diff --git a/src/app/campaigns/components/participer/participer.component.css b/src/app/campaigns/components/participer/participer.component.css index f06943441..2df737b7c 100755 --- a/src/app/campaigns/components/participer/participer.component.css +++ b/src/app/campaigns/components/participer/participer.component.css @@ -6,6 +6,12 @@ } +.error-message-limit-participation { + text-align: center; + color: red; + margin-top: 3%; +} + .input-amount { -webkit-appearance: none; appearance: none; diff --git a/src/app/campaigns/components/participer/participer.component.html b/src/app/campaigns/components/participer/participer.component.html index 7816f96af..09e640800 100755 --- a/src/app/campaigns/components/participer/participer.component.html +++ b/src/app/campaigns/components/participer/participer.component.html @@ -563,7 +563,9 @@

{{ 'monetize_your_post' | translate }}

- +
+

{{ 'error_limit_participation' | translate }}

+
-
+
diff --git a/src/app/core/services/Auth/auth-store.service.ts b/src/app/core/services/Auth/auth-store.service.ts index 3c204d4a7..c00dac6b8 100755 --- a/src/app/core/services/Auth/auth-store.service.ts +++ b/src/app/core/services/Auth/auth-store.service.ts @@ -4,6 +4,7 @@ import { AuthService } from '@core/services/Auth/auth.service'; import { filter, tap } from 'rxjs/operators'; import { TokenStorageService } from '../tokenStorage/token-storage-service.service'; import { CryptofetchServiceService } from '../wallet/cryptofetch-service.service'; +import { WalletFacadeService } from '@app/core/facades/wallet-facade.service'; @Injectable({ providedIn: 'root' @@ -12,7 +13,8 @@ export class AuthStoreService { constructor( private auth: AuthService, private tokenStorageService: TokenStorageService, - private cryptofetchServiceService: CryptofetchServiceService + private cryptofetchServiceService: CryptofetchServiceService, + private walletFacade: WalletFacadeService, ) {} private _account: BehaviorSubject = new BehaviorSubject(null); @@ -27,31 +29,56 @@ export class AuthStoreService { public setAccount(account: any) { this._account.next(account); } - - async fetchBalance() { - try { - const balance: any = await this.cryptofetchServiceService - .getTotalBalanceV2() - .toPromise(); - const balanceV2 = balance.data.Total_balance; - return balanceV2; - } catch (error) { - console.error('Error fetching balance:', error); - } - } + /*async getWalletAddress() { + this.walletFacade + .getAllWallet() + .subscribe((data: any) => { + if(data.message === "success") { + if (this.tokenStorageService.getWalletVersion() === 'v2') { + this.tokenStorageService.saveIdWallet(data.data.addressV2); + this.tokenStorageService.saveTronWallet(data.data.tronAddressV2); + this.tokenStorageService.saveWalletBtc(data.data.btcAddressV2); + } else { + this.tokenStorageService.saveIdWallet(data.data.address); + this.tokenStorageService.saveTronWallet(data.data.tronAddress); + this.tokenStorageService.saveWalletBtc(data.data.btcAddress); + + + } + + } + }, (err:any) => { + console.error(err) + }); + }*/ + public getAccount() { return this.auth.verifyAccount().pipe( - tap(async (res) => { - const fetchedBalance = await this.fetchBalance(); - - const walletVersion = fetchedBalance === 0.0 - ? 'v1' - : 'v2'; - - this.tokenStorageService.setItem('wallet_version', walletVersion); - - this.setAccount(res); + tap( (response) => { + console.log({response}) + const hasWalletV2 = response.data.hasWalletV2 || false + if(!!response.data.migrated && response.data.migrated) this.tokenStorageService.setItem('wallet_version', 'v2'); + else { + this.walletFacade.checkUserIsNew().subscribe((res:any) => { + if(res.data) this.tokenStorageService.setItem('wallet_version', 'v2'); + else this.tokenStorageService.setItem('wallet_version', 'v1'); + }, (err) => { + hasWalletV2 ? this.tokenStorageService.setItem('wallet_version', 'v2') : this.tokenStorageService.setItem('wallet_version', 'v1'); + }) + + + + /*this.cryptofetchServiceService.getTotalBalance().subscribe((res:any) => { + const balance = parseFloat(res.data.Total_balance) + + if(balance > 0) this.tokenStorageService.setItem('wallet_version', 'v1') + else hasWalletV2 ? this.tokenStorageService.setItem('wallet_version', 'v2') : this.tokenStorageService.setItem('wallet_version', 'v1') + });*/ + + } + + this.setAccount(response); }) ); } diff --git a/src/app/notifications/notification.component.css b/src/app/notifications/notification.component.css index 4a5810f1d..040eaea9b 100755 --- a/src/app/notifications/notification.component.css +++ b/src/app/notifications/notification.component.css @@ -349,7 +349,7 @@ input[type='search']::-webkit-search-cancel-button { .cmp-img2{ object-fit: cover; - width: 686px; + width: 100%; /* margin: 20px; */ height: 242px; border-top-left-radius: 30px 30px; @@ -614,6 +614,15 @@ input[type='date']::-webkit-calendar-picker-indicator { margin-top: auto; } +.pic_avatar_notif_social { + bottom: 0.5em; + position: relative; + height: 3em; + + width: 3em; + margin-top: auto; +} + .container_perso { width: auto; margin: auto; @@ -645,12 +654,12 @@ input[type='date']::-webkit-calendar-picker-indicator { } - .cmp-img2.link{ + /*.cmp-img2.link{ width: 97.5vw !important; } .cmp-img2.camp{ width: 96vw !important; - } + }*/ .search-results{ margin-top: 10px !important; } @@ -658,11 +667,11 @@ input[type='date']::-webkit-calendar-picker-indicator { margin-top: -0.6em !important; } - .cmp-img2{ + /*.cmp-img2{ width: 97vw !important; - } + }*/ .container_perso { width: 84% !important; diff --git a/src/app/notifications/notification.component.html b/src/app/notifications/notification.component.html index f024fb7bc..e369edb55 100755 --- a/src/app/notifications/notification.component.html +++ b/src/app/notifications/notification.component.html @@ -231,7 +231,7 @@ avtar @@ -240,7 +240,7 @@ avtar @@ -260,7 +260,7 @@ : getLinkIconValidate(i.label.link.oracle) " alt="avtar" - class="pic_avatar_notif" + class="pic_avatar_notif_social" /> diff --git a/src/app/notifications/notification.component.ts b/src/app/notifications/notification.component.ts index 36a5c7794..530ee138d 100755 --- a/src/app/notifications/notification.component.ts +++ b/src/app/notifications/notification.component.ts @@ -983,16 +983,16 @@ closeModal(content: any) { // Construct the result string let result = ''; if (years > 0) { - result += `${years} y`; + result += `${years}y `; } if (months > 0) { - result += `${months} m`; + result += `${months}m `; } if (days > 0) { - result += `${days} d`; + result += `${days}d `; } if (remainingHours > 0) { - result += `${remainingHours} h`; + result += `${remainingHours}h`; } return result.trim(); @@ -1043,7 +1043,8 @@ closeModal(content: any) { return token.name.startsWith('SATT') ? 'SaTT' : token.name } getStatistics(hash:string) { - this.campaignService.getStatisticsCampaign(hash) + + return this.campaignService.getStatisticsCampaign(hash) .pipe( map((response: any) => { if (response.message === 'success' && response.code === 200) { @@ -1052,16 +1053,8 @@ closeModal(content: any) { } }), - ) - .subscribe((data: any) => { - let sumOfViews = 0; - for (const platform in data) { - if (data.hasOwnProperty(platform)) { - sumOfViews += data[platform].views; - } - } - return sumOfViews; - }); + ); + } getRetrieveBudget(cmp:any) { return parseFloat(cmp.cost) / 10 **18 @@ -1181,7 +1174,13 @@ closeModal(content: any) { } switchFunction(item: any) { if(item.type === 'create_campaign') { - item.label.views = this.getStatistics(item.label.cmp_update.hash) + this.getStatistics(item.label.cmp_update.hash).subscribe((data: any) => { + let sumOfViews = 0; + for (const platform in data) { + sumOfViews += data[platform].views; + } + item.label.views = sumOfViews; + }); } if(item.type === 'cmp_candidate_reject_link') item.label.showReason = false const etherInWei = new Big(1000000000000000000); @@ -1722,6 +1721,7 @@ closeModal(content: any) { if (data.message === 'success') { this.closeModal(modal); this.showLoadingSpinner = false; + window.open(environment.domainName + '/notification','_self') // this.influencerProms = this.influencerProms.pipe( // map((array: any) => diff --git a/src/assets/fonts/Roboto-Regular.woff2 b/src/assets/fonts/Roboto-Regular.woff2 deleted file mode 100755 index 9a0064ec2..000000000 Binary files a/src/assets/fonts/Roboto-Regular.woff2 and /dev/null differ diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index ec55e3296..65e30e07d 100755 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -622,6 +622,7 @@ "create_campaign_form.import_cover_image_mobile": "Add a mobile cover", "create_campaign_form.max_weight": "Max weight", "create_campaign_form.activate_limit_reach": "Activate reach max", + "error_limit_participation": "Sorry, the maximum number of participants for this campaign with this account has been reached", "create_campaign_form.choose_price": "Choose the price of the publication according to the notoriety of your creators", "create_campaign_form.followers_min": "Followers min", "create_campaign_form.followers_max": "Followers max", @@ -875,6 +876,7 @@ "invite_friends_notif": "Invite your friends", "problem_faq": "problem ? Consult the FAQ", "link_already_exist": "This link already exist please try with another one!", + "Limit_participation_reached":"Limit participation reached", "oracle_not_selected_error": "You are posting a link with a social media that is not supported by this campaign, please check your link before applying!", "welcome_title": "Welcome to Post Farming", "more_info": "More info about Ad Pool", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index ea2cc9eaa..d3c7d8a14 100755 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -20,6 +20,7 @@ "remaining_budget_notification":"Votre budget restant est actuellement de", "Aide.L’Open_Source": "L’Open Source", "copieWallet.copier": "Copier", + "Limit_participation_reached":"Limite de participation atteinte", "notification_pools_retireive_now_budget": "Vous pouvez maintenant le récupérer", "notification_pools_retreive_waiting_budget":"Vous pouvez le récupérer dans", "notification_pools_retreive_waiting_budget_days": "Jours", @@ -384,6 +385,7 @@ "insert_link_validation": "Un nouveau lien attend votre approbation pour", "insert_link_reject":"Un nouveau lien a été rejeté pour", "insert_link_accept":"Un nouveau lien a été accepté pour", + "error_limit_participation": "Désolé, le nombre maximal de participants pour cette campagne avec ce compte a été atteint.", "accept_link":"AdPool a été approuvé", "more_reason":"Lire la raison >", "i_understand": "J’ai compris", diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 6b9369354..9b09301a1 100755 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -12,7 +12,7 @@ export const environment = { addresses: { smartContracts: { campaignERC20: '0xf961c85517fe86244cb60889afc4a928068d49ef', - campaignBEP20: '0x72A423c42FFCB9d2d9F65921Ea4Fe42725cC63b4', + campaignBEP20: '0x60c761e810b86fa3876ae065bdee62b8f2e29f86', campaignPOLYGON: '0xa01f80042512Cdf9355a66CBB1266240c0456513', campaignBTT: '0xa01f80042512Cdf9355a66CBB1266240c0456513', campaignTRON: 'TPeLf9WLzUD8tUoc7dtfGVqPUrnKGip2PN', diff --git a/src/index.html b/src/index.html index 6aa1d55b9..10bbc0f06 100755 --- a/src/index.html +++ b/src/index.html @@ -34,12 +34,15 @@ name="viewport" content="width=device-width,initial-scale=1,maximum-scale=6,user-scalable=0" /> - + --> + @@ -77,12 +80,7 @@ href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" /> - - +