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
2d26d672
Commit
2d26d672
authored
Jul 17, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove padding on last element
parent
8ef0807c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
PopoverContent.tsx
ui/marketplace/Rating/PopoverContent.tsx
+1
-1
Rating.tsx
ui/marketplace/Rating/Rating.tsx
+1
-1
Stars.tsx
ui/marketplace/Rating/Stars.tsx
+4
-3
No files found.
ui/marketplace/Rating/PopoverContent.tsx
View file @
2d26d672
...
@@ -69,7 +69,7 @@ const PopoverContent = ({ appId, rating, userRating, rate, isSending, source }:
...
@@ -69,7 +69,7 @@ const PopoverContent = ({ appId, rating, userRating, rate, isSending, source }:
onClickFactory=
{
handleRateFactory
}
onClickFactory=
{
handleRateFactory
}
/>
/>
{
(
filledIndex
>=
0
)
&&
(
{
(
filledIndex
>=
0
)
&&
(
<
Text
fontSize=
"md"
ml=
{
2
}
>
<
Text
fontSize=
"md"
ml=
{
3
}
>
{
ratingDescriptions
[
filledIndex
]
}
{
ratingDescriptions
[
filledIndex
]
}
</
Text
>
</
Text
>
)
}
)
}
...
...
ui/marketplace/Rating/Rating.tsx
View file @
2d26d672
...
@@ -50,7 +50,7 @@ const Rating = ({
...
@@ -50,7 +50,7 @@ const Rating = ({
{
fullView
&&
(
{
fullView
&&
(
<>
<>
<
Stars
filledIndex=
{
(
rating
?.
value
||
0
)
-
1
}
/>
<
Stars
filledIndex=
{
(
rating
?.
value
||
0
)
-
1
}
/>
<
Text
fontSize=
"md"
ml=
{
1
}
>
{
rating
?.
value
}
</
Text
>
<
Text
fontSize=
"md"
ml=
{
2
}
>
{
rating
?.
value
}
</
Text
>
</>
</>
)
}
)
}
<
Box
ref=
{
popoverRef
}
>
<
Box
ref=
{
popoverRef
}
>
...
...
ui/marketplace/Rating/Stars.tsx
View file @
2d26d672
import
{
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
MouseEventHandler
}
from
'
react
'
;
import
type
{
MouseEventHandler
}
from
'
react
'
;
...
@@ -15,7 +15,7 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }:
...
@@ -15,7 +15,7 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }:
const
disabledStarColor
=
useColorModeValue
(
'
gray.200
'
,
'
gray.700
'
);
const
disabledStarColor
=
useColorModeValue
(
'
gray.200
'
,
'
gray.700
'
);
const
outlineStartColor
=
onMouseOverFactory
?
'
gray.400
'
:
disabledStarColor
;
const
outlineStartColor
=
onMouseOverFactory
?
'
gray.400
'
:
disabledStarColor
;
return
(
return
(
<>
<
Flex
>
{
Array
(
5
).
fill
(
null
).
map
((
_
,
index
)
=>
(
{
Array
(
5
).
fill
(
null
).
map
((
_
,
index
)
=>
(
<
IconSvg
<
IconSvg
key=
{
index
}
key=
{
index
}
...
@@ -24,13 +24,14 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }:
...
@@ -24,13 +24,14 @@ const Stars = ({ filledIndex, onMouseOverFactory, onMouseOut, onClickFactory }:
w=
{
6
}
// 5 + 1 padding
w=
{
6
}
// 5 + 1 padding
h=
{
5
}
h=
{
5
}
pr=
{
1
}
// use padding intead of margin so that there are no empty spaces between stars without hover effect
pr=
{
1
}
// use padding intead of margin so that there are no empty spaces between stars without hover effect
_last=
{
{
w
:
5
,
pr
:
0
}
}
cursor=
{
onMouseOverFactory
?
'
pointer
'
:
'
default
'
}
cursor=
{
onMouseOverFactory
?
'
pointer
'
:
'
default
'
}
onMouseOver=
{
onMouseOverFactory
?.(
index
)
}
onMouseOver=
{
onMouseOverFactory
?.(
index
)
}
onMouseOut=
{
onMouseOut
}
onMouseOut=
{
onMouseOut
}
onClick=
{
onClickFactory
?.(
index
)
}
onClick=
{
onClickFactory
?.(
index
)
}
/>
/>
))
}
))
}
</>
</
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