Skip to content
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

Another/add campaigns services #16

Merged
merged 9 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/assets/data/contracts/alfajores.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@
"WeightedPool2TokensFactory": "",
"WeightedPoolFactory": "0x997252b17F61fFc6Ca2fDDd7fa1Cb0cdb98f202D",
"YearnLinearPoolFactory": "",
"Multicall": "0xca11bde05977b3631167028862be2a173976ca11"
"Multicall": "0xca11bde05977b3631167028862be2a173976ca11",
"SimpleMinter": "0xEc9EC0e51DBfA5aB969d91313C64f7eEF0348272",
"RFNFT": "0x1D2540EFe05f5b53abABb7Be1780B370Bd3407aE",
"RFP": "0x1b5a1fDdd235d9a4c73F061318E017Bb52aCD444"
}
14 changes: 14 additions & 0 deletions src/assets/images/icons/coins/RFP.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/_global/BalTable/TotalsRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getHorizontalStickyClass(index: number) {
:class="[
getHorizontalStickyClass(0),
isColumnStuck ? 'isSticky' : '',
'text-left p-6 bg-white dark:bg-gray-850 border-t dark:border-gray-900 align-top',
'text-center p-6 bg-white dark:bg-gray-850 border-t dark:border-gray-900 align-center',
]"
>
<span class="font-semibold text-left"> Total </span>
Expand Down
146 changes: 125 additions & 21 deletions src/components/contextual/pages/dashboard/Cards/RefiProfileCard.vue
Original file line number Diff line number Diff line change
@@ -1,77 +1,153 @@
<script setup lang="ts">
import NFTImage from '@/assets/images/mocks/NFT.png';
import { useRFNFT } from '@/composables/campaigns/useRFNFT';
import useBreakpoints from '@/composables/useBreakpoints';
import useWeb3 from '@/services/web3/useWeb3';
const { startConnectWithInjectedProvider } = useWeb3();
const { isMobile, bp } = useBreakpoints();

const { NFTData, isLoading, MintNFT } = useRFNFT();
const { isWalletReady } = useWeb3();

function handleMintNFT() {
MintNFT();
Another-DevX marked this conversation as resolved.
Show resolved Hide resolved
}
function handleLevelUp() {
console.debug('Level up');
}

const nftImageSrc = computed(() => NFTData.value?.imageData || NFTImage);

