Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
sujata
/
Akruti-Frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 416dd34c
authored
2026-03-12 12:18:36 +0530
by
Ravindra Kanojiya
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated sorting
1 parent
1d569189
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
38 deletions
components/Collection/InnerDetails.js
components/Collection/InnerDetailsSubCategory.js
components/Layout/Header.js
styles/globals.css
components/Collection/InnerDetails.js
View file @
416dd34
...
@@ -24,8 +24,15 @@ const InnerDetails = ({ subCategories }) => {
...
@@ -24,8 +24,15 @@ const InnerDetails = ({ subCategories }) => {
// );
// );
const
sortedSubCategories
=
[...
subCategories
].
sort
((
a
,
b
)
=>
{
const
sortedSubCategories
=
[...
subCategories
].
sort
((
a
,
b
)
=>
{
if
(
sort
===
"name-asc"
)
return
a
.
title
.
localeCompare
(
b
.
title
);
if
(
sort
===
"name-desc"
)
return
b
.
title
.
localeCompare
(
a
.
title
);
// Default: sort by rank
return
(
Number
(
a
.
rank
)
||
999
)
-
(
Number
(
b
.
rank
)
||
999
);
return
(
Number
(
a
.
rank
)
||
999
)
-
(
Number
(
b
.
rank
)
||
999
);
});
});
// const sortedSubCategories = [...subCategories].sort((a, b) => {
// return (Number(a.rank) || 999) - (Number(b.rank) || 999);
// });
return
(
return
(
<
section
className
=
"collection-m-section sec_padd"
>
<
section
className
=
"collection-m-section sec_padd"
>
<
div
className
=
"custom_container container"
>
<
div
className
=
"custom_container container"
>
...
...
components/Collection/InnerDetailsSubCategory.js
View file @
416dd34
...
@@ -7,7 +7,6 @@ import FilterButton from "../Common/FilterButton";
...
@@ -7,7 +7,6 @@ import FilterButton from "../Common/FilterButton";
import
{
cleanImage
}
from
"../services/imageHandling"
;
import
{
cleanImage
}
from
"../services/imageHandling"
;
const
InnerDetailsSubCategory
=
({
products
})
=>
{
const
InnerDetailsSubCategory
=
({
products
})
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
{
category
,
subCategory
}
=
router
.
query
;
const
{
category
,
subCategory
}
=
router
.
query
;
const
[
showFilter
,
setShowFilter
]
=
useState
(
false
);
const
[
showFilter
,
setShowFilter
]
=
useState
(
false
);
...
@@ -20,12 +19,17 @@ const [showFilter, setShowFilter] = useState(false);
...
@@ -20,12 +19,17 @@ const [showFilter, setShowFilter] = useState(false);
};
};
// Optional sorting
// Optional sorting
const
sortedProducts
=
[...
products
].
sort
((
a
,
b
)
=>
{
// const sortedProducts = [...products].sort((a, b) => {
if
(
sort
===
"name-asc"
)
return
a
.
title
.
localeCompare
(
b
.
title
);
// if (sort === "name-asc") return a.title.localeCompare(b.title);
if
(
sort
===
"name-desc"
)
return
b
.
title
.
localeCompare
(
a
.
title
);
// if (sort === "name-desc") return b.title.localeCompare(a.title);
return
0
;
// return 0;
});
// });
const
sortedSubCategories
=
[...
products
].
sort
((
a
,
b
)
=>
{
if
(
sort
===
"name-asc"
)
return
a
.
title
.
localeCompare
(
b
.
title
);
if
(
sort
===
"name-desc"
)
return
b
.
title
.
localeCompare
(
a
.
title
);
// Default: sort by rank
return
(
Number
(
a
.
rank
)
||
999
)
-
(
Number
(
b
.
rank
)
||
999
);
});
return
(
return
(
<
section
className
=
"collection-m-section sec_padd"
>
<
section
className
=
"collection-m-section sec_padd"
>
<
div
className
=
"custom_container container"
>
<
div
className
=
"custom_container container"
>
...
@@ -72,7 +76,7 @@ const [showFilter, setShowFilter] = useState(false);
...
@@ -72,7 +76,7 @@ const [showFilter, setShowFilter] = useState(false);
{
/* Products */
}
{
/* Products */
}
<
Row
>
<
Row
>
{
sorted
Product
s
.
map
((
product
)
=>
(
{
sorted
SubCategorie
s
.
map
((
product
)
=>
(
<
Col
md
=
{
6
}
key
=
{
product
.
productSlug
}
>
<
Col
md
=
{
6
}
key
=
{
product
.
productSlug
}
>
<
div
className
=
"collections-item"
>
<
div
className
=
"collections-item"
>
<
Link
<
Link
...
...
components/Layout/Header.js
View file @
416dd34
...
@@ -239,7 +239,7 @@ export default function Navigation({ collectionsData = [] }) {
...
@@ -239,7 +239,7 @@ export default function Navigation({ collectionsData = [] }) {
}}
}}
className
=
{
className
=
{
collectionL1
.
categorySlug
===
collectionL1
.
categorySlug
===
cat
.
categorySlug
cat
.
categorySlug
?
"active"
?
"active"
:
""
:
""
}
}
...
@@ -263,7 +263,7 @@ export default function Navigation({ collectionsData = [] }) {
...
@@ -263,7 +263,7 @@ export default function Navigation({ collectionsData = [] }) {
onMouseEnter
=
{()
=>
setCollectionL2
(
sub
)}
onMouseEnter
=
{()
=>
setCollectionL2
(
sub
)}
className
=
{
className
=
{
collectionL2
.
subCategorySlug
===
collectionL2
.
subCategorySlug
===
sub
.
subCategorySlug
sub
.
subCategorySlug
?
"active"
?
"active"
:
""
:
""
}
}
...
@@ -655,32 +655,32 @@ export default function Navigation({ collectionsData = [] }) {
...
@@ -655,32 +655,32 @@ export default function Navigation({ collectionsData = [] }) {
{
/* ‹ Brands */
}
{
/* ‹ Brands */
}
<
/button
>
<
/button
>
<
Link
href
=
"/brands/valcucine"
>
<
Link
href
=
"/brands/valcucine"
>
<
Image
<
Image
width
=
{
177
}
width
=
{
177
}
height
=
{
60
}
height
=
{
60
}
src
=
"/image/header-logo/valcucine.png"
src
=
"/image/header-logo/valcucine.png"
/
>
/
>
<
/Link
>
<
/Link
>
<
Link
href
=
"/brands/rimadesio"
>
<
Link
href
=
"/brands/rimadesio"
>
<
Image
<
Image
width
=
{
177
}
width
=
{
177
}
height
=
{
60
}
height
=
{
60
}
src
=
"/image/header-logo/rimadesio.png"
src
=
"/image/header-logo/rimadesio.png"
/
>
/
>
<
/Link
>
<
/Link
>
<
Link
href
=
"/brands/inalco"
>
<
Link
href
=
"/brands/inalco"
>
<
Image
<
Image
width
=
{
177
}
width
=
{
177
}
height
=
{
60
}
height
=
{
60
}
src
=
"/image/header-logo/inalco.png"
src
=
"/image/header-logo/inalco.png"
/
>
/
>
<
/Link
>
<
/Link
>
<
/
>
<
/
>
)}
)}
<
/Nav
>
<
/Nav
>
...
...
styles/globals.css
View file @
416dd34
...
@@ -754,11 +754,18 @@ input:focus-visible {
...
@@ -754,11 +754,18 @@ input:focus-visible {
.dropdown-custom
{
.dropdown-custom
{
/* position: relative; */
/* position: relative; */
}
}
.navbar-expand-lg
.navbar-nav
.dropdown-menu
{
transition
:
all
0.2s
;
transform
:
translateY
(
40px
);
}
.dropdown-custom
:hover
.dropdown-menu
{
.dropdown-custom
:hover
.dropdown-menu
{
display
:
block
;
display
:
block
;
visibility
:
visible
;
visibility
:
visible
;
opacity
:
9
;
opacity
:
9
;
visibility
:
visible
;
transform
:
translateY
(
0
);
opacity
:
1
;
}
}
.navList01
{
.navList01
{
list-style
:
none
;
list-style
:
none
;
...
@@ -1126,6 +1133,7 @@ footer a:hover {
...
@@ -1126,6 +1133,7 @@ footer a:hover {
}
}
.custom_container
p
{
.custom_container
p
{
margin
:
0.5rem
0
!important
;
margin
:
0.5rem
0
!important
;
/* line-height: 1.2rem; */
}
}
.innercontent-section
.contactPage-address
.list-unstyled
{
.innercontent-section
.contactPage-address
.list-unstyled
{
margin-top
:
1rem
;
margin-top
:
1rem
;
...
@@ -1416,7 +1424,7 @@ footer a:hover {
...
@@ -1416,7 +1424,7 @@ footer a:hover {
bottom
:
inherit
;
bottom
:
inherit
;
}
}
body
{
body
{
font-size
:
1
4
px
;
font-size
:
1
6
px
;
}
}
footer
a
,
footer
a
,
footer
li
{
footer
li
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment