-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: [M3-7232] Rename isPropValid and update codebase & documentat…
…ion (#9790) * Rename isValidProp and update codebase * Added changeset: Rename isPropValid utility * Feedback * Update doc * More feedback * Post rebase fix * Copy feedback
- Loading branch information
1 parent
5e023c7
commit d542062
Showing
42 changed files
with
221 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Changed | ||
--- | ||
|
||
Rename isPropValid utility ([#9790](https://github.com/linode/manager/pull/9790)) |
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
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
32 changes: 17 additions & 15 deletions
32
packages/manager/src/components/GaugePercent/GaugePercent.styles.ts
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 |
---|---|---|
@@ -1,38 +1,40 @@ | ||
import { styled } from '@mui/material/styles'; | ||
import { isPropValid } from 'src/utilities/isPropValid'; | ||
|
||
import { omittedProps } from 'src/utilities/omittedProps'; | ||
|
||
import { GaugePercentProps } from './GaugePercent'; | ||
|
||
type StyledGaugePercentProps = Pick<GaugePercentProps, 'innerTextFontSize'> & | ||
Required<Pick<GaugePercentProps, 'width' | 'height'>>; | ||
Required<Pick<GaugePercentProps, 'height' | 'width'>>; | ||
|
||
const propKeys = ['width', 'height', 'innerTextFontSize']; | ||
|
||
export const StyledSubTitleDiv = styled('div', { | ||
shouldForwardProp: (prop) => isPropValid(propKeys, prop), | ||
})<StyledGaugePercentProps>(({ theme, width, height, innerTextFontSize }) => ({ | ||
shouldForwardProp: omittedProps(propKeys), | ||
})<StyledGaugePercentProps>(({ height, innerTextFontSize, theme, width }) => ({ | ||
color: theme.color.headline, | ||
fontSize: innerTextFontSize || theme.spacing(2.5), | ||
position: 'absolute', | ||
textAlign: 'center', | ||
top: `calc(${height}px + ${theme.spacing(1.25)})`, | ||
width: width, | ||
width, | ||
})); | ||
|
||
export const StyledInnerTextDiv = styled('div', { | ||
shouldForwardProp: (prop) => isPropValid(propKeys, prop), | ||
})<StyledGaugePercentProps>(({ theme, height, width }) => ({ | ||
shouldForwardProp: omittedProps(propKeys), | ||
})<StyledGaugePercentProps>(({ height, theme, width }) => ({ | ||
color: theme.palette.text.primary, | ||
fontSize: '1rem', | ||
position: 'absolute', | ||
top: `calc(${height + 30}px / 2)`, | ||
width: width, | ||
textAlign: 'center', | ||
fontSize: '1rem', | ||
color: theme.palette.text.primary, | ||
top: `calc(${height + 30}px / 2)`, | ||
width, | ||
})); | ||
|
||
export const StyledGaugeWrapperDiv = styled('div', { | ||
shouldForwardProp: (prop) => isPropValid(propKeys, prop), | ||
})<StyledGaugePercentProps>(({ theme, height, width }) => ({ | ||
position: 'relative', | ||
width: width, | ||
shouldForwardProp: omittedProps(propKeys), | ||
})<StyledGaugePercentProps>(({ height, theme, width }) => ({ | ||
height: `calc(${height}px + ${theme.spacing(3.75)})`, | ||
position: 'relative', | ||
width, | ||
})); |
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.