Skip to content

Art · Modules

1 module · 5 exports · 1 repository · 12 e2e tests · 2 routes

Who imports who · hover a node
Depends onArt modulesUsed byArtListing5 exportsLoaders1 fileRoutes2 filesComponents1 file

ArtListing

app/features/art/core/ArtListing.ts

Narrowing down a list of art the way the art pages do: a user's art by whether they made it or are in it and by tag, the tags offered to filter by, artists taking commissions and the page of the grid an art is on. A user's own art comes without an author (see ArtRepository.findArtsByUserId), art made of them by someone else with one.

Imports
no other modules
Used by
1 loader2 routes1 component

Functions & values

function

filterUserArts

:17

The art of a user's page shown with the source and tag picked. The source only narrows the list when the user has both art they made and art made of them ({@link hasBothSources}), as only then is it offered. A tag narrows it to the art having that tag.

export function filterUserArts<T extends UserArt>(
	arts: T[],
	{ source, tag }: { source: ArtSource; tag: string | null },
)
Unit tests (3)
function

hasBothSources

:36

Does the user have both art they made and art made of them by someone else?

export function hasBothSources(arts: UserArt[])
Unit tests (1)
function

tagCounts

:41

Names of the tags of the art with how many pieces have each, most used first. null when no art has tags.

export function tagCounts(arts: Pick<ListedArt, "tags">[])
Unit tests (2)
function

withCommissionsOpen

:55

The art whose author has their commissions open.

export function withCommissionsOpen<T extends Pick<ListedArt, "author">>(
	arts: T[],
)
Unit tests (1)
Routes/art
function

pageOf

:65

The page of the art grid (ART_PER_PAGE pieces each, counting from one) the art is on, so that a shared ?big= link opens the page containing it. The first page if the art is not in the list.

export function pageOf(arts: Pick<ListedArt, "id">[], artId: number | null)
Unit tests (1)
Componentsart/ArtGrid.tsx