Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
11f7b398
Commit
11f7b398
authored
Sep 01, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix skeleton theme
parent
a5d61d61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
Skeleton.ts
theme/components/Skeleton.ts
+9
-7
No files found.
theme/components/Skeleton.ts
View file @
11f7b398
import
{
Skeleton
as
SkeletonComponent
}
from
'
@chakra-ui/react
'
;
import
{
Skeleton
as
SkeletonComponent
}
from
'
@chakra-ui/react
'
;
import
{
defineStyle
,
defineStyleConfig
,
}
from
'
@chakra-ui/styled-system
'
;
import
{
keyframes
}
from
'
@chakra-ui/system
'
;
import
{
keyframes
}
from
'
@chakra-ui/system
'
;
import
type
{
SystemStyleFunction
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
,
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
{
getColor
,
mode
}
from
'
@chakra-ui/theme-tools
'
;
const
shine
=
()
=>
const
shine
=
()
=>
...
@@ -8,14 +11,13 @@ const shine = () =>
...
@@ -8,14 +11,13 @@ const shine = () =>
to
:
{
backgroundPositionX
:
'
-200%
'
},
to
:
{
backgroundPositionX
:
'
-200%
'
},
});
});
const
baseStyle
:
SystemStyleFunction
=
(
props
)
=>
{
const
baseStyle
=
defineStyle
(
(
props
)
=>
{
const
defaultStartColor
=
mode
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
)(
props
);
const
defaultStartColor
=
mode
(
'
blackAlpha.50
'
,
'
whiteAlpha.50
'
)(
props
);
const
defaultEndColor
=
mode
(
'
blackAlpha.100
'
,
'
whiteAlpha.100
'
)(
props
);
const
defaultEndColor
=
mode
(
'
blackAlpha.100
'
,
'
whiteAlpha.100
'
)(
props
);
const
{
const
{
startColor
=
defaultStartColor
,
startColor
=
defaultStartColor
,
endColor
=
defaultEndColor
,
endColor
=
defaultEndColor
,
speed
,
theme
,
theme
,
}
=
props
;
}
=
props
;
...
@@ -28,17 +30,17 @@ const baseStyle: SystemStyleFunction = (props) => {
...
@@ -28,17 +30,17 @@ const baseStyle: SystemStyleFunction = (props) => {
borderColor
:
start
,
borderColor
:
start
,
background
:
`linear-gradient(90deg,
${
start
}
8%,
${
end
}
18%,
${
start
}
33%)`
,
background
:
`linear-gradient(90deg,
${
start
}
8%,
${
end
}
18%,
${
start
}
33%)`
,
backgroundSize
:
'
200% 100%
'
,
backgroundSize
:
'
200% 100%
'
,
animation
:
`
${
speed
}
s linear infinite
${
shine
()
}
`
,
};
};
};
}
)
;
const
Skeleton
=
{
const
Skeleton
=
defineStyleConfig
(
{
baseStyle
,
baseStyle
,
};
}
)
;
export
default
Skeleton
;
export
default
Skeleton
;
SkeletonComponent
.
defaultProps
=
{
SkeletonComponent
.
defaultProps
=
{
...
SkeletonComponent
.
defaultProps
,
...
SkeletonComponent
.
defaultProps
,
speed
:
1
,
speed
:
1
,
animation
:
`1s linear infinite
${
shine
()
}
`
,
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment