Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Sep 9, 2022
1 parent d4baeb9 commit 2dcd1d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/BookPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class BookPage extends Component {
type: 'number',
width: 140,
renderCell: (params) => {
const currencyCode = this.getCurrencyCode(params.row.currency)
const currencyCode = this.getCurrencyCode(params.row.currency);
return (
<div style={{ cursor: 'pointer' }}>
{pn(params.row.price) + ' ' + currencyCode + '/BTC'}
Expand Down
28 changes: 14 additions & 14 deletions frontend/src/components/Charts/DepthChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const DepthChart: React.FC<DepthChartProps> = ({
const theme = useTheme();
const [enrichedOrders, setEnrichedOrders] = useState<Order[]>([]);
const [series, setSeries] = useState<Serie[]>([]);
const [rangeSteps, setRangeSteps] = useState<number>(8)
const [rangeSteps, setRangeSteps] = useState<number>(8);
const [xRange, setXRange] = useState<number>(8);
const [xType, setXType] = useState<string>('premium');
const [currencyCode, setCurrencyCode] = useState<number>(1);
Expand Down Expand Up @@ -95,21 +95,21 @@ const DepthChart: React.FC<DepthChartProps> = ({
}, [enrichedOrders, xRange]);

useEffect(() => {
if (xType === 'base_amount') {
const prices: number[] = enrichedOrders.map((order) => order?.base_amount || 0)
if (xType === 'base_amount') {
const prices: number[] = enrichedOrders.map((order) => order?.base_amount || 0);

const medianValue = ~~median(prices)
const maxValue = prices.sort((a, b) => b - a).slice(0, 1)[0] || 1500
const maxRange = maxValue - medianValue
const rangeSteps = maxRange / 10
const medianValue = ~~median(prices);
const maxValue = prices.sort((a, b) => b - a).slice(0, 1)[0] || 1500;
const maxRange = maxValue - medianValue;
const rangeSteps = maxRange / 10;

setCenter(medianValue)
setXRange(maxRange)
setRangeSteps(rangeSteps)
setCenter(medianValue);
setXRange(maxRange);
setRangeSteps(rangeSteps);
} else if (lastDayPremium) {
setCenter(lastDayPremium)
setXRange(8)
setRangeSteps(0.5)
setCenter(lastDayPremium);
setXRange(8);
setRangeSteps(0.5);
}
}, [enrichedOrders, xType, lastDayPremium, currencyCode]);

Expand Down Expand Up @@ -151,7 +151,7 @@ const DepthChart: React.FC<DepthChartProps> = ({
let serie: Datum[] = [];
orders.forEach((order) => {
const lastSumOrders = sumOrders;
sumOrders += (order.satoshis_now || 0) / 100000000
sumOrders += (order.satoshis_now || 0) / 100000000;
const datum: Datum[] = [
{
// Vertical Line
Expand Down

0 comments on commit 2dcd1d4

Please sign in to comment.