Skip to content

Commit

Permalink
Merge pull request #1186 from oasisprotocol/mz/safariFix
Browse files Browse the repository at this point in the history
Fix Safari buggy display of block fill
  • Loading branch information
buberdds authored Jan 26, 2024
2 parents 4aec417 + 5712d8d commit d54e70c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
1 change: 1 addition & 0 deletions .changelog/1186.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix Safari buggy display of block fill
4 changes: 1 addition & 3 deletions src/app/components/Blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ export const Blocks: FC<BlocksProps> = ({
key: block.hash,
data: [
{
content: (
<VerticalProgressBar variant="determinate" value={(100 * block.gas_used) / blockGasLimit} />
),
content: <VerticalProgressBar value={(100 * block.gas_used) / blockGasLimit} />,
key: 'fill',
},
{
Expand Down
22 changes: 0 additions & 22 deletions src/app/components/ProgressBar/index.ts

This file was deleted.

37 changes: 37 additions & 0 deletions src/app/components/ProgressBar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { FC } from 'react'
import Box from '@mui/material/Box'
import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress'
import { styled } from '@mui/material/styles'
import { COLORS } from 'styles/theme/colors'

type VerticalProgressBarProps = {
value: number
}

const barSize = 36

export const VerticalProgressBar: FC<VerticalProgressBarProps> = ({ value }) => {
return (
<Box sx={{ width: barSize, height: barSize, transform: 'rotate(-90deg)' }}>
<StyledLinearProgress variant="determinate" value={value} />
</Box>
)
}

const StyledLinearProgress = styled(LinearProgress)(() => ({
[`&.${linearProgressClasses.determinate} > .${linearProgressClasses.bar1Determinate}`]: {
backgroundColor: COLORS.brandDark,
},
height: barSize,
width: barSize,
}))

export const ProgressBar = styled(LinearProgress)(() => ({
[`&.${linearProgressClasses.determinate} > .${linearProgressClasses.bar1Determinate}`]: {
backgroundColor: COLORS.eucalyptus,
},
borderColor: COLORS.eucalyptus,
backgroundColor: COLORS.honeydew,
height: '12px',
width: '85px',
}))

0 comments on commit d54e70c

Please sign in to comment.