diff --git a/src/components/layout/Modals.svelte b/src/components/layout/Modals.svelte
index 03b829d..056a995 100644
--- a/src/components/layout/Modals.svelte
+++ b/src/components/layout/Modals.svelte
@@ -14,6 +14,7 @@
import UnstakeCAP from '../modals/UnstakeCAP.svelte'
import HistoryOrderStatus from '../modals/HistoryOrderStatus.svelte'
import Settings from '../modals/Settings.svelte'
+ import ShareTrade from '../modals/ShareTrade.svelte'
@@ -67,4 +68,8 @@
{#if $activeModal && $activeModal.name == 'MarketInfo'}
-{/if}
\ No newline at end of file
+{/if}
+
+{#if $activeModal && $activeModal.name == 'ShareTrade'}
+
+{/if}
diff --git a/src/components/modals/CustomizeColumns.svelte b/src/components/modals/CustomizeColumns.svelte
index c0dd5ef..9b94136 100644
--- a/src/components/modals/CustomizeColumns.svelte
+++ b/src/components/modals/CustomizeColumns.svelte
@@ -26,6 +26,9 @@
isColumnShown[key] = true;
}
}
+ for (const col of data.allColumns) {
+ if (col.permanent) isColumnShown[col.key] = true;
+ }
function trackColumnShownChange(isColumnShown) {
// set store
diff --git a/src/components/modals/ShareTrade.svelte b/src/components/modals/ShareTrade.svelte
new file mode 100644
index 0000000..90933af
--- /dev/null
+++ b/src/components/modals/ShareTrade.svelte
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+ {#if imageUrl}
+

+ {/if}
+
+
+
+
+
+
+
diff --git a/src/components/trade/account/Account.svelte b/src/components/trade/account/Account.svelte
index a589a71..e694e4d 100644
--- a/src/components/trade/account/Account.svelte
+++ b/src/components/trade/account/Account.svelte
@@ -63,7 +63,8 @@
{key: 'pnl', gridTemplate: '1fr', sortable: true},
{key: 'fee', gridTemplate: '0.75fr', sortable: true},
{key: 'expiry', gridTemplate: '1fr', sortable: true},
- {key: 'cancelOrderId', gridTemplate: '0.5fr', sortable: false}
+ {key: 'cancelOrderId', gridTemplate: '0.5fr', sortable: false},
+ {key: 'tools', gridTemplate: '30px', sortable: false, permanent: true}
]
};
@@ -205,4 +206,4 @@
{#if panel == 'history'}{/if}
-
\ No newline at end of file
+
diff --git a/src/components/trade/account/History.svelte b/src/components/trade/account/History.svelte
index 68ee72e..9cb0afb 100644
--- a/src/components/trade/account/History.svelte
+++ b/src/components/trade/account/History.svelte
@@ -4,9 +4,10 @@
import Table from '@components/layout/table/Table.svelte'
import Row from '@components/layout/table/Row.svelte'
import Cell from '@components/layout/table/Cell.svelte'
+ import tooltip from '@lib/tooltip'
import { onMount, onDestroy } from 'svelte'
- import { LOADING_ICON } from '@lib/icons'
+ import { LOADING_ICON, SHARE_ICON } from '@lib/icons'
import { DEFAULT_HISTORY_COUNT, DEFAULT_HISTORY_SORT_KEY } from '@lib/config'
import {
@@ -100,7 +101,7 @@
});
let columns = [];
- $: columns = allColumns.filter((item) => $historyColumnsToShow.includes(item.key));
+ $: columns = allColumns.filter((item) => item.permanent || $historyColumnsToShow.includes(item.key));
let formattedHistory = [];
$: formattedHistory = $historySorted.map((item) => formatHistoryItem(item));
@@ -117,6 +118,26 @@
return item.status;
}
+ function showHistoryShare(item) {
+ const pnl = item.pnl ? item.pnl : undefined;
+ showModal('ShareTrade', {
+ type: 'history',
+ status: getItemStatus(item),
+ market: item.market,
+ side: formatSide(item.isLong, item.isReduceOnly),
+ asset: item.asset,
+ price: item.price,
+ entryPrice: item.price,
+ size: item.size,
+ margin: item.margin,
+ leverage: item.leverage,
+ orderType: formatOrderType(item.orderType),
+ pnl,
+ pnlPercent: pnl && item.margin ? 100 * pnl / item.margin : undefined,
+ timestamp: item.timestamp
+ });
+ }
+