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
e0cda4cb
Commit
e0cda4cb
authored
Feb 14, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused components
parent
320ee8e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
106 deletions
+0
-106
MarketplaceCategoriesMenu.tsx
ui/marketplace/MarketplaceCategoriesMenu.tsx
+0
-70
MarketplaceCategoriesMenuItem.tsx
ui/marketplace/MarketplaceCategoriesMenuItem.tsx
+0
-36
No files found.
ui/marketplace/MarketplaceCategoriesMenu.tsx
deleted
100644 → 0
View file @
320ee8e6
import
{
Box
,
Button
,
Menu
,
MenuButton
,
MenuList
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
MarketplaceCategory
}
from
'
types/client/marketplace
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
MarketplaceCategoriesMenuItem
from
'
./MarketplaceCategoriesMenuItem
'
;
type
Props
=
{
categories
:
Array
<
string
>
;
selectedCategoryId
:
string
;
onSelect
:
(
category
:
string
)
=>
void
;
isLoading
:
boolean
;
}
const
MarketplaceCategoriesMenu
=
({
selectedCategoryId
,
onSelect
,
categories
,
isLoading
}:
Props
)
=>
{
const
options
=
React
.
useMemo
(()
=>
([
MarketplaceCategory
.
FAVORITES
,
MarketplaceCategory
.
ALL
,
...
categories
,
]),
[
categories
]);
if
(
isLoading
)
{
return
(
<
Skeleton
h=
"40px"
w=
{
{
base
:
'
100%
'
,
sm
:
'
120px
'
}
}
borderRadius=
"base"
mb=
{
{
base
:
2
,
sm
:
0
}
}
mr=
{
{
base
:
0
,
sm
:
2
}
}
/>
);
}
return
(
<
Menu
>
<
MenuButton
as=
{
Button
}
mb=
{
{
base
:
2
,
sm
:
0
}
}
mr=
{
{
base
:
0
,
sm
:
2
}
}
size=
"md"
variant=
"outline"
colorScheme=
"gray"
flexShrink=
{
0
}
>
<
Box
as=
"span"
display=
"flex"
alignItems=
"center"
>
{
selectedCategoryId
}
<
IconSvg
transform=
"rotate(-90deg)"
ml=
{
{
base
:
'
auto
'
,
sm
:
1
}
}
name=
"arrows/east-mini"
w=
{
5
}
h=
{
5
}
/>
</
Box
>
</
MenuButton
>
<
MenuList
zIndex=
{
3
}
>
{
options
.
map
((
category
:
string
)
=>
(
<
MarketplaceCategoriesMenuItem
key=
{
category
}
id=
{
category
}
onClick=
{
onSelect
}
/>
))
}
</
MenuList
>
</
Menu
>
);
};
export
default
React
.
memo
(
MarketplaceCategoriesMenu
);
ui/marketplace/MarketplaceCategoriesMenuItem.tsx
deleted
100644 → 0
View file @
320ee8e6
import
{
MenuItem
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
{
MarketplaceCategory
}
from
'
types/client/marketplace
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
type
Props
=
{
id
:
string
;
onClick
:
(
category
:
string
)
=>
void
;
}
const
ICONS
:
Record
<
string
,
IconName
>
=
{
[
MarketplaceCategory
.
FAVORITES
]:
'
star_filled
'
,
};
const
MarketplaceCategoriesMenuItem
=
({
id
,
onClick
}:
Props
)
=>
{
const
handleSelection
=
useCallback
(()
=>
{
onClick
(
id
);
},
[
id
,
onClick
]);
return
(
<
MenuItem
key=
{
id
}
onClick=
{
handleSelection
}
display=
"flex"
alignItems=
"center"
>
{
id
in
ICONS
&&
<
IconSvg
mr=
{
3
}
name=
{
ICONS
[
id
]
}
w=
{
4
}
h=
{
4
}
color=
"blackAlpha.800"
/>
}
{
id
}
</
MenuItem
>
);
};
export
default
MarketplaceCategoriesMenuItem
;
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