-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
146 additions
and
41 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const Analytics = () => { | ||
return ( | ||
<div className="flex min-h-screen flex-col items-center justify-center p-24"> | ||
<h1 className="text-4xl">Hello Analytics!</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Analytics; |
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
12 changes: 10 additions & 2 deletions
12
apps/next-app/src/shared/components/Crossmark/crossmark.component.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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import CrossmarkSVG from 'assets/cross-mark.svg'; | ||
|
||
export const Crossmark = () => { | ||
interface CrossmarkProps { | ||
isError?: boolean; | ||
} | ||
|
||
export const Crossmark = ({ isError }: CrossmarkProps) => { | ||
return ( | ||
<CrossmarkSVG className="w-4 h-4 mr-1.5 text-gray-400 flex-shrink-0" /> | ||
<CrossmarkSVG | ||
className={`w-4 h-4 mr-1.5 ${ | ||
isError ? 'text-red-400' : 'text-gray-400' | ||
} flex-shrink-0`} | ||
/> | ||
); | ||
}; |
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 @@ | ||
export { Layout } from './layout.component'; |
29 changes: 29 additions & 0 deletions
29
apps/next-app/src/shared/components/Layout/layout.component.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,29 @@ | ||
import { ROUTES } from 'constants/ROUTES'; | ||
import Link from 'next/link'; | ||
import { ReactNode } from 'react'; | ||
|
||
interface LayoutProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const Layout = ({ children }: LayoutProps) => { | ||
return ( | ||
<div> | ||
<header className="flex gap-8 py-8 px-8"> | ||
<Link href={ROUTES.PROFILE} className="text-white"> | ||
Profile | ||
</Link> | ||
<Link href={ROUTES.DASHBOARD} className="text-white"> | ||
Dashboard | ||
</Link> | ||
<Link href={ROUTES.SUBSCRIPTION} className="text-white"> | ||
Subscription | ||
</Link> | ||
<Link href={ROUTES.ANALYTICS} className="text-white"> | ||
Analytics | ||
</Link> | ||
</header> | ||
{children} | ||
</div> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
apps/next-app/src/shared/components/subscriptions/TransactionHistory/index.ts
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 @@ | ||
export { TransactionHistory } from './transactionHistory.component'; |
39 changes: 39 additions & 0 deletions
39
...p/src/shared/components/subscriptions/TransactionHistory/transactionHistory.component.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,39 @@ | ||
import { format, fromUnixTime } from 'date-fns'; | ||
import { Checkmark } from 'shared/components/Checkmark'; | ||
import { Crossmark } from 'shared/components/Crossmark'; | ||
import { getSubscriptionPrice } from 'utils/getSubscriptionPrice'; | ||
|
||
interface TransactionHistoryProps { | ||
transactions: any; | ||
} | ||
|
||
export const TransactionHistory = ({ | ||
transactions, | ||
}: TransactionHistoryProps) => { | ||
return ( | ||
<div className="max-w-xl w-full"> | ||
<h2 className="mt-8 text-2xl">Transaction history</h2> | ||
<div className="flex flex-col"> | ||
{transactions.charges.data.map( | ||
({ id, created, description, amount, currency, status }: any) => ( | ||
<div | ||
key={id} | ||
className="flex justify-between w-full border-b-2 border-slate-800 py-6" | ||
> | ||
<div> | ||
{description}{' '} | ||
<span className="text-slate-400"> | ||
({format(fromUnixTime(created), 'Pp')}) | ||
</span> | ||
</div> | ||
<div> | ||
{getSubscriptionPrice(amount)} {currency.toUpperCase()} | ||
</div> | ||
{status === 'succeeded' ? <Checkmark /> : <Crossmark isError />} | ||
</div> | ||
) | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.