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
97e56a1a
Commit
97e56a1a
authored
Aug 15, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
second variant of content loader
parent
f8800e5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
8 deletions
+38
-8
ColorModeToggler.tsx
ui/header/ColorModeToggler.tsx
+1
-2
ApiKeys.tsx
ui/pages/ApiKeys.tsx
+3
-6
ContentLoader.tsx
ui/shared/ContentLoader.tsx
+34
-0
No files found.
ui/header/ColorModeToggler.tsx
View file @
97e56a1a
...
@@ -22,8 +22,7 @@ import styles from './ColorModeToggler.module.css';
...
@@ -22,8 +22,7 @@ import styles from './ColorModeToggler.module.css';
export
interface
ColorModeTogglerProps
export
interface
ColorModeTogglerProps
extends
Omit
<
UseCheckboxProps
,
'
isIndeterminate
'
>
,
extends
Omit
<
UseCheckboxProps
,
'
isIndeterminate
'
>
,
Omit
<
HTMLChakraProps
<
'
label
'
>
,
keyof
UseCheckboxProps
>
,
Omit
<
HTMLChakraProps
<
'
label
'
>
,
keyof
UseCheckboxProps
>
,
ThemingProps
<
'
Switch
'
>
{
ThemingProps
<
'
Switch
'
>
{}
}
const
ColorModeToggler
=
forwardRef
<
ColorModeTogglerProps
,
'
input
'
>
((
props
,
ref
)
=>
{
const
ColorModeToggler
=
forwardRef
<
ColorModeTogglerProps
,
'
input
'
>
((
props
,
ref
)
=>
{
const
ownProps
=
omitThemingProps
(
props
);
const
ownProps
=
omitThemingProps
(
props
);
...
...
ui/pages/ApiKeys.tsx
View file @
97e56a1a
import
{
Box
,
Button
,
HStack
,
Link
,
Text
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
HStack
,
Link
,
Text
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
...
@@ -10,8 +10,8 @@ import ApiKeyModal from 'ui/apiKey/ApiKeyModal/ApiKeyModal';
...
@@ -10,8 +10,8 @@ import ApiKeyModal from 'ui/apiKey/ApiKeyModal/ApiKeyModal';
import
ApiKeyTable
from
'
ui/apiKey/ApiKeyTable/ApiKeyTable
'
;
import
ApiKeyTable
from
'
ui/apiKey/ApiKeyTable/ApiKeyTable
'
;
import
DeleteApiKeyModal
from
'
ui/apiKey/DeleteApiKeyModal
'
;
import
DeleteApiKeyModal
from
'
ui/apiKey/DeleteApiKeyModal
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
const
DATA_LIMIT
=
3
;
const
DATA_LIMIT
=
3
;
...
@@ -56,10 +56,7 @@ const ApiKeysPage: React.FC = () => {
...
@@ -56,10 +56,7 @@ const ApiKeysPage: React.FC = () => {
const
content
=
(()
=>
{
const
content
=
(()
=>
{
if
(
isLoading
||
isError
)
{
if
(
isLoading
||
isError
)
{
return
(
return
(
<>
<
ContentLoader
/>
<
SkeletonTable
columns=
{
[
'
100%
'
,
'
108px
'
]
}
/>
<
Skeleton
height=
"44px"
width=
"156px"
marginTop=
{
8
}
/>
</>
);
);
}
}
...
...
ui/shared/ContentLoader.tsx
0 → 100644
View file @
97e56a1a
import
{
Box
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
keyframes
}
from
'
@chakra-ui/system
'
;
import
React
from
'
react
'
;
const
fade
=
keyframes
`
0% { left: 0%; transform: translateX(-1%); }
100% { left: '100%'; transform: translateX(-99%); }
`
;
const
ContentLoader
=
()
=>
{
return
(
<
Box
>
<
Box
width=
"100%"
height=
"6px"
position=
"relative"
_after=
{
{
content
:
`" "`
,
position
:
'
absolute
'
,
width
:
'
96px
'
,
height
:
'
6px
'
,
animation
:
`${ fade } 0.6s ease-in-out infinite alternate`
,
left
:
'
100%
'
,
top
:
0
,
backgroundColor
:
useColorModeValue
(
'
blackAlpha.700
'
,
'
whiteAlpha.700
'
),
borderRadius
:
'
full
'
,
}
}
/>
<
Text
mt=
{
6
}
variant=
"secondary"
>
Loading data, please wait...
</
Text
>
</
Box
>
);
};
export
default
ContentLoader
;
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