New source found from dndbeyond.com

This commit is contained in:
2026-07-08 01:00:09 -07:00
parent 9a983a6d7b
commit dcefa0d2f2
2865 changed files with 222467 additions and 49053 deletions
@@ -1,11 +1,11 @@
import React, { useCallback, useEffect, useState } from "react";
import { useLocation } from "react-router-dom";
import ArrowDown from "@dndbeyond/fontawesome-cache/svgs/regular/arrow-down-to-line.svg";
import { Button } from "~/components/Button";
import { MaxCharactersDialog } from "~/components/MaxCharactersDialog";
import config from "~/config";
import { UserPreferenceProvider } from "~/tools/js/smartComponents/UserPreference";
import { logUnlockSubscribeClicked } from "../../../../helpers/analytics";
import { byProp, createSortValue } from "../../../../helpers/sortUtils";
@@ -27,6 +27,7 @@ import {
SortOrderEnum,
SortTypeEnum,
} from "../../../../types";
import { UserPreferencesProvider } from "../../contexts/UserPreferences";
import { ApiStatusIndicator } from "../ApiStatusIndicator";
import { CharacterCard } from "../CharacterCard";
import { SubscriptionBanner } from "../SubscriptionBanner";
@@ -76,6 +77,7 @@ export const CharacterGrid: React.FC<CharacterGridProps> = ({
}) => {
const userId = useUserId();
const subscriptionTier = useSubscriptionTier();
const { search: searchParams } = useLocation();
const [sortPreference, setSortPreference] = useLocalStorage<string>(
`MY_CHARACTERS_SORT_PREFERENCE:${userId}`,
@@ -190,15 +192,17 @@ export const CharacterGrid: React.FC<CharacterGridProps> = ({
maxCharacterSlotsAllowed !== null &&
characterCount >= maxCharacterSlotsAllowed;
const createCharacterHref = !hasMaxCharacters
? `${config.basePathname}/builder`
: undefined;
const createCharacterOnClick = hasMaxCharacters
? () => setIsMaxCharacterMessageOpen(true)
: undefined;
const createCharacterHref =
!hasMaxCharacters && !hasLockedCharacters
? `${config.basePathname}/builder${searchParams}`
: undefined;
const createCharacterOnClick =
hasMaxCharacters || hasLockedCharacters
? () => setIsMaxCharacterMessageOpen(true)
: undefined;
return (
<UserPreferenceProvider>
<UserPreferencesProvider>
<div
className={[className, "ddb-characters-listing"]
.filter(Boolean)
@@ -403,8 +407,9 @@ export const CharacterGrid: React.FC<CharacterGridProps> = ({
<MaxCharactersDialog
open={isMaxCharacterMessageOpen}
onClose={() => setIsMaxCharacterMessageOpen(false)}
hasLockedCharacters={hasLockedCharacters}
/>
</div>
</UserPreferenceProvider>
</UserPreferencesProvider>
);
};
@@ -14,11 +14,11 @@ import { Button } from "@dndbeyond/ttui/components/Button";
import { Select } from "@dndbeyond/ttui/components/Select";
import PreferenceUpdateLocation from "~/tools/js/Shared/constants/PreferenceUpdateLocation";
import CharacterSettingsModal from "~/tools/js/smartComponents/CharacterSettingsModal";
import { SortOrderEnum, SortTypeEnum } from "~/types";
import { logListingSortChanged } from "../../../../../helpers/analytics";
import { createSortValue } from "../../../../../helpers/sortUtils";
import { CharacterSettingsModal } from "../../CharacterSettingsModal";
import { SortState } from "../CharacterGrid";
import styles from "./styles.module.css";
@@ -150,8 +150,7 @@ export const SearchSort: FC<SearchSortProps> = ({
</Button>
<CharacterSettingsModal
open={showSettingsModal}
updateLocation={PreferenceUpdateLocation.CharacterListing}
handleClose={() => setShowSettingsModal(false)}
onClose={() => setShowSettingsModal(false)}
/>
</>
</div>