-
Notifications
You must be signed in to change notification settings - Fork 2
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
35 changed files
with
474 additions
and
193 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,30 @@ | ||
import { getQueryParams } from '@/lib/get-param.ts' | ||
import { fetchClient } from '@/lib/transport/index.ts' | ||
|
||
export const getExploreSections = async ( | ||
props: FetchMultipleDataInputParams<FetchExploreSectionFilter>, | ||
apiConfig: ApiConfigForServerConfig, | ||
) => { | ||
try { | ||
const removeAllNullableValues = | ||
getQueryParams<FetchExploreSectionFilter>(props) | ||
const params = new URLSearchParams(removeAllNullableValues) | ||
const response = await fetchClient< | ||
ApiResponse<FetchMultipleDataResponse<ExploreSection>> | ||
>(`/v1/explore?${params.toString()}`, { | ||
...(apiConfig ? apiConfig : {}), | ||
}) | ||
|
||
return response.parsedBody.data | ||
} catch (error: unknown) { | ||
// Error from server. | ||
if (error instanceof Response) { | ||
const response = await error.json() | ||
throw new Error(response.errorMessage) | ||
} | ||
|
||
if (error instanceof Error) { | ||
throw error | ||
} | ||
} | ||
} |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...omponents/edit-collection-modal/index.tsx → ...omponents/edit-collection-modal/index.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
File renamed without changes.
File renamed without changes.
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
27 changes: 22 additions & 5 deletions
27
apps/client/app/modules/explore/components/section/collection-section.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,18 +1,35 @@ | ||
import { Link } from '@remix-run/react' | ||
import { useGetCollectionById } from '@/api/collections/index.ts' | ||
import { CollectionCard } from '@/components/CollectionCard/index.tsx' | ||
|
||
interface Props { | ||
data: Collection | ||
collectionId: string | ||
} | ||
|
||
export function CollectionSection({}: Props) { | ||
return <>Tag</> | ||
export function CollectionSection({ collectionId }: Props) { | ||
const { isPending, data, isError } = useGetCollectionById({ | ||
id: collectionId, | ||
query: { | ||
populate: ['content'], | ||
}, | ||
}) | ||
|
||
if (isPending) return <CollectionShimmer /> | ||
if (!data || isError) return null | ||
|
||
return ( | ||
<div className="w-72"> | ||
<CollectionCard collection={data} /> | ||
</div> | ||
) | ||
} | ||
|
||
export function CollectionShimmer() { | ||
return ( | ||
<Link to="" preventScrollReset className="animate-pulse space-y-2"> | ||
<div className="h-36 w-44 rounded-md bg-zinc-100" /> | ||
<div className="h-3 w-36 rounded bg-zinc-100" /> | ||
<div className="h-44 w-72 rounded-md bg-zinc-100" /> | ||
<div className="h-3 w-56 rounded bg-zinc-100" /> | ||
<div className="h-2 w-40 rounded bg-zinc-100" /> | ||
</Link> | ||
) | ||
} |
9 changes: 7 additions & 2 deletions
9
apps/client/app/modules/explore/components/section/content-section.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
40 changes: 38 additions & 2 deletions
40
apps/client/app/modules/explore/components/section/creator-section.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
Oops, something went wrong.