const levels = ref([
{ nextLevel: '100', votes: 1 },
{ nextLevel: '250', votes: 10 },
{ nextLevel: '500', votes: 30 },
{ nextLevel: '1000', votes: 75 },
{ nextLevel: '2000', votes: 150 },
{ nextLevel: 'MAX', votes: 250 },
]);
Another-DevX marked this conversation as resolved.
Show resolved Hide resolved
</script>
<template>
<template v-if="isMobile">
<BalCard v-if="bp === 'xs'">
<div class="flex flex-col gap-5 justify-center items-start px-4 h-fit">
<img :src="NFTImage" class="w-full h-full rounded-md bg-slate-500" />
<img :src="nftImageSrc" class="w-full h-full rounded-md bg-slate-500" />
<div class="flex flex-col gap-10 w-full">
<div class="flex flex-col gap-4">
<h3 class="self-start text-lg">Connect wallet</h3>
<h3 v-if="!isWalletReady" class="self-start text-lg">
Connect wallet
</h3>
<h3 v-else-if="!isLoading" class="self-start text-lg">
{{ NFTData?.name }}
</h3>
<div class="flex justify-between items-center text-base">
<p>Voting Power</p>
<p>- Votes</p>
<p v-if="NFTData">{{ levels[NFTData?.id - 1].votes }} Votes</p>
<p v-else>- Votes</p>
</div>
</div>
<div class="w-full border-t-2" />
<div class="flex flex-col gap-1">
<div class="flex justify-between items-center text-base">
<p>My Points</p>
<p>- RFP</p>
<p class="text-sm">My Points</p>
<p v-if="isLoading" class="text-sm">- RFP</p>
<p v-else class="text-sm">{{ NFTData?.points }} RFP</p>
</div>
<div
class="flex justify-between items-center text-base text-disabled"
>
<p>Next level</p>
<p>- RFP</p>
<p class="text-sm">Next level</p>
<p v-if="NFTData" class="text-sm">
{{ levels[NFTData?.id - 1].nextLevel }} RFP
</p>
<p v-else class="text-sm">- RFP</p>
</div>
</div>
<BalBtn
color="gradient"
v-if="!isWalletReady"
color="gradient-blue-light"
class="self-end w-fit"
size="sm"
@click="startConnectWithInjectedProvider"
>Connect wallet</BalBtn
>
<BalBtn
v-else-if="!NFTData"
color="gradient-blue-light"
class="self-end w-fit"
size="sm"
@click="handleMintNFT"
>Mint NFT</BalBtn
>
<BalBtn
v-else
color="gray"
class="self-end w-fit"
size="sm"
@click="handleLevelUp"
>Level Up</BalBtn
>
Another-DevX marked this conversation as resolved.
Show resolved Hide resolved
</div>
</div>
</BalCard>
<BalCard v-else>
<div class="flex flex-row gap-5 justify-center items-start px-4 h-80">
<img :src="NFTImage" class="w-48 h-full rounded-md bg-slate-500" />
<img :src="nftImageSrc" class="w-48 h-full rounded-md bg-slate-500" />
<div class="flex flex-col gap-10 w-full">
<div class="flex flex-col gap-4">
<h3 class="self-start text-lg">Connect wallet</h3>
<h3 v-if="!isWalletReady" class="self-start text-lg">
Connect wallet
</h3>
<h3 v-else-if="!isLoading" class="self-start text-lg">
{{ NFTData?.name }}
</h3>
<div class="flex justify-between items-center text-base">
<p>Voting Power</p>
<p>- Votes</p>
<p v-if="NFTData">{{ levels[NFTData?.id - 1].votes }} Votes</p>
<p v-else>- Votes</p>
</div>
</div>
<div class="w-full border-t-2" />
<div class="flex flex-col gap-1">
<div class="flex justify-between items-center text-base">
<p>My Points</p>
<p>- RFP</p>
<p class="text-sm">My Points</p>
<p v-if="isLoading" class="text-sm">- RFP</p>
<p v-else class="text-sm">{{ NFTData?.points }} RFP</p>
</div>
<div
class="flex justify-between items-center text-base text-disabled"
>
<p>Next level</p>
<p>- RFP</p>
<p class="text-sm">Next level</p>
<p v-if="NFTData" class="text-sm">
{{ levels[NFTData?.id - 1].nextLevel }} RFP
</p>
<p v-else class="text-sm">- RFP</p>
</div>
</div>
<BalBtn
color="gradient"
v-if="!isWalletReady"
color="gradient-blue-light"
class="self-end w-fit"
size="sm"
@click="startConnectWithInjectedProvider"
>Connect wallet</BalBtn
>
<BalBtn
v-else-if="!NFTData"
color="gradient-blue-light"
class="self-end w-fit"
size="sm"
@click="handleMintNFT"
>Mint NFT</BalBtn
>
<BalBtn
v-else
color="gray"
class="self-end w-fit"
size="sm"
@click="handleLevelUp"
>Level Up</BalBtn
>
</div>
</div>
</BalCard>
Expand All @@ -82,37 +158,65 @@ const { isMobile, bp } = useBreakpoints();
class="flex flex-row gap-8 justify-center items-center h-full h-[265px]"
>
<img
:src="NFTImage"
:src="nftImageSrc"
class="rounded-md h-[224px] w-[168px] bg-slate-500"
/>
<div class="flex flex-col gap-6 w-full">
<div class="flex flex-col gap-4">
<h3 class="self-start text-lg">Connect wallet</h3>
<h3 v-if="!isWalletReady" class="self-start text-lg">
Connect wallet
</h3>
<h3 v-else-if="!isLoading && NFTData" class="self-start text-lg">
{{ NFTData.name }}
</h3>
<h3 v-else class="self-start text-lg">Mint NFT</h3>
<div class="flex justify-between items-center text-base">
<p>Voting Power</p>
<p>- Votes</p>
<p v-if="NFTData">{{ levels[NFTData?.id - 1].votes }} Votes</p>
<p v-else>- Votes</p>
</div>
</div>
<div class="w-full border-t-2" />
<div class="flex flex-col gap-1">
<div class="flex justify-between items-center text-base">
<p class="text-sm">My Points</p>
<p class="text-sm">- RFP</p>
<p v-if="isLoading" class="text-sm">- RFP</p>
<p v-else class="text-sm">{{ NFTData?.points }} RFP</p>
</div>
<div
class="flex justify-between items-center text-base text-disabled"
>
<p class="text-sm">Next level</p>
<p class="text-sm">- RFP</p>
<p v-if="NFTData" class="text-sm">
{{ levels[NFTData?.id - 1].nextLevel }} RFP
</p>
<p v-else class="text-sm">- RFP</p>
</div>
</div>
<BalBtn
v-if="!isWalletReady"
color="gradient-blue-light"
class="self-end w-fit"
size="sm"
@click="startConnectWithInjectedProvider"
>Connect wallet</BalBtn
>
<BalBtn
v-else-if="!NFTData"
color="gradient-blue-light"
class="self-end w-fit"
size="sm"
@click="handleMintNFT"
>Mint NFT</BalBtn
>
<BalBtn
v-else
color="gray"
class="self-end w-fit"
size="sm"
@click="handleLevelUp"
>Level Up</BalBtn
>
</div>
</div>
</div>
Expand Down
Loading