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

Fix/new v3 #1007

Merged
merged 5 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions custom.svg

This file was deleted.

5 changes: 0 additions & 5 deletions full-range.svg

This file was deleted.

6 changes: 0 additions & 6 deletions narrow.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const ConcentratedLiquidityDepthChart: FC<{
horizontal?: boolean;
fullRange?: boolean;
rangeAnnotation?: DepthData[];
theme?: 'light' | 'dark';
}> = ({
data,
min,
Expand All @@ -55,7 +56,8 @@ export const ConcentratedLiquidityDepthChart: FC<{
onSubmitMax,
offset,
horizontal = true,
fullRange = false
fullRange = false,
theme = 'dark'
}) => {
const xMax = xRange[1];
const showMinDragHandler = min !== undefined && Boolean(onMoveMin) && Boolean(onSubmitMin);
Expand Down Expand Up @@ -106,15 +108,15 @@ export const ConcentratedLiquidityDepthChart: FC<{
theme={buildChartTheme({
backgroundColor: 'transparent',
colors: ['white'],
gridColor: theme.colors.osmoverse['600'],
gridColorDark: theme.colors.osmoverse['300'],
gridColor: 'red',
gridColorDark: 'green',
vuonghuuhung marked this conversation as resolved.
Show resolved Hide resolved
svgLabelSmall: {
fill: theme.colors.osmoverse['300'],
fill: 'blue',
fontSize: 12,
fontWeight: 500
},
svgLabelBig: {
fill: theme.colors.osmoverse['300'],
fill: 'grey',
fontSize: 12,
fontWeight: 500
},
Expand All @@ -139,7 +141,7 @@ export const ConcentratedLiquidityDepthChart: FC<{
data={data}
xAccessor={(d: DepthData) => d?.depth}
yAccessor={(d: DepthData) => d?.price}
colorAccessor={() => theme.colors.barFill}
colorAccessor={() => (theme === 'dark' ? '#373F31' : '#D7F5BF')}
/>
{annotationDatum && (
<Annotation
Expand All @@ -150,14 +152,14 @@ export const ConcentratedLiquidityDepthChart: FC<{
>
<AnnotationConnector />
<AnnotationCircleSubject
stroke={'#A6BE93'}
stroke={theme === 'dark' ? '#A6BE93' : '#5EA402'}
// @ts-ignore
strokeWidth={4}
radius={2}
/>
<AnnotationLineSubject
orientation="horizontal"
stroke={'#A6BE93'}
stroke={theme === 'dark' ? '#A6BE93' : '#5EA402'}
strokeWidth={2.2}
/>
</Annotation>
Expand All @@ -174,7 +176,7 @@ export const ConcentratedLiquidityDepthChart: FC<{
<AnnotationConnector />
<AnnotationLineSubject
orientation="horizontal"
stroke={theme.colors.wosmongton['200']}
stroke={'black'}
strokeWidth={2}
strokeDasharray={4}
/>
Expand All @@ -186,7 +188,7 @@ export const ConcentratedLiquidityDepthChart: FC<{
defaultValue={fullRange ? yRange[1] * 0.95 : max}
length={xMax}
scale={yScale}
stroke={'#FFF27A'}
stroke={theme === 'dark' ? '#FFF27A' : '#C68E00'}
onMove={onMoveMaxBoundary}
onSubmit={onSubmitMax}
/>
Expand All @@ -197,14 +199,14 @@ export const ConcentratedLiquidityDepthChart: FC<{
defaultValue={fullRange ? yRange[0] * 1.05 : min}
length={xMax}
scale={yScale}
stroke={'#0ECB81'}
stroke={theme === 'dark' ? '#0ECB81' : '#03A66D'}
onMove={onMoveMinBoundary}
onSubmit={onSubmitMin}
/>
)}
<style>{`
.visx-bar {
stroke: ${theme.colors.barFill};
stroke: ${theme === 'dark' ? '#373F31' : '#D7F5BF'};
stroke-width: 3px;
}
vuonghuuhung marked this conversation as resolved.
Show resolved Hide resolved
`}</style>
Expand All @@ -231,16 +233,16 @@ const DragContainer: FC<{
canEditSubject
canEditLabel={false}
onDragMove={({ event, ...nextPos }) => {
event.preventDefault()
event.stopPropagation()
event.preventDefault();
event.stopPropagation();
if (props.onMove) {
const val = props.scale.invert(nextPos.y);
props.onMove(+Math.max(0, val));
}
}}
onDragEnd={({ event, ...nextPos }) => {
event.preventDefault()
event.stopPropagation()
event.preventDefault();
event.stopPropagation();
if (props.onSubmit) {
const val = props.scale.invert(nextPos.y);
props.onSubmit(+Math.max(0, val));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
.menuWrapper {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
gap: 10px;
align-self: stretch;
Expand All @@ -285,7 +286,7 @@
display: flex;
height: 48px;
padding: 4px;
// flex-direction: column;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 5px;
Expand Down Expand Up @@ -396,10 +397,10 @@
align-self: stretch;
margin-bottom: 24px;

@include small-mobile {
flex-direction: column;
gap: 8px;
}
// @include small-mobile {
// flex-direction: column;
// gap: 8px;
// }
vuonghuuhung marked this conversation as resolved.
Show resolved Hide resolved

@include theme {
border-bottom: 1px solid theme-get('neutral-border-border-bold');
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Pool-V3/components/CreatePositionForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const CreatePositionForm: FC<CreatePositionFormProps> = ({ poolId, slippage, sho
const { poolPrice: extendPrices } = useGetPoolList(prices);

const [walletAddress] = useConfigReducer('address');

const loadOraichainToken = useLoadOraichainTokens();
const navigate = useNavigate();
const { feeDailyData } = useGetFeeDailyData();
Expand Down Expand Up @@ -209,7 +209,7 @@ const CreatePositionForm: FC<CreatePositionFormProps> = ({ poolId, slippage, sho
<p className={styles.title}>Current pool price</p>
{tokenX && tokenY && currentPrice && (
<p className={styles.content}>
{numberWithCommas(currentPrice, undefined, { maximumFractionDigits: 2 })}{' '}
{numberWithCommas(currentPrice, undefined, { maximumFractionDigits: currentPrice >= 0.01 ? 2 : 9 })}{' '}
{isXToY ? `${tokenY.name} per ${tokenX.name}` : `${tokenX.name} per ${tokenY.name}`}
</p>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TokenItemType } from '@oraichain/oraidex-common';
import { TimeDuration, TokenPairHistoricalPrice } from 'reducer/poolDetailV3';
import { Dec } from '@keplr-wallet/unit';
import { isMobile } from '@walletconnect/browser-utils';
import useTheme from 'hooks/useTheme';


interface HistoricalChartDataWrapperProps {
Expand Down Expand Up @@ -40,6 +41,7 @@ const HistoricalChartDataWrapper: FC<HistoricalChartDataWrapperProps> = ({
// maxDecimals: 8,
// notation: 'standard'
// }) || '';
const theme = useTheme();

const chartDataToNow = [...historicalChartData];
// if (historicalChartData.length > 0) {
Expand All @@ -61,6 +63,7 @@ const HistoricalChartDataWrapper: FC<HistoricalChartDataWrapperProps> = ({
}}
extendLeft={historicalChartData[0]?.close <= 0.001 ? 30 : 10}
xNumTicks={2}
theme={theme}
/>
</div>
);
Expand Down
Loading
Loading