-
-
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.
ar(feat) [DPCP-38] [DPCP-39] [DPCP-46]: Abstract Views
- Loading branch information
1 parent
18318b1
commit 12ac054
Showing
8 changed files
with
99 additions
and
65 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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
// hypnos-public-list.tsx | ||
'use server'; | ||
import type { ICard } from '@dreampipcom/oneiros'; | ||
import { ListView } from '@elements/client'; | ||
import { ListView, CalendarView, MapView } from '@elements/client'; | ||
import { loadHypnosPublicListings } from '@gateway'; | ||
import { HypnosPublicProvider, HypnosPublicContext } from '@state'; | ||
import { ALoadPublicListings, AUnloadPublicListings, ADecoratePublicListings, AAddToFavoritePublicListings } from '@actions'; | ||
|
||
export const CHPNPList = async () => { | ||
export interface IServiceViewProps { | ||
mode?: "calendar" | "list" | "map"; | ||
} | ||
|
||
export const CHPNPList = async ({ mode = "list" }) => { | ||
const listings: ICard[] = await loadHypnosPublicListings(); | ||
|
||
return ( | ||
<HypnosPublicProvider> | ||
<ListView listings={listings} fetchListings={loadHypnosPublicListings} loadListings={ALoadPublicListings} decListings={ADecoratePublicListings} unloadListings={AUnloadPublicListings} listingContext={HypnosPublicContext} favListing={AAddToFavoritePublicListings} /> | ||
{mode === "list" ? <ListView listings={listings} fetchListings={loadHypnosPublicListings} loadListings={ALoadPublicListings} decListings={ADecoratePublicListings} unloadListings={AUnloadPublicListings} listingContext={HypnosPublicContext} favListing={AAddToFavoritePublicListings} /> : undefined } | ||
{mode === "map" ? <MapView listings={listings} fetchListings={loadHypnosPublicListings} loadListings={ALoadPublicListings} decListings={ADecoratePublicListings} unloadListings={AUnloadPublicListings} listingContext={HypnosPublicContext} favListing={AAddToFavoritePublicListings} /> : undefined } | ||
{mode === "calendar" ? <CalendarView listings={listings} fetchListings={loadHypnosPublicListings} loadListings={ALoadPublicListings} decListings={ADecoratePublicListings} unloadListings={AUnloadPublicListings} listingContext={HypnosPublicContext} favListing={AAddToFavoritePublicListings} /> : undefined } | ||
</HypnosPublicProvider> | ||
); | ||
}; |
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,17 +1,23 @@ | ||
// list-controller.tsx | ||
'use server'; | ||
import type { ICard } from '@dreampipcom/oneiros'; | ||
import { ListView } from '@elements/client'; | ||
import { ListView, CalendarView, MapView } from '@elements/client'; | ||
import { loadChars, getChars } from '@gateway'; | ||
import { RickMortyProvider, RMContext } from '@state'; | ||
import { ALoadChars, AUnloadChars, ADecorateChars, AAddToFavoriteChars} from '@actions'; | ||
|
||
export const CRMList = async () => { | ||
export interface IServiceViewProps { | ||
mode?: "calendar" | "list" | "map"; | ||
} | ||
|
||
export const CRMList = async ({ mode = "list" }: IServiceViewProps) => { | ||
const characters: ICard[] = await loadChars(); | ||
|
||
return ( | ||
<RickMortyProvider> | ||
<ListView listings={characters} favoriteType="string" fetchListings={getChars} loadListings={ALoadChars} decListings={ADecorateChars} unloadListings={AUnloadChars} listingContext={RMContext} favListing={AAddToFavoriteChars} /> | ||
{mode === "list" ? <ListView listings={characters} favoriteType="string" fetchListings={getChars} loadListings={ALoadChars} decListings={ADecorateChars} unloadListings={AUnloadChars} listingContext={RMContext} favListing={AAddToFavoriteChars} /> : undefined } | ||
{mode === "map" ? <MapView listings={characters} favoriteType="string" fetchListings={getChars} loadListings={ALoadChars} decListings={ADecorateChars} unloadListings={AUnloadChars} listingContext={RMContext} favListing={AAddToFavoriteChars} /> : undefined } | ||
{mode === "calendar" ? <CalendarView listings={characters} favoriteType="string" fetchListings={getChars} loadListings={ALoadChars} decListings={ADecorateChars} unloadListings={AUnloadChars} listingContext={RMContext} favListing={AAddToFavoriteChars} /> : undefined } | ||
</RickMortyProvider> | ||
); | ||
}; |
6 changes: 4 additions & 2 deletions
6
src/app/services/hypnos/page.tsx → src/app/services/hypnos/[[...mode]].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
1 change: 1 addition & 0 deletions
1
src/app/services/rickmorty/page.tsx → src/app/services/rickmorty/[[...mode]].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,5 +1,6 @@ | ||
// page.tsx | ||
import { DPRMList } from '@blocks/server'; | ||
|
||
export default function Home() { | ||
return ( | ||
<main> | ||
|