Skip to content

Commit

Permalink
refactor: move logic up out of single-use components
Browse files Browse the repository at this point in the history
  • Loading branch information
pbullhove committed Apr 4, 2024
1 parent 081808e commit afa043b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 46 deletions.
18 changes: 14 additions & 4 deletions web/src/Components/Bridging/BridgeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { AuthContext } from 'react-oauth2-code-pkce'
import { ErrorToast } from '../Common/Toast'
import InputContainer from './InputContainer'
import { findGraphData } from '../../Utils'
import CumulativeGraph from './Graphs/CumulativeGraph'
import DistributionGraph from './Graphs/DistributionGraph'
import { Bridge } from '../../Types'
import BridgeGraph from './Graphs/BridgeGraph'
import { differentiateArrayObjects } from './utils'

type BridgeContainerProps = {
bridges: Bridge
Expand Down Expand Up @@ -96,8 +96,18 @@ export default ({ bridges, mode, setMode, bridgeValue, setValue }: BridgeContain
borderRadius: '0.5rem',
}}
>
<CumulativeGraph bridges={bridges} sizeFractions={sizeFractions} />
<DistributionGraph bridges={bridges} sizeFractions={sizeFractions} />
<BridgeGraph
graphData={findGraphData(sizeFractions, bridges)}
yAxis={'Cumulative Volume (%)'}
sizeFractions={sizeFractions}
bridges={bridges}
/>
<BridgeGraph
graphData={differentiateArrayObjects(findGraphData(sizeFractions, bridges))}
yAxis={'Volume (%)'}
sizeFractions={sizeFractions}
bridges={bridges}
/>
</div>
<InputContainer
mode={mode}
Expand Down
24 changes: 0 additions & 24 deletions web/src/Components/Bridging/Graphs/CumulativeGraph.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions web/src/Components/Bridging/Graphs/DistributionGraph.tsx

This file was deleted.

0 comments on commit afa043b

Please sign in to comment.