Skip to content

Commit

Permalink
Merge pull request #50 from mfactory-lab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MGrgr authored Jan 12, 2024
2 parents 3a9433f + 67a1895 commit 92a5451
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 77 deletions.
4 changes: 2 additions & 2 deletions src/assets/styles/components/_liquidity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
font-family: $font-secondary;

@media(min-width: $breakpoint-md) {
font-size: 23px;
line-height: 28px;
font-size: 16px;
line-height: 20px;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/assets/styles/components/_swap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ $swap-input-focused-color: rgba($secondary, 0.7) !important;
height: 48px;
padding: 0;
background-color: $primary;
font-size: 23px;
font-size: 16px;
text-transform: uppercase;
font-family: $font-secondary;
font-weight: 500;
line-height: 28px;
line-height: 20px;
color: #ffffff;
display: flex;
align-items: center;
Expand Down
29 changes: 22 additions & 7 deletions src/components/CreatePool/CreateSwapCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
import { Keypair, PublicKey } from '@solana/web3.js'
import type { TokenData } from '@/config'
const { state, createTokenSwap, createPoolAccounts, generateSwapKeypair, createPoolMint } = useCreateSwap()
const {
state,
createTokenSwap,
createPoolAccounts,
generateSwapKeypair,
createPoolMint,
metadataState,
} = useCreateSwap()
const { handleSearchToken, tokens } = useToken()
const userStore = useUserStore()
Expand All @@ -16,6 +23,7 @@ function setToken(field: 'tokenA' | 'tokenB', t: TokenData) {
}
const expandedTokenSwap = ref(false)
const expandedPoolMint = ref(false)
const tokenSwapSecret = ref('')
function setTokenSwap() {
if (tokenSwapSecret.value) {
Expand Down Expand Up @@ -61,7 +69,7 @@ function setPoolMint() {
option-value="mint" option-label="name"
>
<template #selected>
<select-policy-item v-if="state.policy" :key="state.policy.pubkey" :policy="state.policy.pubkey" :policy-data="state.policy.data" />
<select-policy-item v-if="state.policy" :key="state.policy.pubkey?.toBase58()" :policy="state.policy.pubkey" :policy-data="state.policy.data" />
</template>
<template #option="scope">
<q-item v-bind="scope.itemProps" class="token-select__token">
Expand Down Expand Up @@ -118,8 +126,15 @@ function setPoolMint() {
</div>
</q-expansion-item>

<div class="q-mt-xl row">
<q-btn class="q-ml-auto" :disable="!!state.poolMint" @click="createPoolMint">
<div class="q-mt-xl column">
<div>LP token metadata</div>
<q-input v-model="metadataState.name" class="q-mr-md" label="name" />
<q-input v-model="metadataState.symbol" class="q-mr-md" label="symbol" />
<q-input v-model="metadataState.metadataUrl" class="q-mr-md" label="url" />
<q-toggle v-model="metadataState.isMutable" class="q-mr-md q-mt-sm" size="lg" label="is Mutable" />
</div>
<div class="q-mt-xs row">
<q-btn class="q-ml-auto" :disable="!!state.poolMint" :loading="state.creating" @click="createPoolMint">
Create Pool Mint
</q-btn>
</div>
Expand All @@ -129,7 +144,7 @@ function setPoolMint() {
Copy Pool Mint public key
</div>
<q-expansion-item
v-model="expandedTokenSwap"
v-model="expandedPoolMint"
label="Set pool mint manually"
>
<q-input v-model="poolMint" class="q-mr-md" label="Pool Mint" />
Expand All @@ -141,7 +156,7 @@ function setPoolMint() {
</q-expansion-item>

<div class="q-mt-xl row">
<q-btn class="q-ml-auto" @click="createPoolAccounts">
<q-btn class="q-ml-auto" :loading="state.creating" @click="createPoolAccounts">
Create Pool token accounts
</q-btn>
</div>
Expand All @@ -153,7 +168,7 @@ function setPoolMint() {
</div>

<div class="q-mt-xl row">
<q-btn class="q-ml-auto" @click="createTokenSwap">
<q-btn class="q-ml-auto" :loading="state.creating" @click="createTokenSwap">
Create Pool
</q-btn>
</div>
Expand Down
Loading

0 comments on commit 92a5451

Please sign in to comment.