Skip to content

Commit

Permalink
Merge branch 'main' into link_recent_bidders
Browse files Browse the repository at this point in the history
  • Loading branch information
neokry authored Oct 25, 2024
2 parents d0cf71e + c7b3c70 commit 6b65300
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 22 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/layouts/DefaultLayout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Footer = () => {
variant="paragraph-sm"
color="tertiary"
as="a"
href="https://docs.zora.co/docs/smart-contracts/nouns-builder/intro"
href="https://builder-docs.vercel.app/reference/intro"
rel="noopener noreferrer"
target="_blank"
mr={{ '@initial': 'x0', '@768': 'x4', '@1024': 'x6' }}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/layouts/DefaultLayout/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Nav = () => {
<Label className={navMenuItem}>Explore</Label>
</Link>
<a
href="https://docs.zora.co/docs/smart-contracts/nouns-builder/intro"
href="https://builder-docs.vercel.app/reference/intro"
target="_blank"
rel="noreferrer noopener"
>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/layouts/DefaultLayout/NavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export const NavMenu = () => {
</Flex>
</Link>
<a
href="https://docs.zora.co/docs/smart-contracts/nouns-builder/intro"
href="https://builder-docs.vercel.app/reference/intro"
target="_blank"
rel="noreferrer noopener"
>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/layouts/HomeLayout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Footer = () => {
</Stack>
<Stack gap={'x4'} className={footerRightWrapper}>
<a
href={'https://docs.zora.co/docs/smart-contracts/nouns-builder/intro'}
href={'https://builder-docs.vercel.app/reference/intro'}
target="_blank"
rel="noreferrer"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import { Box } from '@zoralabs/zord'
import { exploreSkeleton } from '../Explore/Explore.css'
import { GridContainer } from './DaoFeed'

export const DaoFeedCardSkeleton = ({ key }: { key?: any }) => {
export const DaoFeedCardSkeleton = () => {
return (
<Box
key={key}
borderRadius="curved"
backgroundColor="background2"
width={'100%'}
aspectRatio={1 / 1}
aspectRatio={1}
position="relative"
className={exploreSkeleton}
/>
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/modules/dashboard/DaoAuctionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { auctionAbi } from 'src/data/contract/abis'
import { useCountdown, useIsMounted } from 'src/hooks'
import { AddressType } from 'src/typings'

import { chainIdToSlug } from '../../utils/helpers'
import { overflowEllipsis } from '../auction/components/Auction.css'
import { AuctionPaused } from './AuctionPaused'
import { BidActionButton } from './BidActionButton'
Expand Down Expand Up @@ -75,7 +76,7 @@ export const DaoAuctionCard = (props: DaoAuctionCardProps) => {
const handleSelectAuction = () => {
router.push(`/dao/${currentChainSlug}/${tokenAddress}`)
}
const currentChainSlug = PUBLIC_ALL_CHAINS.find((chain) => chain.id === chainId)?.slug
const currentChainSlug = chainIdToSlug(chainId)

if (!currentAuction) {
return (
Expand Down
45 changes: 31 additions & 14 deletions apps/web/src/pages/profile/[user].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useLayoutStore } from 'src/stores'
import { useChainStore } from 'src/stores/useChainStore'
import { artworkSkeleton } from 'src/styles/Artwork.css'
import { getEnsAddress } from 'src/utils/ens'
import { walletSnippet } from 'src/utils/helpers'
import { chainIdToSlug, walletSnippet } from 'src/utils/helpers'

import { NextPageWithLayout } from '../_app'
import { UserTokensResponse } from '../api/profile/[network]/[user]/tokens'
Expand Down Expand Up @@ -52,8 +52,6 @@ const ProfilePage: NextPageWithLayout<ProfileProps> = ({ userAddress }) => {

const { handlePageBack, handlePageForward } = usePagination(tokens?.hasNextPage)

const daosString = daos?.map((x) => x.name).join(', ')

return (
<Flex
align={'center'}
Expand Down Expand Up @@ -118,17 +116,36 @@ const ProfilePage: NextPageWithLayout<ProfileProps> = ({ userAddress }) => {
<Text mr="x4" fontWeight={'display'}>
DAOs
</Text>
{isLoading ? (
<Box
backgroundColor="background2"
h="x6"
w="100%"
className={artworkSkeleton}
borderRadius="normal"
/>
) : (
<Text color="text3">{daosString || 'No DAO tokens owned.'}</Text>
)}
{
isLoading ? (
<Box
backgroundColor="background2"
h="x6"
w="100%"
className={artworkSkeleton}
borderRadius="normal"
/>
) : (
daos && daos?.length > 0 ? (
<Text color="text3">
{daos.map((dao, index) => (
<>
<Link
href={`https://nouns.build/dao/${chainIdToSlug(dao.chainId)}/${dao.collectionAddress}`}
style={{ textDecoration: 'none', color: 'inherit' }}
className='profile-dao-links'
>
{dao.name}
</Link>
{index < daos.length - 1 && ', '}
</>
))}
</Text>
) : (
<Text>No DAO tokens owned.</Text>
)
)
}
</Flex>
</Box>
{!isMobile && (
Expand Down
5 changes: 5 additions & 0 deletions apps/web/src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import isEqual from 'lodash/isEqual'
import { isAddress } from 'viem'

import { Duration } from 'src/typings'
import { PUBLIC_ALL_CHAINS } from '../constants/defaultChains'

/**
*
Expand Down Expand Up @@ -276,9 +277,13 @@ export const isPossibleMarkdown = (text: string) => {
/(?:\*\*[^\*]+\*\*)|(?:__[^\_]+__)|(?:\*[^\*]+\*)|(?:_[^\_]+_)|(?:\#[^\#]+\#)|(?:\!\[[^\]]*\]\([^\)]+\))|(?:\[[^\]]+\]\([^\)]+\))/g
return markdownRegex.test(text)
}

export function maxChar(str: string, maxLength: number) {
if (str.length <= maxLength) {
return str
}
return str.slice(0, maxLength) + '...'
}

export const chainIdToSlug = (chainId: number) =>
PUBLIC_ALL_CHAINS.find((chain) => chain.id === chainId)?.slug
8 changes: 8 additions & 0 deletions packages/zoralabs-zord/src/theme.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,11 @@ globalStyle('h1,h2,h3,h4,h5,h6,p', {
padding: 0,
margin: 0,
})

globalStyle('.profile-dao-links', {
marginRight: '0 !important',
})

globalStyle('.profile-dao-links::after', {
content: 'none !important',
})

0 comments on commit 6b65300

Please sign in to comment.