Skip to content

Commit

Permalink
landing naming
Browse files Browse the repository at this point in the history
  • Loading branch information
aymericdelab committed Jan 22, 2025
1 parent ac860cc commit ef4809c
Show file tree
Hide file tree
Showing 45 changed files with 141 additions and 207 deletions.
2 changes: 1 addition & 1 deletion client/apps/game-docs/docs/pages/development/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ management, and network interactions.
### Usage

```tsx
import { useDojo } from "@/hooks/context/DojoContext";
import { useDojo } from "@/hooks/context/dojo-context";
function GameComponent() {
const { account, network, masterAccount } = useDojo();
// ... your game logic
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/src/components/modules/bridge-fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Minus, Plus } from "lucide-react";
import { useMemo } from "react";
import { Button } from "../ui/button";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";

// todo : get it directly from the config
export const BRIDGE_FEE_DENOMINATOR = 10_000;
Expand Down
12 changes: 6 additions & 6 deletions client/apps/landing/src/components/modules/bridge-in.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { execute } from "@/hooks/gql/execute";
import { useEntities } from "@/hooks/helpers/useEntities";
import { useResourceBalance } from "@/hooks/helpers/useResources";
import { GET_CAPACITY_SPEED_CONFIG } from "@/hooks/query/capacityConfig";
import { useEntities } from "@/hooks/helpers/use-entities";
import { useResourceBalance } from "@/hooks/helpers/use-resources";
import { GET_CAPACITY_SPEED_CONFIG } from "@/hooks/query/capacity-config";
import { useBridgeAsset } from "@/hooks/use-bridge";
import { useLords } from "@/hooks/use-lords";
import { useBridgeAsset } from "@/hooks/useBridge";
import { useTravel } from "@/hooks/useTravel";
import { useTravel } from "@/hooks/use-travel";
import { displayAddress, divideByPrecision, multiplyByPrecision } from "@/lib/utils";
import {
ADMIN_BANK_ENTITY_ID,
Expand All @@ -23,7 +23,7 @@ import { uint256 } from "starknet";
import { formatEther } from "viem";
import { TypeP } from "../typography/type-p";
import { Button } from "../ui/button";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { Input } from "../ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
Expand Down
14 changes: 7 additions & 7 deletions client/apps/landing/src/components/modules/bridge-out-step-1.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { execute } from "@/hooks/gql/execute";
import { useEntities } from "@/hooks/helpers/useEntities";
import { useResourceBalance } from "@/hooks/helpers/useResources";
import { GET_CAPACITY_SPEED_CONFIG } from "@/hooks/query/capacityConfig";
import { useBridgeAsset } from "@/hooks/useBridge";
import { useTravel } from "@/hooks/useTravel";
import { useEntities } from "@/hooks/helpers/use-entities";
import { useResourceBalance } from "@/hooks/helpers/use-resources";
import { GET_CAPACITY_SPEED_CONFIG } from "@/hooks/query/capacity-config";
import { useBridgeAsset } from "@/hooks/use-bridge";
import { useTravel } from "@/hooks/use-travel";
import { displayAddress, multiplyByPrecision } from "@/lib/utils";
import {
ADMIN_BANK_ENTITY_ID,
Expand All @@ -19,10 +19,10 @@ import { useQuery } from "@tanstack/react-query";
import { InfoIcon, Loader, Plus } from "lucide-react";
import { useMemo, useState } from "react";
import { TypeP } from "../typography/type-p";
import { SelectSingleResource } from "../ui/SelectResources";
import { Button } from "../ui/button";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
import { SelectSingleResource } from "../ui/select-resources";
import { Tooltip, TooltipProvider } from "../ui/tooltip";
import { getResourceAddresses } from "../ui/utils/addresses";
import { calculateDonkeysNeeded, divideByPrecision, getTotalResourceWeight } from "../ui/utils/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
import { useDonkeyArrivals } from "@/hooks/helpers/useDonkeyArrivals";
import { useEntities } from "@/hooks/helpers/useEntities";
import { useBridgeAsset } from "@/hooks/useBridge";
import { useDonkeyArrivals } from "@/hooks/helpers/use-donkey-arrivals";
import { useEntities } from "@/hooks/helpers/use-entities";
import { useBridgeAsset } from "@/hooks/use-bridge";
import { displayAddress } from "@/lib/utils";
import { ADMIN_BANK_ENTITY_ID, RESOURCE_PRECISION, ResourcesIds } from "@bibliothecadao/eternum";
import { useAccount } from "@starknet-react/core";
import { ChevronDown, ChevronUp, Loader } from "lucide-react";
import { useEffect, useState } from "react";
import { TypeP } from "../typography/type-p";
import { Button } from "../ui/button";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { Input } from "../ui/input";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../ui/table";
import { getResourceAddresses } from "../ui/utils/addresses";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useDojo } from "@/hooks/context/DojoContext";
import { useDojo } from "@/hooks/context/dojo-context";
import { ResourcesIds } from "@bibliothecadao/eternum";
import { useAccount } from "@starknet-react/core";
import { ArrowDownUp, Pickaxe } from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import { TypeH2 } from "../typography/type-h2";
import { Card, CardHeader } from "../ui/card";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { getResourceAddresses } from "../ui/utils/addresses";

type SortKey = "totalSupply" | "balance";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ChevronLeft, ChevronRight } from "lucide-react";
import { useState } from "react";
import { Button } from "../ui/button";
import { CardContent } from "../ui/card";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { Input } from "../ui/input";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip";

Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/src/components/modules/realm-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useReadContract } from "@starknet-react/core";
import { Loader } from "lucide-react";
import { useEffect, useState } from "react";
import { Checkbox } from "../ui/checkbox";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
interface RealmCardProps {
realm: NonNullable<NonNullable<NonNullable<GetAccountTokensQuery>["tokenBalances"]>["edges"]>[0] & {
seasonPassMinted?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execute } from "@/hooks/gql/execute";
import { GET_ERC_MINTS } from "@/hooks/query/erc721";
import { useMintTestRealm } from "@/hooks/useMintTestRealm";
import { useMintTestRealm } from "@/hooks/use-mint-test-realm";
import { useSuspenseQuery } from "@tanstack/react-query";
import { ChevronsUpDown, Loader } from "lucide-react";
import { useMemo, useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import { GetRealmsQuery } from "@/hooks/gql/graphql";
import { RealmMetadata } from "@/types";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";

interface SeasonPassCardProps {
pass: NonNullable<NonNullable<NonNullable<GetRealmsQuery>["tokenBalances"]>["edges"]>[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMintSeasonPass } from "@/hooks/useMintSeasonPass";
import { useMintSeasonPass } from "@/hooks/use-mint-season-pass";
import { displayAddress } from "@/lib/utils";
import { useAccount } from "@starknet-react/core";
import { Link } from "@tanstack/react-router";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLeaderboardStatus } from "@/hooks/usePrizeClaim";
import { useLeaderboardStatus } from "@/hooks/use-prize-claim";
import { useEffect, useState } from "react";

export const SeasonRegistrationTimer = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Uint256, uint256 } from "starknet";
import { formatEther } from "viem";
import { env } from "../../../env";
import { Button } from "../ui/button";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { SidebarTrigger } from "../ui/sidebar";
import { ModeToggle } from "./mode-toggle";
import { SeasonRegistrationTimer } from "./season-registration-timer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TypeH2 } from "../typography/type-h2";
import { Button } from "../ui/button";
import { Checkbox } from "../ui/checkbox";
import { Dialog, DialogContent } from "../ui/dialog";
import { ResourceIcon } from "../ui/elements/ResourceIcon";
import { ResourceIcon } from "../ui/elements/resource-icon";
import { Input } from "../ui/input";

import { abi } from "@/abi/SeasonPass";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { findResourceById } from "@bibliothecadao/eternum";
import clsx from "clsx";
import { useMemo } from "react";
import { divideByPrecision, formatNumber } from "../utils/utils";
import { ResourceIcon } from "./ResourceIcon";
import { ResourceIcon } from "./resource-icon";

type ResourceCostProps = {
isLabor?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useResourceBalance } from "@/hooks/helpers/useResources";
import { useResourceBalance } from "@/hooks/helpers/use-resources";
import { ID, resources } from "@bibliothecadao/eternum";
import { XIcon } from "lucide-react";
import { useEffect, useMemo } from "react";
import { divideByPrecision } from "../ui/utils/utils";
import Button from "./elements/Button";
import ListSelect from "./elements/ListSelect";
import { NumberInput } from "./elements/NumberInput";
import { ResourceCost } from "./elements/ResourceCost";
import Button from "./elements/button";
import ListSelect from "./elements/list-select";
import { NumberInput } from "./elements/number-input";
import { ResourceCost } from "./elements/resource-cost";
import { divideByPrecision } from "./utils/utils";

export const SelectResources = ({
selectedResourceIds,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { SetupNetworkResult } from "@/dojo/setupNetwork";
import { displayAddress } from "@/lib/utils";
import { SetupNetworkResult, SetupResult } from "@bibliothecadao/eternum";
import { useAccount } from "@starknet-react/core";
import { ReactNode, createContext, useContext, useMemo } from "react";
import { Account, AccountInterface, RpcProvider } from "starknet";
import { env } from "../../../env";
import { SetupResult } from "@/dojo/setup";
interface DojoAccount {
account: Account | AccountInterface | null;
accountDisplay: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useQueries, useQuery } from "@tanstack/react-query";
import { useMemo } from "react";
import { execute } from "../gql/execute";
import { GetEternumEntityOwnerQuery } from "../gql/graphql";
import { GET_ETERNUM_ENTITY_OWNERS } from "../query/entityOwners";
import { GET_ETERNUM_ENTITY_OWNERS } from "../query/entity-owners";
import { GET_ENTITY_DISTANCE } from "../query/position";
import { GET_ENTITIES_RESOURCES } from "../query/resources";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useAccount } from "@starknet-react/core";
import { useCallback } from "react";
import { toast } from "sonner";
import { env } from "../../env";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

export const useBridgeAsset = () => {
// todo; use starknet-react
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/src/hooks/use-donkeys-burned.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineQuery, getComponentValue, Has, isComponentUpdate } from "@dojoengine/recs";
import { useEffect, useState } from "react";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

export const useDonkeysBurned = () => {
const {
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/src/hooks/use-lords-bridged.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { lordsAddress } from "@/config";
import { useEffect, useState } from "react";
import { Chain, getGameManifest } from "../../../../../config/utils/utils";
import { env } from "../../env";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

const { VITE_PUBLIC_CHAIN } = env;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ import { lordsAddress, seasonPassAddress } from "@/config";
import { useAccount, useContract, useSendTransaction } from "@starknet-react/core";

import { abi } from "@/abi/SeasonPass";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

export const useMintSeasonPass = () => {
const [isMinting, setIsMinting] = useState(false);
const [mintingTokenId, setMintingTokenId] = useState(["0"]);

const { address } = useAccount();

const { contract } = useContract({
abi,
address: seasonPassAddress,
});

const { send, error, isPending, isSuccess } = useSendTransaction({});
const { send, isPending, isSuccess } = useSendTransaction({});
const {
setup: {
systemCalls: { attach_lords, detach_lords },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { realmsAddress } from "@/config";
import { useAccount } from "@starknet-react/core";
import { useCallback, useEffect, useMemo, useState } from "react";
import { toast } from "sonner";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

export const useMintTestRealm = () => {
const {
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/src/hooks/use-player-count.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEntityQuery } from "@dojoengine/react";
import { Has } from "@dojoengine/recs";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

export const usePlayerCount = () => {
return useEntityQuery([Has(useDojo().setup.components.AddressName)]).length;
Expand Down
2 changes: 1 addition & 1 deletion client/apps/landing/src/hooks/use-structures.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StructureType } from "@bibliothecadao/eternum";
import { useEntityQuery } from "@dojoengine/react";
import { Has, HasValue } from "@dojoengine/recs";
import { useDojo } from "./context/DojoContext";
import { useDojo } from "./context/dojo-context";

export const useStructuresNumber = () => {
const {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/apps/landing/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { dojoConfig } from "../dojoConfig";
import { StarknetProvider } from "./components/providers/starknet-provider";
import { ThemeProvider } from "./components/providers/theme-provider";
import { TypeH1 } from "./components/typography/type-h1";
import { DojoProvider } from "./hooks/context/DojoContext";
import { DojoProvider } from "./hooks/context/dojo-context";
import { DojoEventListener } from "./hooks/subscriptions.tsx/dojo-event-listener";
import { routeTree } from "./routeTree.gen";
import { ETERNUM_CONFIG } from "./utils/config";
Expand Down
Loading

0 comments on commit ef4809c

Please sign in to comment.