generated from theodorusclarence/ts-nextjs-tailwind-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added layout transition and fixed loading spinner
- Loading branch information
1 parent
7251299
commit ef376c8
Showing
6 changed files
with
70 additions
and
95 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
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 @@ | ||
// File: template.js | ||
import React from 'react'; | ||
export default function Template({ children }: { children: React.ReactNode }) { | ||
return <div>{children}</div>; | ||
} |
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,19 @@ | ||
'use client'; | ||
|
||
import { motion } from 'framer-motion'; | ||
|
||
const TransitionLayout = ({ children }) => ( | ||
<motion.div | ||
initial={{ x: 300, opacity: 0 }} | ||
animate={{ x: 0, opacity: 1 }} | ||
exit={{ x: 300, opacity: 0 }} | ||
transition={{ | ||
type: 'spring', | ||
stiffness: 260, | ||
damping: 20, | ||
}} | ||
> | ||
{children} | ||
</motion.div> | ||
); | ||
export default TransitionLayout; |
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 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 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