Skip to content

Commit

Permalink
Merge pull request MyArtverse-Project#19 from Beta-Folf/fix-react-keys
Browse files Browse the repository at this point in the history
refactor: fix react keys where able to
  • Loading branch information
VulpoTheDev authored Jun 24, 2022
2 parents 30900c7 + fbae813 commit e8d3470
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/components/CardCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ const CardCarousel = ({ title, type, items = [] }: ICarouselProps) => {
<div id={styles["card-wrapper"]} ref={carouselRef}>
<div id={styles["cards"]}>
{items.length >= 5
? items.map((item, index) => (
<GalleryItem key={index} {...item} />
))
: items.map((item, index) => (
<GalleryItem key={index} {...item} />
))}
? items.map((item) => <GalleryItem key={item.link} {...item} />)
: items.map((item) => <GalleryItem key={item.link} {...item} />)}
{Array(5 - items.length)
.fill(0)
.map((_, index) => (
Expand Down
6 changes: 2 additions & 4 deletions src/components/CarouselMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ const CardCarousel = ({ title, type, items = [] }: ICarouselProps) => {
<div id={styles["card-wrapper"]} ref={carouselRef}>
<div id={styles["cards"]}>
{items.length >= 5
? items.map((item, index) => (
<GalleryItem key={index} {...item} />
))
? items.map((item) => <GalleryItem key={item.link} {...item} />)
: items.map((item, index) => (
<GalleryItem key={index} {...item} />
<GalleryItem key={item.link} {...item} />
))}
{Array(5 - items.length)
.fill(0)
Expand Down
4 changes: 2 additions & 2 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Head from "next/head"
import Header from "./Header"
import Footer from "./Footer"
// import Footer from "./Footer"

export default function Layout({ children }) {
return (
Expand All @@ -16,7 +16,7 @@ export default function Layout({ children }) {
<div>
<Header />
{children}
<Footer />
{/* <Footer /> */}
</div>
</>
)
Expand Down

0 comments on commit e8d3470

Please sign in to comment.