Skip to content

Commit

Permalink
create SwapFormWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Polyakov committed Feb 29, 2024
1 parent fda1b99 commit 732ecf3
Show file tree
Hide file tree
Showing 14 changed files with 714 additions and 653 deletions.
4 changes: 2 additions & 2 deletions src/components/pages/OrderBook/BookChartsWidget.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<swap-chart
<price-chart-widget
:dex-id="dexId"
:base-asset="baseAsset"
:quote-asset="quoteAsset"
Expand All @@ -22,7 +22,7 @@ import type { DexId } from '@sora-substrate/util/build/dex/consts';
@Component({
components: {
SwapChart: lazyComponent(Components.SwapChart),
PriceChartWidget: lazyComponent(Components.PriceChartWidget),
},
})
export default class BookChartsWidget extends Mixins(TranslationMixin) {
Expand Down
24 changes: 24 additions & 0 deletions src/components/pages/Swap/ChartWidget.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<price-chart-widget :base-asset="tokenFrom" :quote-asset="tokenTo" :is-available="isAvailable" />
</template>

<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator';
import { Components } from '@/consts';
import { lazyComponent } from '@/router';
import { getter, state } from '@/store/decorators';
import type { AccountAsset } from '@sora-substrate/util/build/assets/types';
@Component({
components: {
PriceChartWidget: lazyComponent(Components.PriceChartWidget),
},
})
export default class SwapChartWidget extends Mixins() {
@state.swap.isAvailable isAvailable!: boolean;
@getter.swap.tokenFrom tokenFrom!: Nullable<AccountAsset>;
@getter.swap.tokenTo tokenTo!: Nullable<AccountAsset>;
}
</script>
Loading

0 comments on commit 732ecf3

Please sign in to comment.