-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
react-multi-carousel updated deps and made a new code with typescript
- Loading branch information
1 parent
a1b8a96
commit ef7e934
Showing
19 changed files
with
188 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
examples/with-react-multi-carousel/components/carousel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import Carousel from 'react-multi-carousel' | ||
import { ResponsiveType } from 'react-multi-carousel/lib/types' | ||
import 'react-multi-carousel/lib/styles.css' | ||
import Image from 'next/image' | ||
|
||
const CarouselNext = () => { | ||
const BreakpointSlides: ResponsiveType = { | ||
desktop: { | ||
breakpoint: { max: 3000, min: 1024 }, | ||
items: 3, | ||
}, | ||
tablet: { | ||
breakpoint: { max: 1024, min: 530 }, | ||
items: 2, | ||
}, | ||
mobile: { | ||
breakpoint: { max: 530, min: 0 }, | ||
items: 1, | ||
}, | ||
} | ||
|
||
return ( | ||
<Carousel | ||
responsive={BreakpointSlides} | ||
ssr | ||
infinite | ||
itemClass="carousel-item" | ||
autoPlay | ||
> | ||
<Image | ||
alt="Gundam" | ||
src="/brucetang.jpg" | ||
layout="responsive" | ||
width={700} | ||
height={475} | ||
/> | ||
<Image | ||
alt="Musgo" | ||
src="/cameronsmith.jpg" | ||
layout="responsive" | ||
width={700} | ||
height={475} | ||
/> | ||
<Image | ||
alt="Valley" | ||
src="/ganapathykumar.jpg" | ||
layout="responsive" | ||
width={700} | ||
height={475} | ||
/> | ||
<Image | ||
alt="Beach" | ||
src="/roanlavery.jpg" | ||
layout="responsive" | ||
width={700} | ||
height={475} | ||
/> | ||
<Image | ||
alt="Torii" | ||
src="/tianshuliu.jpg" | ||
layout="responsive" | ||
width={700} | ||
height={475} | ||
/> | ||
</Carousel> | ||
) | ||
} | ||
|
||
export default CarouselNext |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, | ||
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; | ||
min-height: 100vh; | ||
background-color: #111; | ||
color: #d9d9d9; | ||
} | ||
|
||
main { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
h1 { | ||
margin: 2em 0; | ||
padding: 0 0.5rem; | ||
text-align: center; | ||
font-size: 3rem; | ||
} | ||
|
||
a { | ||
color: #0070f3; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
opacity: 0.8; | ||
} | ||
|
||
p { | ||
font-size: 2rem; | ||
} | ||
|
||
.container { | ||
padding: 2rem 1rem; | ||
display: flex; | ||
flex-flow: column nowrap; | ||
width: 100%; | ||
} | ||
|
||
.carousel-item { | ||
padding: 1em; | ||
pointer-events: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import '../globals.css' | ||
import type { AppProps } from 'next/app' | ||
|
||
function MyApp({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} /> | ||
} | ||
|
||
export default MyApp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Head from 'next/head' | ||
import CarouselNext from '../components/carousel' | ||
|
||
export default function Home() { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Create Next App</title> | ||
<meta name="description" content="Generated by create next app" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
</Head> | ||
<main> | ||
<h1> | ||
Welcome to <a href="https://nextjs.org">Next.js!</a> | ||
</h1> | ||
<p>react-multi-carousel</p> | ||
|
||
<div className="container"> | ||
<CarouselNext /> | ||
</div> | ||
</main> | ||
</> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.