-
-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: grey out text and icons for disabled strategies in playground (#…
…5113) What it says on the tin Closes # [1-1512](https://linear.app/unleash/issue/1-1512/grey-out-everything-icons-labels-etc-when-strategy-is-disabled) <img width="689" alt="Screenshot 2023-10-20 at 12 25 51" src="https://github.com/Unleash/unleash/assets/104830839/3192a125-0e2a-46f2-a266-e4d6c171bdad"> <img width="711" alt="Screenshot 2023-10-20 at 14 52 30" src="https://github.com/Unleash/unleash/assets/104830839/15040439-c059-4725-9518-82e363fd7230"> --------- Signed-off-by: andreas-unleash <[email protected]>
- Loading branch information
1 parent
03faffa
commit 69d050a
Showing
16 changed files
with
213 additions
and
36 deletions.
There are no files selected for viewing
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 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 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 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 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 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 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 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
46 changes: 46 additions & 0 deletions
46
frontend/src/component/common/PercentageCircle/DisabledPercentageCircle.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,46 @@ | ||
import { useTheme } from '@mui/material'; | ||
import { CSSProperties } from 'react'; | ||
|
||
interface IPercentageCircleProps { | ||
percentage: number; | ||
size?: `${number}rem`; | ||
} | ||
|
||
const PercentageCircle = ({ | ||
percentage, | ||
size = '4rem', | ||
}: IPercentageCircleProps) => { | ||
const theme = useTheme(); | ||
|
||
const style: CSSProperties = { | ||
display: 'block', | ||
borderRadius: '100%', | ||
transform: 'rotate(-90deg)', | ||
height: size, | ||
width: size, | ||
background: theme.palette.background.elevation2, | ||
}; | ||
|
||
// The percentage circle used to be drawn by CSS with a conic-gradient, | ||
// but the result was either jagged or blurry. SVG seems to look better. | ||
// See https://stackoverflow.com/a/70659532. | ||
const radius = 100 / (2 * Math.PI); | ||
const diameter = 2 * radius; | ||
|
||
return ( | ||
<svg viewBox={`0 0 ${diameter} ${diameter}`} style={style} aria-hidden> | ||
<title>A circle progress bar with {percentage}% completion.</title> | ||
<circle | ||
r={radius} | ||
cx={radius} | ||
cy={radius} | ||
fill='none' | ||
stroke={theme.palette.neutral.border} | ||
strokeWidth={diameter} | ||
strokeDasharray={`${percentage} 100`} | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default PercentageCircle; |
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 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
Oops, something went wrong.