Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
into release/0.3.14
  • Loading branch information
veado committed Sep 4, 2021
2 parents 91055f1 + 89a4a04 commit 4139021
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/renderer/components/pool/PoolDetails.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const PoolDetailsStory = () => {
ChartView={() => <>Pool Chart Here</>}
disableTradingPoolAction={false}
disableAllPoolActions={false}
disablePoolActions={false}
/>
)
}
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/pool/PoolDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Props = {
ChartView: React.ComponentType<{ isLoading?: boolean; priceRatio: BigNumber }>
disableTradingPoolAction: boolean
disableAllPoolActions: boolean
disablePoolActions: boolean
network: Network
}

Expand All @@ -38,6 +39,7 @@ export const PoolDetails: React.FC<Props> = ({
ChartView,
disableTradingPoolAction,
disableAllPoolActions,
disablePoolActions,
network
}) => {
const price = useMemo(() => H.getPrice(poolDetail, priceRatio), [poolDetail, priceRatio])
Expand All @@ -48,6 +50,7 @@ export const PoolDetails: React.FC<Props> = ({
network={network}
disableAllPoolActions={disableAllPoolActions}
disableTradingPoolAction={disableTradingPoolAction}
disablePoolActions={disablePoolActions}
asset={O.some(asset)}
price={price}
priceSymbol={priceSymbol}
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/components/pool/PoolTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type Props = {
isLoading?: boolean
disableTradingPoolAction: boolean
disableAllPoolActions: boolean
disablePoolActions: boolean
network: Network
status: GetPoolsStatusEnum
}
Expand All @@ -35,6 +36,7 @@ export const PoolTitle: React.FC<Props> = ({
priceSymbol,
disableTradingPoolAction,
disableAllPoolActions,
disablePoolActions,
network,
isLoading,
status
Expand Down Expand Up @@ -103,7 +105,7 @@ export const PoolTitle: React.FC<Props> = ({
return (
<Styled.ButtonActions>
<ManageButton
disabled={disableAllPoolActions}
disabled={disableAllPoolActions || disablePoolActions}
asset={asset}
sizevalue={isDesktopView ? 'normal' : 'small'}
isTextView={isDesktopView}
Expand All @@ -130,7 +132,7 @@ export const PoolTitle: React.FC<Props> = ({
}
)
),
[oAsset, disableAllPoolActions, isDesktopView, status, disableTradingPoolAction, intl, history]
[oAsset, disableAllPoolActions, disablePoolActions, isDesktopView, status, disableTradingPoolAction, intl, history]
)

return (
Expand Down
10 changes: 8 additions & 2 deletions src/renderer/views/pool/PoolDetailsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const defaultDetailsProps: TargetPoolDetailProps = {
earningsHistory: O.none,
network: DEFAULT_NETWORK,
disableAllPoolActions: false,
disableTradingPoolAction: false
disableTradingPoolAction: false,
disablePoolActions: false
}

export const PoolDetailsView: React.FC = () => {
Expand Down Expand Up @@ -74,6 +75,10 @@ export const PoolDetailsView: React.FC = () => {
(chain: Chain) => PoolHelpers.disableTradingActions({ chain, haltedChains, mimirHalt }),
[haltedChains, mimirHalt]
)
const getDisablePoolActions = useCallback(
(chain: Chain) => PoolHelpers.disablePoolActions({ chain, haltedChains, mimirHalt }),
[haltedChains, mimirHalt]
)

const oRouteAsset = useMemo(() => O.fromNullable(assetFromString(asset.toUpperCase())), [asset])

Expand Down Expand Up @@ -139,7 +144,8 @@ export const PoolDetailsView: React.FC = () => {
HistoryView: PoolHistory,
ChartView: PoolChartView,
disableAllPoolActions: getDisableAllPoolActions(asset.chain),
disableTradingPoolAction: getDisableTradingPoolAction(asset.chain)
disableTradingPoolAction: getDisableTradingPoolAction(asset.chain),
disablePoolActions: getDisablePoolActions(asset.chain)
}

return <PoolDetails asset={asset} {...prevProps.current} />
Expand Down

0 comments on commit 4139021

Please sign in to comment.