Skip to content

Commit

Permalink
Merge pull request #17 from Apillon/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MoMannn authored Feb 16, 2024
2 parents c7a852f + 7663c66 commit 242ddf6
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 50 deletions.
26 changes: 13 additions & 13 deletions backend/src/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Cron {

let availableNftLeft = 0;
if (env.MAX_SUPPLY) {
const res = await mysql.db.execute(
const res = await mysql.paramExecute(
`SELECT COUNT(id) as total FROM user WHERE
airdrop_status IN (
${AirdropStatus.EMAIL_SENT},
Expand All @@ -51,7 +51,7 @@ export class Cron {
;
`
);
const numOfReservations = res[0][0].total;
const numOfReservations = res[0].total;
availableNftLeft = env.MAX_SUPPLY - numOfReservations;
}

Expand All @@ -78,13 +78,14 @@ export class Cron {
const token = await generateEmailAirdropToken(users[i].email);
await SmtpSendTemplate(
[users[i].email],
'Claim your NFT',
'Claim your MENT token',
'en-airdrop-claim',
{
appUrl: env.APP_URL,
link: `${env.APP_URL}/claim?token=${token}`,
claimExpiresIn: env.CLAIM_EXPIRES_IN,
}
},
'MENT',
);
updates.push(
`(${users[i].id}, '${users[i].email}', ${
Expand All @@ -95,11 +96,12 @@ export class Cron {
//Currently, waiting line for airdrop is full.Send info email and set appropriate status
await SmtpSendTemplate(
[users[i].email],
'You are in waiting line for NFT claim',
'You have been placed on a waitlist for MENT token',
'en-airdrop-waiting-line',
{
appUrl: env.APP_URL,
}
},
'MENT'
);
updates.push(
`(${users[i].id}, '${users[i].email}', ${
Expand Down Expand Up @@ -171,20 +173,18 @@ export class Cron {
);

//Get users in waiting line and set their airdrop status to PENDING, so that they will recieve email for claim
const usersInWaitingLine = (
await mysql.paramExecute(
`SELECT * FROM user WHERE
const usersInWaitingLine = await mysql.paramExecute(
`SELECT * FROM user WHERE
airdrop_status = ${AirdropStatus.IN_WAITING_LINE}
AND status = ${SqlModelStatus.ACTIVE}
ORDER BY createTime ASC
LIMIT ${usersWithExpiredClaim.length}
FOR UPDATE
;
`,
null,
conn
)
)[0] as Array<any>;
null,
conn
);

console.info(
'Num of users in waiting line: ' + usersInWaitingLine.length
Expand Down
6 changes: 3 additions & 3 deletions backend/src/templates/mail/en-airdrop-claim.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
font-size: 16px;
font-weight: 700;
font-family: 'IBM Plex Mono','arial','helvetica neue','helvetica','sans-serif';
color: #141721;
color: #000000;
text-decoration: none;
width: auto;
text-align: center;
Expand Down Expand Up @@ -124,14 +124,14 @@ <h1>Congrats!</h1>
<ul>
<li><p>MetaMask (<a href="https://support.metamask.io/hc/en-us/articles/360015489531-Getting-started-with-MetaMask">tutorials</a>)</p></li>
<li><p>Coinbase Wallet (<a href="https://www.coinbase.com/en-gb/wallet/tutorials">tutorials</a>)</p></li>
<li><p>WalletConnect (<a href="https://www.youtube.com/watch?v=63eiQD7AUwY">tutorials</a>)</p></li>
<li><p>WalletConnect (<a href="https://www.youtube.com/watch?v=63eiQD7AUwY">tutorial</a>)</p></li>
</ul>
</li>
<li><p>Proceed to <strong>the NFT platform</strong> (through the button below). The instructions will follow as you go.</p></li>
<li><p>Successfully connect your wallet and <strong>claim your MENT token.</strong></p></li>
<li><p>Own, admire and brag about your newly acquired collectibles.</p></li>
</ol>
<p>
<p align="center">
<a href="{{link}}" class="button">Claim MENT token</a>
</p>
<br /><br />
Expand Down
1 change: 1 addition & 0 deletions frontend/assets/styles/_transitions.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
&:hover {
animation-name: bounceIn;
animation-duration: 50s;
border: 1px solid #000;
}
&.locked {
animation-duration: 0s;
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/parts/ConnectWallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:loading="loading || isLoading"
@click="disconnectWallet()"
>
Disconnect
<span class="text-black">Disconnect</span>
</Btn>
<Btn
v-else-if="isConnected"
Expand All @@ -21,7 +21,7 @@
:loading="loading || isLoading"
@click="login()"
>
Login
<span class="text-black">Login</span>
</Btn>
<Btn
v-else
Expand All @@ -32,7 +32,7 @@
:loading="loading || isLoading"
@click="modalWalletVisible = true"
>
Connect your wallet
<span class="text-black">Connect your wallet</span>
</Btn>
</div>

Expand Down
3 changes: 1 addition & 2 deletions frontend/components/parts/form/SighUp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@ function onCaptchaVerify(token: string) {
<Btn
type="primary"
size="large"
class="text-black"
:color="colors.blue"
:loading="loading"
:disabled="!formData.email || !formData.token || !formData.termsAndConditions"
@click="handleSubmit"
>
Sign up
<span class="text-black">Sign up</span>
</Btn>
</n-form-item>

Expand Down
4 changes: 3 additions & 1 deletion frontend/components/parts/form/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@
<Btn
class="flex-auto"
type="primary"
:color="colors.blue"
:disabled="!uploadedFile || !hasRequiredColumns || !fileData || fileData.length === 0"
@click="$emit('proceed', fileData)"
>
Start New Airdrop
<span class="text-black">Start New Airdrop</span>
</Btn>
</div>
</template>

<script lang="ts" setup>
import type { UploadCustomRequestOptions } from 'naive-ui';
import type { FileInfo } from 'naive-ui/es/upload/src/interface';
import colors from '~/tailwind.colors';
defineEmits(['close', 'proceed']);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/parts/form/Wallet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { connect, connectors, pendingConnector } = useConnect();
>
<span class="inline-flex gap-2 items-center">
<NuxtIcon :name="connector.id" class="text-xl" filled />
<span class=" text-black">{{ connector.name }}</span>
<span class="text-black">{{ connector.name }}</span>
</span>
</Btn>
</n-space>
Expand Down
36 changes: 18 additions & 18 deletions frontend/lib/config/naive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ export const NaiveTheme: GlobalThemeOverrides = {
colorLoading: colors.white,
colorSuccess: colors.white,
colorWarning: colors.white,
contentTextColor: colors.bg.DEFAULT,
contentTextColorError: colors.bg.DEFAULT,
contentTextColorInfo: colors.bg.DEFAULT,
contentTextColorSuccess: colors.bg.DEFAULT,
contentTextColorWarning: colors.bg.DEFAULT,
textColor: colors.bg.DEFAULT,
textColorError: colors.bg.DEFAULT,
textColorInfo: colors.bg.DEFAULT,
textColorLoading: colors.bg.DEFAULT,
textColorSuccess: colors.bg.DEFAULT,
textColorWarning: colors.bg.DEFAULT,
titleTextColor: colors.bg.DEFAULT,
titleTextColorError: colors.bg.DEFAULT,
titleTextColorInfo: colors.bg.DEFAULT,
titleTextColorSuccess: colors.bg.DEFAULT,
titleTextColorWarning: colors.bg.DEFAULT,
contentTextColor: colors.konference,
contentTextColorError: colors.konference,
contentTextColorInfo: colors.konference,
contentTextColorSuccess: colors.konference,
contentTextColorWarning: colors.konference,
textColor: colors.konference,
textColorError: colors.konference,
textColorInfo: colors.konference,
textColorLoading: colors.konference,
textColorSuccess: colors.konference,
textColorWarning: colors.konference,
titleTextColor: colors.konference,
titleTextColorError: colors.konference,
titleTextColorInfo: colors.konference,
titleTextColorSuccess: colors.konference,
titleTextColorWarning: colors.konference,
titleFontWeight: '700',
},
Button: {
Expand Down Expand Up @@ -164,11 +164,11 @@ export const NaiveTheme: GlobalThemeOverrides = {
borderColor: colors.bg.lighter,
tdColor: colors.bg.DEFAULT,
tdColorHover: colors.bg.dark,
tdTextColor: colors.white,
tdTextColor: colors.black,
thColor: colors.bg.DEFAULT,
thColorHover: colors.bg.DEFAULT,
thFontWeight: '700',
thTextColor: colors.white,
thTextColor: colors.black,
},
Dialog: {
border: `1px solid ${colors.bg.lighter}`,
Expand Down
10 changes: 6 additions & 4 deletions frontend/pages/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ definePageMeta({
layout: 'admin',
});
useHead({
title: 'Apillon email airdrop prebuilt solution',
title: 'MENT token airdrop',
});
const message = useMessage();
Expand Down Expand Up @@ -178,9 +178,11 @@ function checkUnfinishedRecipients() {

<n-space class="w-full my-8" size="large" align="center" justify="space-between">
<n-space size="large">
<Btn type="primary" class="text-black" @click="getUsers()"> Refresh </Btn>
<Btn type="primary" class="text-black" @click="getUsers()">
<span class="text-black">Refresh</span>
</Btn>
<Btn :color="colors.blue" class="text-black" @click="modalUploadCsvVisible = true">
Upload CSV
<span class="text-black">Upload CSV</span>
</Btn>
<Btn type="secondary" @click="addRecipient">
<span class="text-black">Add recipient</span>
Expand All @@ -194,7 +196,7 @@ function checkUnfinishedRecipients() {
:disabled="!data || data.length === 0"
@click="saveRecipients()"
>
Save recipients
<span class="text-black">Save recipients</span>
</Btn>
</div>
</n-space>
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/claim.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ definePageMeta({
layout: 'claim',
});
useHead({
title: 'MENT NFT airdrop',
title: 'MENT token airdrop',
});
const { query } = useRoute();
Expand Down Expand Up @@ -122,7 +122,7 @@ async function loadNft(contract: Address, id: number, transactionHash: string) {
:loading="loading"
@click="claimAirdrop()"
>
Claim your MENT token
<span class="text-black">Claim your MENT token</span>
</Btn>
</div>
</template>
2 changes: 1 addition & 1 deletion frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import SuperRareJpg from '~/assets/images/superrare.jpg';
useHead({
title: 'MENT NFT airdrop',
title: 'MENT token airdrop',
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { prepareOG } from '~/lib/utils/helpers';
import { Chains } from '~/lib/values/general.values';
useHead({
title: 'PINK PASS',
title: 'MENT token airdrop',
});
const router = useRouter();
Expand Down
6 changes: 5 additions & 1 deletion frontend/pages/success.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
</div>
</template>

<script setup lang="ts"></script>
<script setup lang="ts">
useHead({
title: 'MENT token airdrop',
});
</script>

0 comments on commit 242ddf6

Please sign in to comment.