Skip to content

Commit

Permalink
Merge pull request #2421 from zeitgeistpm/tr-remove-avatar
Browse files Browse the repository at this point in the history
Remove avatars
  • Loading branch information
Robiquet authored May 20, 2024
2 parents 92927ad + f964b97 commit ac291a3
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 1,078 deletions.
9 changes: 0 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ NEXT_PUBLIC_NOTIFICATION_MESSAGE="App is currently under maintenance. Please ret
# markets that will not be shown in the app
NEXT_PUBLIC_HIDDEN_MARKET_IDS=[674]

NEXT_PUBLIC_RMRK_PRERENDER_URL="https://d4sxkuih4kir3.cloudfront.net"
NEXT_PUBLIC_AVATAR_BASE_ID="base-1109632-ZEIT-BASE-V8"
NEXT_PUBLIC_BADGE_COLLECTION_ID="2e55d4bf2e85715b63-ZEITBADGES"
NEXT_PUBLIC_AVATAR_COLLECTION_ID="2e55d4bf2e85715b63-ZEITASTAGE"
NEXT_PUBLIC_SINGULAR_URL="https://singular-rmrk2-dev.vercel.app"
NEXT_PUBLIC_RMRK_INDEXER_API="https://gql2.rmrk.dev/v1/graphql"
NEXT_PUBLIC_IPFS_NODE="http://ipfs.zeitgeist.pm:5001"
NEXT_PUBLIC_RMRK_CHAIN_RPC_NODE="wss://kusama-node-staging.rmrk.link"
NEXT_PUBLIC_AVATAR_API_HOST="https://avatar-bsr.zeitgeist.pm/"
NEXT_PUBLIC_MIGRATION_IN_PROGRESS=false

# enable in dev/staging to inspect react-query cache and query handling.
Expand Down
8 changes: 0 additions & 8 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ NEXT_PUBLIC_NOT_ALLOWED_COUNTRIES=["US","KP","SY","CU","IR","VE","PR"]
# markets that will not be shown in the app
#NEXT_PUBLIC_HIDDEN_MARKET_IDS=[]

NEXT_PUBLIC_RMRK_PRERENDER_URL="https://prerender.rmrk.link"
NEXT_PUBLIC_AVATAR_BASE_ID="base-13772583-ZEIT-BASE-V1"
NEXT_PUBLIC_BADGE_COLLECTION_ID="48c2f61e58b57af315-ZTGBDGS"
NEXT_PUBLIC_AVATAR_COLLECTION_ID="48c2f61e58b57af315-ZTGAVTRS"
NEXT_PUBLIC_SINGULAR_URL="https://singular.app"
NEXT_PUBLIC_RMRK_INDEXER_API="https://gql-rmrk2-prod.graphcdn.app"
NEXT_PUBLIC_IPFS_NODE="http://ipfs.zeitgeist.pm:5001"
NEXT_PUBLIC_RMRK_CHAIN_RPC_NODE="wss://kusama-rpc.polkadot.io"
NEXT_PUBLIC_AVATAR_API_HOST="https://avatara.zeitgeist.pm/"

NEXT_PUBLIC_VERCEL_ENV=production
NEXT_PUBLIC_SITE_URL=https://app.zeitgeist.pm
152 changes: 0 additions & 152 deletions components/avatar/BadgesList.tsx

This file was deleted.

44 changes: 6 additions & 38 deletions components/ui/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { decodeAddress } from "@polkadot/keyring";
import { sanitizeIpfsUrl } from "@zeitgeistpm/avatara-util";
import BoringAvatar from "boring-avatars";
import { useAvatarParts } from "lib/hooks/queries/useAvatarParts";
import Image from "next/image";
import Skeleton from "./Skeleton";

