-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
587 additions
and
231 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/components/common/ChartTemplate/ChartTemplate.module.scss
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ommon/ChartLegend/ChartLegend.module.scss → ...ents/ChartLegends/ChartLegend.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@import "../../../styles/constants.scss"; | ||
@import '../../../styles/constants.scss'; | ||
|
||
$height: 3rem; | ||
|
||
|
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
src/features/dashboard/components/Charts/ProofCostChart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @file React component. | ||
* @copyright Yury Korotovskikh <[email protected]> | ||
*/ | ||
|
||
import type { ReactElement } from 'react'; | ||
import { useState } from 'react'; | ||
import { CandlestickSeries, Chart } from '@nilfoundation/ui-kit'; | ||
import type { CandlestickData, CandlestickSeriesPartialOptions } from 'lightweight-charts'; | ||
import { useGetStatementDashboardData } from '../../hooks/useGetStatementDashboardData'; | ||
|
||
/** | ||
* Proof cost chart. | ||
* | ||
* @returns React component. | ||
*/ | ||
export const ProofCostChart = (): ReactElement => { | ||
const [legendData, setLegendData] = useState<CandlestickData | null>(null); | ||
Check warning on line 18 in src/features/dashboard/components/Charts/ProofCostChart.tsx GitHub Actions / Build
|
||
const { | ||
chartData: { candlestickChartData, volumesData }, | ||
loadingData: isLoadingChartData, | ||
} = useGetStatementDashboardData(props.displayVolumes, props.dataRange); | ||
Check failure on line 22 in src/features/dashboard/components/Charts/ProofCostChart.tsx GitHub Actions / Build
|
||
|
||
return ( | ||
<Chart> | ||
<CandlestickSeries | ||
data={candlestickChartData} | ||
reactive | ||
options={seriesDefaultOptions} | ||
/> | ||
</Chart> | ||
); | ||
}; | ||
|
||
/** | ||
* Series default options. | ||
*/ | ||
const seriesDefaultOptions: CandlestickSeriesPartialOptions = { | ||
priceFormat: { | ||
type: 'price', | ||
precision: 4, | ||
minMove: 0.0001, | ||
}, | ||
}; |
File renamed without changes.
51 changes: 51 additions & 0 deletions
51
src/features/dashboard/components/Dashboard/ChartTypeSelect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* @file React component. | ||
* @copyright Yury Korotovskikh <[email protected]> | ||
*/ | ||
|
||
import type { ReactElement } from 'react'; | ||
import { Nav } from '@nilfoundation/react-components'; | ||
import { ChartType } from '@/enums'; | ||
import { useBreakpoint } from '@/features/shared'; | ||
import { BREAKPOINT } from '@/styles/Breakpoint'; | ||
|
||
/** | ||
* Props. | ||
*/ | ||
type ChartTypeSelectProps = { | ||
chartType: ChartType; | ||
onSelectChartType: (chartType: ChartType) => void; | ||
disabled: boolean; | ||
}; | ||
|
||
/** | ||
* Chart type selector. | ||
* | ||
* @param {ChartTypeSelectProps} props Props. | ||
* @returns React component. | ||
*/ | ||
export const ChartTypeSelect = ({ | ||
chartType, | ||
onSelectChartType, | ||
disabled, | ||
}: ChartTypeSelectProps): ReactElement => { | ||
const bp = useBreakpoint(); | ||
|
||
return ( | ||
<Nav | ||
tabs | ||
vertical={bp === BREAKPOINT.SM} | ||
> | ||
{Object.values(ChartType).map(x => ( | ||
<Nav.Item | ||
key={x} | ||
active={x === chartType} | ||
onClick={() => onSelectChartType(x)} | ||
disabled={disabled} | ||
> | ||
{x} | ||
</Nav.Item> | ||
))} | ||
</Nav> | ||
); | ||
}; |
Oops, something went wrong.