File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ const MyLoader = () => {
6161| height | _ Number_ | ` 130 ` | Height component |
6262| primaryColor | _ String_ | ` #f3f3f3 ` | Background the SVG |
6363| secondaryColor | _ String_ | ` #ecebeb ` | Animation color |
64+ | preserveAspectRatio | _ String_ | ` xMidYMid meet ` | Aspect ratio option of SVG|
6465
6566
6667** Custom element options:**
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const Wrap = (props: WrapProps): React.Element<*> => {
1919 height = { props . height }
2020 version = "1.1"
2121 style = { props . style }
22- preserveAspectRatio = "xMidYMid meet"
22+ preserveAspectRatio = { props . preserveAspectRatio }
2323 >
2424 < rect
2525 style = { { fill : `url(#${ idGradient } )` } }
@@ -64,4 +64,4 @@ const Wrap = (props: WrapProps): React.Element<*> => {
6464 )
6565}
6666
67- export default Wrap
67+ export default Wrap
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export type Props = {
2020 height : number ,
2121 primaryColor : string ,
2222 secondaryColor : string ,
23+ preserveAspectRatio :string ,
2324}
2425
2526type State = {
@@ -30,6 +31,7 @@ type State = {
3031 height : number ,
3132 primaryColor : string ,
3233 secondaryColor : string ,
34+ preserveAspectRatio : string ,
3335}
3436
3537class ContentLoader extends React . Component < Props , State > {
@@ -40,6 +42,7 @@ class ContentLoader extends React.Component<Props, State> {
4042 height : 130 ,
4143 primaryColor : '#f0f0f0' ,
4244 secondaryColor : '#e0e0e0' ,
45+ preserveAspectRatio : 'xMidYMid meet' ,
4346 }
4447
4548 constructor ( props : Props ) {
@@ -53,6 +56,7 @@ class ContentLoader extends React.Component<Props, State> {
5356 height : props . height ,
5457 primaryColor : props . primaryColor ,
5558 secondaryColor : props . secondaryColor ,
59+ preserveAspectRatio : props . preserveAspectRatio ,
5660 }
5761 }
5862
@@ -84,4 +88,4 @@ class ContentLoader extends React.Component<Props, State> {
8488}
8589
8690export default ContentLoader
87- export { Rect , Circle }
91+ export { Rect , Circle }
You can’t perform that action at this time.
0 commit comments