Skip to content

Commit

Permalink
fix(source-node): update filter souce and node sections
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed Sep 19, 2024
1 parent bf45158 commit 0e69c60
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
17 changes: 13 additions & 4 deletions src/components/App/SideBar/FilterSearch/MaxResults/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Slider } from '@mui/material'
import { HeadingWrapper, PopoverBody, SourceNodesStepWrapper, SubHeading, VolumeControl } from '../index'
import styled from 'styled-components'
import { colors } from '~/utils'

type MaxResultsProps = {
maxResults: number
Expand All @@ -21,22 +23,29 @@ export const MaxResults = ({ maxResults, setMaxResults }: MaxResultsProps) => {
</HeadingWrapper>
<PopoverBody>
<SourceNodesStepWrapper>
<span>1</span>
<span>{maxResults}</span>
<span>0</span>
<span>300</span>
</SourceNodesStepWrapper>
<VolumeControl direction="row">
<Slider
<CustomSlider
className="volume-slider"
data-testid="max-results-slider"
max={300}
min={1}
min={0}
onChange={MaxResultsChangeHandler}
size="medium"
step={1}
value={maxResults}
valueLabelDisplay="on"
/>
</VolumeControl>
</PopoverBody>
</>
)
}

const CustomSlider = styled(Slider)({
'& .MuiSlider-valueLabel': {
backgroundColor: `${colors.primaryBlue}`,
},
})
17 changes: 13 additions & 4 deletions src/components/App/SideBar/FilterSearch/SourceNodes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Slider } from '@mui/material'
import styled from 'styled-components'
import { colors } from '~/utils/colors'
import { HeadingWrapper, PopoverBody, SourceNodesStepWrapper, SubHeading, VolumeControl } from '../index'

type SourceNodesProps = {
Expand All @@ -21,22 +23,29 @@ export const SourceNodes = ({ sourceNodes, setSourceNodes }: SourceNodesProps) =
</HeadingWrapper>
<PopoverBody>
<SourceNodesStepWrapper>
<span>1</span>
<span>{sourceNodes}</span>
<span>0</span>
<span>100</span>
</SourceNodesStepWrapper>
<VolumeControl direction="row">
<Slider
<CustomSlider
className="volume-slider"
data-testid="source-nodes-slider"
max={100}
min={1}
min={0}
onChange={SourceNodesChangeHandler}
size="medium"
step={1}
value={sourceNodes}
valueLabelDisplay="on"
/>
</VolumeControl>
</PopoverBody>
</>
)
}

const CustomSlider = styled(Slider)({
'& .MuiSlider-valueLabel': {
backgroundColor: `${colors.primaryBlue}`,
},
})

0 comments on commit 0e69c60

Please sign in to comment.