-
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.
Merge branch 'main' into e-1694-designsystem-cardstemplate-transactio…
…n-card-refacto-project
- Loading branch information
Showing
40 changed files
with
652 additions
and
66 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
21 changes: 21 additions & 0 deletions
21
app/programs/[programId]/_context/program-details-panels/program-details-panels.context.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,21 @@ | ||
"use client"; | ||
|
||
import { PropsWithChildren, RefObject, createContext, useRef } from "react"; | ||
|
||
import { SidePanelGroupRef } from "@/shared/features/side-panel-group/side-panel-group.types"; | ||
|
||
interface ProgramDetailsPanelContextInterface { | ||
transactionPanel: RefObject<SidePanelGroupRef>; | ||
} | ||
|
||
export const ProgramDetailsPanelContext = createContext<ProgramDetailsPanelContextInterface>({ | ||
transactionPanel: { current: null }, | ||
}); | ||
|
||
export function ProgramDetailsPanelProvider({ children }: PropsWithChildren) { | ||
const transactionPanel = useRef<SidePanelGroupRef>(null); | ||
|
||
return ( | ||
<ProgramDetailsPanelContext.Provider value={{ transactionPanel }}>{children}</ProgramDetailsPanelContext.Provider> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
app/programs/[programId]/_features/transactions-sidepanel/transaction-sidepanel.en.json
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 @@ | ||
{ | ||
"transaction": { | ||
"title": "Transactions" | ||
}, | ||
"export": { | ||
"title": "Export" | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
app/programs/[programId]/_features/transactions-sidepanel/transactions-sidepanel.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,36 @@ | ||
import { useContext } from "react"; | ||
|
||
import { ProgramDetailsPanelContext } from "@/app/programs/[programId]/_context/program-details-panels/program-details-panels.context"; | ||
|
||
import { Button } from "@/design-system/atoms/button/variants/button-default"; | ||
|
||
import { SIDE_PANEL_GAP, SIDE_PANEL_SIZE } from "@/shared/constants/side-panel-size"; | ||
import { SidePanelGroup } from "@/shared/features/side-panel-group/side-panel-group"; | ||
import { SidePanelHeader } from "@/shared/features/side-panel-group/side-panel-header/side-panel-header"; | ||
import { SidePanel } from "@/shared/features/side-panel-group/side-panel/side-panel"; | ||
|
||
import { TransactionsSidepanels } from "./transactions-sidepanel.types"; | ||
|
||
export function TransactionsSidepanel() { | ||
const { transactionPanel } = useContext(ProgramDetailsPanelContext); | ||
|
||
return ( | ||
<SidePanelGroup | ||
ref={transactionPanel} | ||
panels={[TransactionsSidepanels.TRANSACTIONS, TransactionsSidepanels.EXPORT]} | ||
defaultPanelName={TransactionsSidepanels.TRANSACTIONS} | ||
config={{ closedWidth: 0, openedWidth: SIDE_PANEL_SIZE.m, gap: SIDE_PANEL_GAP.m }} | ||
> | ||
{/* @INFO THIS TWO PANELS COULD BE SPLIT IN TWO FILE */} | ||
<SidePanel name={TransactionsSidepanels.TRANSACTIONS}> | ||
<SidePanelHeader canClose={true} title={{ token: "programs:transactionPanel.transaction.title" }} /> | ||
<Button variant={"secondary-light"} onClick={() => transactionPanel.current?.onNext()}> | ||
Export CSV | ||
</Button> | ||
</SidePanel> | ||
<SidePanel name={TransactionsSidepanels.EXPORT}> | ||
<SidePanelHeader canGoBack={true} canClose={true} title={{ token: "programs:transactionPanel.export.title" }} /> | ||
</SidePanel> | ||
</SidePanelGroup> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
app/programs/[programId]/_features/transactions-sidepanel/transactions-sidepanel.types.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,8 @@ | ||
import { PropsWithChildren } from "react"; | ||
|
||
export enum TransactionsSidepanels { | ||
TRANSACTIONS = "transactions", | ||
EXPORT = "export", | ||
} | ||
|
||
export interface TransactionsSidepanelProps extends PropsWithChildren {} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import enTransactionPanel from "../[programId]/_features/transactions-sidepanel/transaction-sidepanel.en.json"; | ||
import enProgramsDetails from "../[programId]/programs-detail.en.json"; | ||
import enPrograms from "./programs.en.json"; | ||
import enProgramsDetails from "./programs.en.json"; | ||
|
||
export const enProgramsTranslation = { | ||
programs: { list: enPrograms, details: enProgramsDetails }, | ||
programs: { list: enPrograms, details: enProgramsDetails, transactionPanel: enTransactionPanel }, | ||
}; |
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
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
20 changes: 20 additions & 0 deletions
20
design-system/atoms/table-row/adapters/react-table/react-table.adapter.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,20 @@ | ||
import { flexRender } from "@tanstack/react-table"; | ||
|
||
import { cn } from "@/shared/helpers/cn"; | ||
|
||
import { TableRowPort } from "../../table-row.types"; | ||
import { TableRowReactTableVariants } from "./react-table.variants"; | ||
|
||
export function TableRowReactTableAdapter({ row, classNames }: TableRowPort) { | ||
const slots = TableRowReactTableVariants(); | ||
|
||
return ( | ||
<tr key={row.id} className={cn(slots.base(), classNames?.base)}> | ||
{row.getVisibleCells().map(cell => ( | ||
<td key={cell.id} className={cn(slots.cell(), classNames?.cell)}> | ||
{flexRender(cell.column.columnDef.cell, cell.getContext())} | ||
</td> | ||
))} | ||
</tr> | ||
); | ||
} |
10 changes: 10 additions & 0 deletions
10
design-system/atoms/table-row/adapters/react-table/react-table.variants.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,10 @@ | ||
import { tv } from "tailwind-variants"; | ||
|
||
export const TableRowReactTableVariants = tv({ | ||
slots: { | ||
base: "", | ||
cell: "border-b border-t border-container-stroke-separator p-3 first:rounded-l-xl first:border-l last:rounded-r-xl last:border-r", | ||
}, | ||
variants: {}, | ||
defaultVariants: {}, | ||
}); |
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,3 @@ | ||
export * from "./variants/table-row-default"; | ||
export * from "./table-row.types"; | ||
export * from "./table-row.loading"; |
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,11 @@ | ||
import { Skeleton } from "@/design-system/atoms/skeleton"; | ||
|
||
export function TableRowLoading() { | ||
return ( | ||
<Skeleton | ||
classNames={{ | ||
base: "w-full h-14", | ||
}} | ||
/> | ||
); | ||
} |
Oops, something went wrong.