const blues = ["#0001fe", "#a000ff", "#70f8ff"];
const reds = ["#fb7ce8", "#FF0054", "#FAB400"];
Expand All @@ -30,13 +26,6 @@ const Avatar = ({
const red = reds[decodedAddressArray[6] % reds.length];
const blueFirst = decodedAddressArray[10] % 2;

const {
data: avatarParts,
isLoading,
isFetching,
isFetched,
} = useAvatarParts(address);

return (
<div
className="z-0"
Expand All @@ -47,33 +36,12 @@ const Avatar = ({
borderRadius: "52%",
}}
>
{(isFetching || isLoading) && !isFetched ? (
<Skeleton className="h-full w-full bg-opacity-50" />
) : avatarParts ? (
<div className="relative h-full w-full">
{avatarParts.map(
({ part }, index) =>
part.src && (
<Image
fill
sizes="100vw"
alt={"Avatar part"}
key={`${address}${part.id}`}
className="absolute left-0 top-0 scale-125"
style={{ zIndex: index + 1 }}
src={sanitizeIpfsUrl(part.src)}
/>
),
)}
</div>
) : (
<BoringAvatar
size={size}
name={decodedAddressArray.join("")}
variant="beam"
colors={blueFirst ? [blue, red] : [red, blue]}
/>
)}
<BoringAvatar
size={size}
name={decodedAddressArray.join("")}
variant="beam"
colors={blueFirst ? [blue, red] : [red, blue]}
/>
</div>
);
};
Expand Down
48 changes: 0 additions & 48 deletions lib/hooks/queries/useAvatarParts.ts

This file was deleted.

23 changes: 0 additions & 23 deletions lib/hooks/queries/useBadges.ts

This file was deleted.

14 changes: 0 additions & 14 deletions lib/util/create-avatar-sdk.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@yornaath/batshit-devtools-react": "^0.5.4",
"@zeitgeistpm/augment-api": "3.7.0",
"@zeitgeistpm/avatara-nft-sdk": "^1.3.1",
"@zeitgeistpm/avatara-react": "^1.3.2",
"@zeitgeistpm/avatara-util": "^1.2.0",
"@zeitgeistpm/sdk": "3.7.0",
"@zeitgeistpm/utility": "3.7.0",
Expand Down
32 changes: 9 additions & 23 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "styles/index.css";
import { Hydrate, QueryClientProvider } from "@tanstack/react-query";
import * as Fathom from "fathom-client";

import { AvatarContext } from "@zeitgeistpm/avatara-react";
import Devtools from "components/devtools";
import DefaultLayout from "layouts/DefaultLayout";
import { appQueryClient } from "lib/query-client";
Expand Down Expand Up @@ -82,28 +81,15 @@ const MyApp = ({ Component, pageProps }) => {
</style>
<QueryClientProvider client={appQueryClient}>
<Hydrate state={pageProps.dehydratedState}>
<AvatarContext.Provider
value={{
api: process.env.NEXT_PUBLIC_AVATAR_API_HOST,
ipfs: { node: { url: process.env.NEXT_PUBLIC_IPFS_NODE ?? "" } },
rpc: process.env.NEXT_PUBLIC_RMRK_CHAIN_RPC_NODE,
indexer: process.env.NEXT_PUBLIC_RMRK_INDEXER_API,
avatarCollectionId: process.env.NEXT_PUBLIC_AVATAR_COLLECTION_ID,
badgeCollectionId: process.env.NEXT_PUBLIC_BADGE_COLLECTION_ID,
avatarBaseId: process.env.NEXT_PUBLIC_AVATAR_BASE_ID,
prerenderUrl: process.env.NEXT_PUBLIC_RMRK_PRERENDER_URL,
}}
>
<Head>
<title>Zeitgeist - Prediction Markets</title>
</Head>
<DefaultLayout>
<Layout>
<Component {...pageProps} />
</Layout>
</DefaultLayout>
{/* <Devtools /> */}
</AvatarContext.Provider>
<Head>
<title>Zeitgeist - Prediction Markets</title>
</Head>
<DefaultLayout>
<Layout>
<Component {...pageProps} />
</Layout>
</DefaultLayout>
{/* <Devtools /> */}
</Hydrate>
</QueryClientProvider>
</div>
Expand Down
Loading

0 comments on commit ac291a3

Please sign in to comment.