Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
waelhanfi04 committed Sep 28, 2023
2 parents f34883f + aeba509 commit 12fc1ae
Show file tree
Hide file tree
Showing 26 changed files with 230 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<head>
<meta property="og:title" content="{{ 'SaTT TO THE MOON'}}" />
<meta property="og:description" content="{{ 'SaTT TO THE MOON' }}" />
<meta property="og:image" content="{{ 'https://satt-token.com/assets/img/share_img_200px.png'}}" />
</head>
<div *ngIf="!isLoading">
<span id="span-top" class="span-top"></span>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ export class CampaignDetailComponent implements OnInit {
this.CampaignService.stat.next(true);
}


getCampaignCover() {
return this.campaign.coverSrcMobile.includes('ipfs') ? ipfsURL + this.campaign.coverSrcMobile.substring(27, this.campaign.coverSrcMobile.length) : undefined;
}

getRefunds(id:string) {
this.passwordForm = this._formBuilder.group({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@

<head>
<meta property="og:title" content="{{ campaign?.title}}" />
<meta property="og:description" content="{{ campaign?.summary }}" />
<meta property="og:image" content="{{ ogImageUrl }}" />

<head>

<meta property="og:title" content="{{ 'campaign?.title'}}" />
<meta property="og:description" content="{{ 'campaign?.summary' }}" />
<meta property="og:image" content="{{ 'ogImageUrl' }}" />


<!-- <meta property="og:title" content="{{ 'campaign?.title'}}" /> -->
<!-- <meta property="og:description" content="{{ 'campaign?.summary' }}" /> -->
<!-- <meta property="og:image" content="{{ 'ogImageUrl' }}" /> -->

<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
</head>


<ng-container *ngIf="campaign?.id === campaignId; else loading">
<div class="content" style="min-height: 50vh">
<router-outlet></router-outlet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class CampaignDetailsContainerComponent implements OnInit {
private isDestroyed = new Subject();

constructor(

private campaignsStoreService: CampaignsStoreService,
private route: ActivatedRoute,
private meta: Meta,
Expand Down Expand Up @@ -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: ``
Expand Down Expand Up @@ -138,23 +139,25 @@ 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;

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(
Expand Down Expand Up @@ -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();
Expand Down
20 changes: 19 additions & 1 deletion src/app/campaigns/campaigns-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/app/campaigns/campaigns.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -69,6 +70,7 @@ import { CryptoEffectsList } from '@app/core/store/crypto-prices/effects/crypto.
CommonModule,
CampaignsRoutingModule,
CampaignsSharedUiModule,
CampaignDetailsModule,
NgxTweetModule,
EffectsModule.forFeature([LinksListEffects]),
StoreModule.forFeature(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="description-cover">
{{ 'Wallet_updated_Warning' | translate }}
</div>
<div>
<div class="button_container">
<button class="button-cover" routerLink="wallet">{{ 'Wallet_updated_migrate' | translate }}</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,13 +636,13 @@
</span>
<span
class="btn-apply-text text-orange"
*ngIf="harvestAvailable === true"
*ngIf="harvestAvailable === true "
>
<img class="" src="/assets/Images/campagne/hourglass.svg" style="margin-top:-4px;" />
<span> {{ 'wait_harvest' | translate }}</span>


<span> {{ harvestAvailableIn }} </span>
<span> {{ this.prom.campaign.remuneration === 'publication' ? countHarvestDownTimerForPublication(): harvestAvailableIn }} </span>
</span>
</button>
<!-- link indisponible-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

}

.error-message-limit-participation {
text-align: center;
color: red;
margin-top: 3%;
}

.input-amount {
-webkit-appearance: none;
appearance: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ <h3 class="send_title">{{ 'monetize_your_post' | translate }}</h3>
</div>
</div>
</div>

<div *ngIf="errorMessageLimitParticipation === 'Limit participation reached'">
<p class="error-message-limit-participation">{{ 'error_limit_participation' | translate }}</p>
</div>
<div class="row send-block ">
<button
class="send-button "
Expand Down
19 changes: 19 additions & 0 deletions src/app/campaigns/components/participer/participer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export class ParticiperComponent implements OnInit, AfterContentChecked {
gazproblem: boolean = false;
embedTiktokVideo: any;
privacy: string = 'public';
errorMessageLimitParticipation: string = '';
constructor(
private profilService: ProfileService,
private router: Router,
Expand Down Expand Up @@ -1465,6 +1466,7 @@ export class ParticiperComponent implements OnInit, AfterContentChecked {
//}

applyCampaign(): void {
this.errorMessageLimitParticipation = '';
let application = this.application;
if (!application) {
application = {};
Expand Down Expand Up @@ -1526,6 +1528,9 @@ export class ParticiperComponent implements OnInit, AfterContentChecked {
(error) => {
this.loadingButton = false;
this.showButtonSend = true;
if(error.error.code === 401 && error.error.error === "Limit participation reached") {
this.errorMessageLimitParticipation = error.error.error;
}
if (
error.error.code === 402 &&
error.error.error === 'Returned error: already known'
Expand Down Expand Up @@ -1598,6 +1603,15 @@ export class ParticiperComponent implements OnInit, AfterContentChecked {
this.error = 'wallet not found';
this.success = '';
this.loadingButton = false;
} else if (error.error.code === 'Limit participation reached'){
this.error = 'Limit_participation_reached';
this.success = '';
this.loadingButton = false;
this.router.navigate([], {
queryParams: {
errorMessage: 'error'
}
});
}
} else {
this.error = 'error-message';
Expand Down Expand Up @@ -1738,6 +1752,11 @@ export class ParticiperComponent implements OnInit, AfterContentChecked {
this.error = 'Lien_déjà_envoyé';
this.success = '';
this.loadingButton = false;
}
else if (err.error.text === '{error:"Limit participation reached"}') {
this.error = 'Limit_participation_reached';
this.success = '';
this.loadingButton = false;
} else if (err.error.text === '{error:"account not linked"}') {
this.connectValue = 'facebook';
this.errorResponse = 'facebook';
Expand Down
Loading

0 comments on commit 12fc1ae

Please sign in to comment.