Skip to content

Commit

Permalink
refactor: typign
Browse files Browse the repository at this point in the history
  • Loading branch information
pbullhove committed Apr 3, 2024
1 parent a33f505 commit 2dbd1f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
13 changes: 11 additions & 2 deletions web/src/Components/Bridging/BridgeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ import InputContainer from './InputContainer'
import { findGraphData } from '../../Utils'
import CumulativeGraph from './Graphs/CumulativeGraph'
import DistributionGraph from './Graphs/DistributionGraph'
import { Bridge } from '../../Types'

export default ({ bridges, mode, setMode, bridgeValue, setValue }) => {
type BridgeContainerProps = {
bridges: Bridge
mode: BridgingOption
setMode: (mode: BridgingOption) => void
bridgeValue: number
setValue: (value: number) => void
}

export default ({ bridges, mode, setMode, bridgeValue, setValue }: BridgeContainerProps) => {
const [sizeFractions, setSizeFractions] = useState([])
const [unit, setUnit] = useState('mD')
const [bridgeValueHelperText, setBridgeValueHelperText] = useState(undefined)
Expand Down Expand Up @@ -53,7 +62,7 @@ export default ({ bridges, mode, setMode, bridgeValue, setValue }) => {
case BridgingOption.CERAMIC_DISCS:
setMode(BridgingOption.CERAMIC_DISCS)
setUnit('microns')
setValue(CeramicDiscsValues[0])
setValue(parseInt(CeramicDiscsValues[0]))
break
default:
return
Expand Down
6 changes: 3 additions & 3 deletions web/src/Components/Bridging/InputContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ const InputContainer = ({
<Typography variant='h3'>Optimal Bridge:</Typography>
<p>
D10: {findDValue(optimalBridgeGraphData, 10, 'Bridge')}
{'\u00B5'}
{'\u00B5m'}
</p>
<p>
D50: {findDValue(optimalBridgeGraphData, 50, 'Bridge')}
{'\u00B5'}
{'\u00B5m'}
</p>
<p>
D90: {findDValue(optimalBridgeGraphData, 90, 'Bridge')}
{'\u00B5'}
{'\u00B5m'}
</p>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion web/src/Pages/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Products } from '../Types'
import { ErrorToast } from '../Components/Common/Toast'
import { AuthContext } from 'react-oauth2-code-pkce'
import { IAuthContext } from 'react-oauth2-code-pkce'
import Navbar from '../Components/Navbar/NavBar'
import Navbar from '../Components/Navbar/Navbar'

const BodyWrapper = styled.div`
display: flex;
Expand Down

0 comments on commit 2dbd1f2

Please sign in to comment.