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
b3bcc87a
Commit
b3bcc87a
authored
Sep 02, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
key icon for api keys
parent
47cac341
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
17 deletions
+34
-17
key.svg
icons/key.svg
+3
-0
ApiKeyListItem.tsx
ui/apiKey/ApiKeyTable/ApiKeyListItem.tsx
+2
-9
ApiKeyTableItem.tsx
ui/apiKey/ApiKeyTable/ApiKeyTableItem.tsx
+2
-8
ApiKeySnippet.tsx
ui/shared/ApiKeySnippet.tsx
+27
-0
No files found.
icons/key.svg
0 → 100644
View file @
b3bcc87a
<svg
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 24 24"
>
<path
fill-rule=
"evenodd"
clip-rule=
"evenodd"
d=
"M8 9a7 7 0 1 1 7 7h-2v2h-2v2H9v2H2v-5.414l6.148-6.148A7.025 7.025 0 0 1 8 9Zm3 5h4a5 5 0 1 0-4.786-3.547l.174.573L4 17.414V20h3v-2h2v-2h2v-2Zm4-3a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z"
fill=
"currentColor"
/>
</svg>
\ No newline at end of file
ui/apiKey/ApiKeyTable/ApiKeyListItem.tsx
View file @
b3bcc87a
import
{
HStack
,
Text
,
Box
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
ApiKey
}
from
'
types/api/account
'
;
import
type
{
ApiKey
}
from
'
types/api/account
'
;
import
AccountListItemMobile
from
'
ui/shared/AccountListItemMobile
'
;
import
AccountListItemMobile
from
'
ui/shared/AccountListItemMobile
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
ApiKeySnippet
from
'
ui/shared/ApiKeySnippet
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
interface
Props
{
interface
Props
{
...
@@ -25,13 +24,7 @@ const ApiKeyListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -25,13 +24,7 @@ const ApiKeyListItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return
(
return
(
<
AccountListItemMobile
>
<
AccountListItemMobile
>
<
Box
>
<
ApiKeySnippet
apiKey=
{
item
.
api_key
}
name=
{
item
.
name
}
/>
<
HStack
alignItems=
"flex-start"
>
<
Text
fontSize=
"md"
fontWeight=
{
600
}
>
{
item
.
api_key
}
</
Text
>
<
CopyToClipboard
text=
{
item
.
api_key
}
/>
</
HStack
>
<
Text
fontSize=
"sm"
marginTop=
{
0.5
}
variant=
"secondary"
>
{
item
.
name
}
</
Text
>
</
Box
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
</
AccountListItemMobile
>
</
AccountListItemMobile
>
);
);
...
...
ui/apiKey/ApiKeyTable/ApiKeyTableItem.tsx
View file @
b3bcc87a
import
{
import
{
Tr
,
Tr
,
Td
,
Td
,
HStack
,
Text
,
}
from
'
@chakra-ui/react
'
;
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
ApiKey
}
from
'
types/api/account
'
;
import
type
{
ApiKey
}
from
'
types/api/account
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
ApiKeySnippet
from
'
ui/shared/ApiKeySnippet
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
interface
Props
{
interface
Props
{
...
@@ -30,11 +28,7 @@ const ApiKeyTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -30,11 +28,7 @@ const ApiKeyTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return
(
return
(
<
Tr
alignItems=
"top"
key=
{
item
.
api_key
}
>
<
Tr
alignItems=
"top"
key=
{
item
.
api_key
}
>
<
Td
>
<
Td
>
<
HStack
>
<
ApiKeySnippet
apiKey=
{
item
.
api_key
}
name=
{
item
.
name
}
/>
<
Text
fontSize=
"md"
fontWeight=
{
600
}
>
{
item
.
api_key
}
</
Text
>
<
CopyToClipboard
text=
{
item
.
api_key
}
/>
</
HStack
>
<
Text
fontSize=
"sm"
marginTop=
{
0.5
}
variant=
"secondary"
>
{
item
.
name
}
</
Text
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
...
...
ui/shared/ApiKeySnippet.tsx
0 → 100644
View file @
b3bcc87a
import
{
Box
,
HStack
,
Icon
,
Flex
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
keyIcon
from
'
icons/key.svg
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
interface
Props
{
apiKey
:
string
;
name
:
string
;
}
const
ApiKeySnippet
=
({
apiKey
,
name
}:
Props
)
=>
{
return
(
<
HStack
spacing=
{
2
}
alignItems=
"start"
>
<
Icon
as=
{
keyIcon
}
boxSize=
{
6
}
color=
{
useColorModeValue
(
'
gray.500
'
,
'
gray.400
'
)
}
/>
<
Box
>
<
Flex
alignItems=
{
{
base
:
'
flex-start
'
,
lg
:
'
center
'
}
}
>
<
Text
fontSize=
"md"
lineHeight=
{
6
}
fontWeight=
{
600
}
mr=
{
1
}
>
{
apiKey
}
</
Text
>
<
CopyToClipboard
text=
{
apiKey
}
/>
</
Flex
>
{
name
&&
<
Text
fontSize=
"sm"
variant=
"secondary"
mt=
{
1
}
>
{
name
}
</
Text
>
}
</
Box
>
</
HStack
>
);
};
export
default
React
.
memo
(
ApiKeySnippet
);
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