Skip to content

Commit

Permalink
Merge pull request #425 from ourzora/fix-image-stacker
Browse files Browse the repository at this point in the history
FIx image stacker issue
  • Loading branch information
neokry authored Jan 8, 2024
2 parents 58ada22 + 25304a5 commit 6871ad9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
14 changes: 5 additions & 9 deletions apps/web/src/pages/api/renderer/stack-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
images.map((imageUrl) => getImageData(imageUrl))
)

const isSvg = images[0].includes('.svg')

// Resize all SVGs to a default size
if (isSvg) {
imageData = await Promise.all(
imageData.map(async (x) =>
sharp(x).resize(SVG_DEFAULT_SIZE, SVG_DEFAULT_SIZE, { fit: 'inside' }).toBuffer()
)
// Resize all images to a default size
imageData = await Promise.all(
imageData.map(async (x) =>
sharp(x).resize(SVG_DEFAULT_SIZE, SVG_DEFAULT_SIZE, { fit: 'inside' }).toBuffer()
)
}
)

const compositeParams = imageData.slice(1).map((x) => ({
input: x,
Expand Down
14 changes: 8 additions & 6 deletions apps/web/src/pages/dao/[network]/[token]/[tokenId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Meta } from 'src/components/Meta'
import AnimatedModal from 'src/components/Modal/AnimatedModal'
import { SuccessModalContent } from 'src/components/Modal/SuccessModalContent'
import { CACHE_TIMES } from 'src/constants/cacheTimes'
import { PUBLIC_DEFAULT_CHAINS } from 'src/constants/defaultChains'
import { PUBLIC_ALL_CHAINS, PUBLIC_DEFAULT_CHAINS } from 'src/constants/defaultChains'
import { CAST_ENABLED } from 'src/constants/farcasterEnabled'
import { SUCCESS_MESSAGES } from 'src/constants/messages'
import { SDK } from 'src/data/subgraph/client'
Expand All @@ -27,38 +27,40 @@ import { DaoTopSection } from 'src/modules/dao/components/DaoTopSection'
import FeedTab from 'src/modules/dao/components/Feed/Feed'
import { NextPageWithLayout } from 'src/pages/_app'
import { DaoOgMetadata } from 'src/pages/api/og/dao'
import { AddressType, Chain } from 'src/typings'
import { AddressType, CHAIN_ID, Chain } from 'src/typings'
import { isPossibleMarkdown } from 'src/utils/helpers'

export type TokenWithDao = NonNullable<TokenWithDaoQuery['token']>

interface TokenPageProps {
url: string
chain: Chain
collection: AddressType
token: TokenWithDao
name: string
description: string
tokenId: string
addresses: DaoContractAddresses
ogImageURL: string
chainId: CHAIN_ID
}

const TokenPage: NextPageWithLayout<TokenPageProps> = ({
url,
chain,
collection,
token,
description,
name,
addresses,
ogImageURL,
chainId,
}) => {
const { query, replace, pathname } = useRouter()
const { address } = useAccount()

const chain = PUBLIC_ALL_CHAINS.find((x) => x.id === chainId) as Chain

const { hasThreshold } = useVotes({
chainId: chain.id,
chainId: chainId,
signerAddress: address,
collectionAddress: collection,
governorAddress: addresses?.governor,
Expand Down Expand Up @@ -240,14 +242,14 @@ export const getServerSideProps: GetServerSideProps = async ({

const props: TokenPageProps = {
url: resolvedUrl,
chain,
collection,
name,
token,
description: description || '',
tokenId,
addresses,
ogImageURL,
chainId: chain.id,
}

return {
Expand Down

2 comments on commit 6871ad9

@vercel
Copy link

@vercel vercel bot commented on 6871ad9 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

testnet-nouns-builder – ./apps/web

testnet-nouns-builder-nouns-builder.vercel.app
testnet.nouns.build
testnet-nouns-builder-git-main-nouns-builder.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 6871ad9 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.