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
60fad46d
Commit
60fad46d
authored
Aug 28, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add share button to app modal and update colors
parent
bb881d1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
5 deletions
+28
-5
FavoriteIcon.tsx
ui/marketplace/FavoriteIcon.tsx
+3
-3
MarketplaceAppCard.tsx
ui/marketplace/MarketplaceAppCard.tsx
+2
-0
MarketplaceAppModal.tsx
ui/marketplace/MarketplaceAppModal.tsx
+20
-1
CopyToClipboard.tsx
ui/shared/CopyToClipboard.tsx
+3
-1
No files found.
ui/marketplace/FavoriteIcon.tsx
View file @
60fad46d
...
...
@@ -9,13 +9,13 @@ type Props = {
}
const
FavoriteIcon
=
({
isFavorite
,
color
}:
Props
)
=>
{
const
heartFilledColor
=
useColorModeValue
(
'
blue.
700
'
,
'
gray.4
00
'
);
const
defaultColor
=
isFavorite
?
heartFilledColor
:
'
gray.400
'
;
const
heartFilledColor
=
useColorModeValue
(
'
blue.
600
'
,
'
blue.3
00
'
);
const
defaultColor
=
isFavorite
?
heartFilledColor
:
(
color
||
'
gray.400
'
)
;
return
(
<
IconSvg
name=
{
isFavorite
?
'
heart_filled
'
:
'
heart_outline
'
}
color=
{
color
||
defaultColor
}
color=
{
defaultColor
}
boxSize=
{
5
}
/>
);
...
...
ui/marketplace/MarketplaceAppCard.tsx
View file @
60fad46d
...
...
@@ -185,6 +185,7 @@ const MarketplaceAppCard = ({
aria
-
label=
"Mark as favorite"
title=
"Mark as favorite"
variant=
"ghost"
colorScheme=
"gray"
w=
{
{
base
:
6
,
md
:
'
30px
'
}
}
h=
{
{
base
:
6
,
md
:
'
30px
'
}
}
onClick=
{
handleFavoriteClick
}
...
...
@@ -196,6 +197,7 @@ const MarketplaceAppCard = ({
icon=
"share"
size=
{
4
}
variant=
"ghost"
colorScheme=
"gray"
w=
{
{
base
:
6
,
md
:
'
30px
'
}
}
h=
{
{
base
:
6
,
md
:
'
30px
'
}
}
color=
"gray.400"
...
...
ui/marketplace/MarketplaceAppModal.tsx
View file @
60fad46d
...
...
@@ -10,7 +10,9 @@ import { ContractListTypes } from 'types/client/marketplace';
import
config
from
'
configs/app
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
nbsp
}
from
'
lib/html-entities
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
import
*
as
mixpanel
from
'
lib/mixpanel/index
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
...
...
@@ -113,6 +115,8 @@ const MarketplaceAppModal = ({
}
catch
(
err
)
{}
}
const
iconColor
=
useColorModeValue
(
'
blue.600
'
,
'
gray.400
'
);
return
(
<
Modal
isOpen=
{
Boolean
(
data
.
id
)
}
...
...
@@ -206,8 +210,23 @@ const MarketplaceAppModal = ({
colorScheme=
"gray"
w=
{
9
}
h=
{
8
}
flexShrink=
{
0
}
onClick=
{
handleFavoriteClick
}
icon=
{
<
FavoriteIcon
isFavorite=
{
isFavorite
}
color=
{
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
)
}
/>
}
icon=
{
<
FavoriteIcon
isFavorite=
{
isFavorite
}
color=
{
iconColor
}
/>
}
/>
<
CopyToClipboard
text=
{
isBrowser
()
?
window
.
location
.
origin
+
`/apps/${ id }`
:
''
}
icon=
"share"
size=
{
4
}
variant=
"outline"
colorScheme=
"gray"
w=
{
9
}
h=
{
8
}
color=
{
iconColor
}
_hover=
{
{
color
:
iconColor
}
}
display=
"inline-flex"
borderRadius=
"base"
/>
</
Flex
>
</
Flex
>
...
...
ui/shared/CopyToClipboard.tsx
View file @
60fad46d
...
...
@@ -13,9 +13,10 @@ export interface Props {
type
?:
'
link
'
;
icon
?:
IconName
;
variant
?:
string
;
colorScheme
?:
string
;
}
const
CopyToClipboard
=
({
text
,
className
,
isLoading
,
onClick
,
size
=
5
,
type
,
icon
,
variant
=
'
simple
'
}:
Props
)
=>
{
const
CopyToClipboard
=
({
text
,
className
,
isLoading
,
onClick
,
size
=
5
,
type
,
icon
,
variant
=
'
simple
'
,
colorScheme
}:
Props
)
=>
{
const
{
hasCopied
,
onCopy
}
=
useClipboard
(
text
,
1000
);
const
[
copied
,
setCopied
]
=
useState
(
false
);
// have to implement controlled tooltip because of the issue - https://github.com/chakra-ui/chakra-ui/issues/7107
...
...
@@ -48,6 +49,7 @@ const CopyToClipboard = ({ text, className, isLoading, onClick, size = 5, type,
boxSize=
{
size
}
color=
{
iconColor
}
variant=
{
variant
}
colorScheme=
{
colorScheme
}
display=
"inline-block"
flexShrink=
{
0
}
onClick=
{
handleClick
}
...
...
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