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
8ef0807c
Commit
8ef0807c
authored
Jul 17, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move favorite icon to separate file
parent
0b447d5d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
36 deletions
+32
-36
FeaturedApp.tsx
ui/marketplace/Banner/FeaturedApp.tsx
+2
-9
FeaturedAppMobile.tsx
ui/marketplace/Banner/FeaturedAppMobile.tsx
+2
-10
FavoriteIcon.tsx
ui/marketplace/FavoriteIcon.tsx
+24
-0
MarketplaceAppCard.tsx
ui/marketplace/MarketplaceAppCard.tsx
+2
-10
MarketplaceAppModal.tsx
ui/marketplace/MarketplaceAppModal.tsx
+2
-7
No files found.
ui/marketplace/Banner/FeaturedApp.tsx
View file @
8ef0807c
...
...
@@ -7,8 +7,8 @@ import type { MarketplaceAppPreview } from 'types/client/marketplace';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
*
as
mixpanel
from
'
lib/mixpanel/index
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
FavoriteIcon
from
'
../FavoriteIcon
'
;
import
MarketplaceAppIntegrationIcon
from
'
../MarketplaceAppIntegrationIcon
'
;
import
FeaturedAppMobile
from
'
./FeaturedAppMobile
'
;
...
...
@@ -32,7 +32,6 @@ const FeaturedApp = ({
const
categoriesLabel
=
categories
.
join
(
'
,
'
);
const
backgroundColor
=
useColorModeValue
(
'
purple.50
'
,
'
whiteAlpha.100
'
);
const
heartFilledColor
=
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
);
const
handleInfoClick
=
useCallback
((
event
:
MouseEvent
)
=>
{
event
.
preventDefault
();
...
...
@@ -136,13 +135,7 @@ const FeaturedApp = ({
w=
{
9
}
h=
{
8
}
onClick=
{
handleFavoriteClick
}
icon=
{
(
<
IconSvg
name=
{
isFavorite
?
'
heart_filled
'
:
'
heart_outline
'
}
color=
{
isFavorite
?
heartFilledColor
:
'
gray.400
'
}
boxSize=
{
5
}
/>
)
}
icon=
{
<
FavoriteIcon
isFavorite=
{
isFavorite
}
/>
}
/>
)
}
</
Flex
>
...
...
ui/marketplace/Banner/FeaturedAppMobile.tsx
View file @
8ef0807c
...
...
@@ -4,8 +4,7 @@ import React from 'react';
import
type
{
MarketplaceAppPreview
}
from
'
types/client/marketplace
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
FavoriteIcon
from
'
../FavoriteIcon
'
;
import
MarketplaceAppCardLink
from
'
../MarketplaceAppCardLink
'
;
import
MarketplaceAppIntegrationIcon
from
'
../MarketplaceAppIntegrationIcon
'
;
...
...
@@ -36,7 +35,6 @@ const FeaturedAppMobile = ({
const
categoriesLabel
=
categories
.
join
(
'
,
'
);
const
logoUrl
=
useColorModeValue
(
logo
,
logoDarkMode
||
logo
);
const
heartFilledColor
=
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
);
return
(
<
LinkBox
...
...
@@ -145,13 +143,7 @@ const FeaturedAppMobile = ({
w=
{
9
}
h=
{
8
}
onClick=
{
onFavoriteClick
}
icon=
{
(
<
IconSvg
name=
{
isFavorite
?
'
heart_filled
'
:
'
heart_outline
'
}
color=
{
isFavorite
?
heartFilledColor
:
'
gray.400
'
}
boxSize=
{
5
}
/>
)
}
icon=
{
<
FavoriteIcon
isFavorite=
{
isFavorite
}
/>
}
/>
)
}
</
Flex
>
...
...
ui/marketplace/FavoriteIcon.tsx
0 → 100644
View file @
8ef0807c
import
{
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
type
Props
=
{
isFavorite
:
boolean
;
color
?:
string
;
}
const
FavoriteIcon
=
({
isFavorite
,
color
}:
Props
)
=>
{
const
heartFilledColor
=
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
);
const
defaultColor
=
isFavorite
?
heartFilledColor
:
'
gray.400
'
;
return
(
<
IconSvg
name=
{
isFavorite
?
'
heart_filled
'
:
'
heart_outline
'
}
color=
{
color
||
defaultColor
}
boxSize=
{
5
}
/>
);
};
export
default
FavoriteIcon
;
ui/marketplace/MarketplaceAppCard.tsx
View file @
8ef0807c
...
...
@@ -5,9 +5,9 @@ import React, { useCallback } from 'react';
import
type
{
MarketplaceAppWithSecurityReport
,
ContractListTypes
,
AppRating
}
from
'
types/client/marketplace
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
AppSecurityReport
from
'
./AppSecurityReport
'
;
import
FavoriteIcon
from
'
./FavoriteIcon
'
;
import
MarketplaceAppCardLink
from
'
./MarketplaceAppCardLink
'
;
import
MarketplaceAppIntegrationIcon
from
'
./MarketplaceAppIntegrationIcon
'
;
import
Rating
from
'
./Rating/Rating
'
;
...
...
@@ -56,8 +56,6 @@ const MarketplaceAppCard = ({
const
isMobile
=
useIsMobile
();
const
categoriesLabel
=
categories
.
join
(
'
,
'
);
const
heartFilledColor
=
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
);
const
handleInfoClick
=
useCallback
((
event
:
MouseEvent
)
=>
{
event
.
preventDefault
();
onInfoClick
(
id
);
...
...
@@ -189,13 +187,7 @@ const MarketplaceAppCard = ({
w=
{
{
base
:
6
,
md
:
'
30px
'
}
}
h=
{
{
base
:
6
,
md
:
'
30px
'
}
}
onClick=
{
handleFavoriteClick
}
icon=
{
(
<
IconSvg
name=
{
isFavorite
?
'
heart_filled
'
:
'
heart_outline
'
}
color=
{
isFavorite
?
heartFilledColor
:
'
gray.400
'
}
boxSize=
{
5
}
/>
)
}
icon=
{
<
FavoriteIcon
isFavorite=
{
isFavorite
}
/>
}
/>
</
Flex
>
</
Flex
>
...
...
ui/marketplace/MarketplaceAppModal.tsx
View file @
8ef0807c
...
...
@@ -15,6 +15,7 @@ import type { IconName } from 'ui/shared/IconSvg';
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
AppSecurityReport
from
'
./AppSecurityReport
'
;
import
FavoriteIcon
from
'
./FavoriteIcon
'
;
import
MarketplaceAppModalLink
from
'
./MarketplaceAppModalLink
'
;
import
Rating
from
'
./Rating/Rating
'
;
import
type
{
RateFunction
}
from
'
./Rating/useRatings
'
;
...
...
@@ -206,13 +207,7 @@ const MarketplaceAppModal = ({
w=
{
9
}
h=
{
8
}
onClick=
{
handleFavoriteClick
}
icon=
{
(
<
IconSvg
name=
{
isFavorite
?
'
heart_filled
'
:
'
heart_outline
'
}
color=
{
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
)
}
boxSize=
{
5
}
/>
)
}
icon=
{
<
FavoriteIcon
isFavorite=
{
isFavorite
}
color=
{
useColorModeValue
(
'
blue.700
'
,
'
gray.400
'
)
}
/>
}
/>
</
Flex
>
</
Flex
>
...
...
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