Skip to content

Commit

Permalink
added fade in for pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-Gordon committed Mar 28, 2024
1 parent 45cdb08 commit 605381f
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 19 deletions.
9 changes: 9 additions & 0 deletions src/app/@auth/(.)confirm/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import { useSelector } from 'react-redux';
import { RootState } from '@/GlobalRedux/store';
import { Contact } from '@/app/types/types';

// motion
import { motion } from 'framer-motion';

interface ConfirmProps {
showConfirm: boolean;
}
Expand Down Expand Up @@ -85,6 +88,11 @@ export default function Page({ showConfirm }: ConfirmProps) {

return (
<>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
>
<DrawerHeader>
<DrawerTitle className='grid grid-cols-3 items-center'>
<div
Expand Down Expand Up @@ -144,6 +152,7 @@ export default function Page({ showConfirm }: ConfirmProps) {
</button>

</DrawerFooter>
</motion.div>
</>
);
}
20 changes: 14 additions & 6 deletions src/app/@auth/(.)send/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import Link from 'next/link';
import useFindPayeeName from '@/app/hooks/useFindPayeeName';
import { useSelector } from 'react-redux';
import { RootState } from '@/GlobalRedux/store';

// motion
import { motion } from 'framer-motion';


export default function Page() {
const router = useRouter();

Expand All @@ -28,7 +33,11 @@ export default function Page() {

return (
<>
<div className='grid'>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className='grid'>
<DrawerHeader>
<DrawerTitle className='grid grid-cols-3 items-center'>
<div
Expand All @@ -38,7 +47,9 @@ export default function Page() {
>
<BackButton />
</div>
<p className='text-center'>{payee && useFindPayeeName(payee, contactsState)}</p>
<p className='text-center'>
{payee && useFindPayeeName(payee, contactsState)}
</p>
<div className='ml-auto'>
<Link
className='h-auto w-auto'
Expand All @@ -54,11 +65,8 @@ export default function Page() {
</div>
</DrawerTitle>
</DrawerHeader>
</div>


<SendUsdc />

</motion.div>
</>
);
}
21 changes: 11 additions & 10 deletions src/app/components/RecentPayee.tsx/RecentPayee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import useFindPayeeName from '@/app/hooks/useFindPayeeName';
// If a matching contact is found, use its name, otherwise use truncated payee address
const payeeName = matchedContact ? matchedContact.name : truncateEthAddress(payee);


return (
<>
<div key={payee}>
Expand All @@ -43,7 +42,7 @@ import useFindPayeeName from '@/app/hooks/useFindPayeeName';
<Avatar className='h-9 w-9 bg-white'></Avatar>
<div className='ml-4 space-y-1'>
<div className='text-sm font-medium leading-none'>
{useFindPayeeName(payee, contactsState)}
{useFindPayeeName(payee)}
</div>
</div>
</div>
Expand All @@ -65,19 +64,21 @@ export default function RecentPayee(): JSX.Element {
(state: RootState) => state.contacts.value
);

const transactionState = useSelector(
const transactionstate = useSelector(
(state: RootState) => state.transactions.value
);
);

// get recent transactions
useEffect(() => {

const uniquePayees = Array.from(
new Set(
transactionState.map((transaction) => transaction.to || transaction.from)
)
);
setPayees(uniquePayees);
const uniquePayees = Array.from(
new Set(
transactionstate.map(
(transaction) => transaction.to || transaction.from
)
)
);
setPayees(uniquePayees);
/* const fetchRecentTransactions = async () => {
try {
const recentTransactions = await useGetRecentTransactions(address);
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/Success/Success.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ export default function Success({
dispatch(setBalance(r.data.result));
setTimeout(() => {
setDrawerOpen(false);

router.push(`/tx?hash=${transactionHash}`);
dispatch(setSheet(false));

}, 1000);
})
.catch((e) => {
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function RootLayout({
<meta name='format-detection' content='telephone=no' />
<meta name='mobile-web-app-capable' content='yes' />
<meta name='msapplication-config' content='/icons/browserconfig.xml' />
<meta name='msapplication-TileColor' content='#2B5797' />
<meta name='msapplication-TileColor' content='#020817' />
<meta name='msapplication-tap-highlight' content='no' />
<meta name='theme-color' content='#020817' />
<link rel='apple-touch-icon' href='/icons/touch-icon-iphone.png' />
Expand Down Expand Up @@ -133,7 +133,7 @@ export default function RootLayout({
<link
rel='mask-icon'
href='/icons/safari-pinned-tab.svg'
color='#5bbad5'
color='#020817'
/>
<link rel='shortcut icon' href='/favicon.ico' />
<link rel='preconnect' href='https://fonts.googleapis.com'></link>
Expand Down
3 changes: 3 additions & 0 deletions src/app/transactions/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export default function Page() {
<>

<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className='from-background to bg-accent/80 absolute z-50 min-h-screen w-full overflow-hidden bg-gradient-to-br text-xl backdrop-blur-xl'
>
<Card style={{ border: '0px' }} className='bg-transparent'>
Expand Down
4 changes: 4 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
backdrop-filter: blur(100px) ;
-webkit-backdrop-filter: blur(100px) ;
} */

html {
background-color: #020817;
}
@layer base {
:root {
--background: 0 0% 100%;
Expand Down

0 comments on commit 605381f

Please sign in to comment.