Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mutual follows modal #1112

Merged
merged 12 commits into from
Nov 5, 2023
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"framer-motion": "^10.16.4",
"graphql": "^16.8.1",
"interweave": "^13.1.0",
"keen-slider": "^6.8.6",
"make-plural": "^7.3.0",
"next": "14.0.1",
"next-themes": "^0.2.1",
Expand Down
18 changes: 9 additions & 9 deletions apps/web/src/components/Common/FollowActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Follow from '@components/Profile/BasicInfo/Follow'
import SuperFollow from '@components/Profile/BasicInfo/SuperFollow'
import UnFollow from '@components/Profile/BasicInfo/UnFollow'
import type { Profile } from '@tape.xyz/lens'
import { FollowModuleType, type Profile } from '@tape.xyz/lens'
import type { FC } from 'react'
import React, { useEffect, useState } from 'react'

Expand All @@ -11,33 +11,33 @@ type Props = {
}

const FollowActions: FC<Props> = ({ profile, size = '2' }) => {
const isSubscriber = profile?.operations.isFollowedByMe.value
const [subscriber, setSubscriber] = useState(isSubscriber)
const subscribeType = profile?.followModule?.__typename
const isFollowedByMe = profile?.operations.isFollowedByMe.value
const [subscriber, setSubscriber] = useState(isFollowedByMe)
const followModule = profile?.followModule?.type

useEffect(() => {
setSubscriber(isSubscriber)
}, [isSubscriber])
setSubscriber(isFollowedByMe)
}, [isFollowedByMe])

return subscriber ? (
<UnFollow
size={size}
profile={profile}
onUnSubscribe={() => setSubscriber(false)}
/>
) : subscribeType === 'FeeFollowModuleSettings' ? (
) : followModule === FollowModuleType.FeeFollowModule ? (
<SuperFollow
size={size}
profile={profile}
onJoin={() => setSubscriber(true)}
/>
) : (
) : !followModule ? (
<Follow
size={size}
profile={profile}
onSubscribe={() => setSubscriber(true)}
/>
)
) : null
}

export default FollowActions
89 changes: 0 additions & 89 deletions apps/web/src/components/Common/LiveStreamCard.tsx

This file was deleted.

37 changes: 37 additions & 0 deletions apps/web/src/components/Common/UserProfile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Avatar } from '@radix-ui/themes'
import { getProfile, getProfilePicture } from '@tape.xyz/generic'
import type { Profile } from '@tape.xyz/lens'
import Link from 'next/link'
import React from 'react'

import HoverableProfile from './HoverableProfile'

const UserProfile = ({ profile }: { profile: Profile }) => {
if (!profile) {
return null
}

return (
<div>
<Link
href={getProfile(profile).link}
className="flex items-center space-x-2"
>
<Avatar
radius="full"
src={getProfilePicture(profile, 'AVATAR')}
fallback={getProfile(profile).displayName[0]}
alt={getProfile(profile).displayName}
/>
<div className="flex flex-col">
<h2 className="line-clamp-1 font-semibold">
{getProfile(profile).displayName}
</h2>
<HoverableProfile profile={profile} />
</div>
</Link>
</div>
)
}

export default UserProfile
12 changes: 8 additions & 4 deletions apps/web/src/components/Home/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Loader } from '@tape.xyz/ui'
import React from 'react'
import { useInView } from 'react-cool-inview'

const Feed = () => {
const Feed = ({ showFilter = true }) => {
const activeTagFilter = useAppStore((state) => state.activeTagFilter)

const request: ExplorePublicationRequest = {
Expand Down Expand Up @@ -66,9 +66,13 @@ const Feed = () => {
})

return (
<div className="laptop:pt-6 pt-4">
<CategoryFilters />
<div className="laptop:pt-4 pt-4">
<div className="laptop:pt-6 space-y-4 pt-4">
{showFilter && (
<div>
<CategoryFilters />
</div>
)}
<div>
{loading && <TimelineShimmer />}
{!error && !loading && videos.length > 0 && (
<>
Expand Down
36 changes: 19 additions & 17 deletions apps/web/src/components/Home/LatestBytes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,25 @@ const LatestBytes = () => {
</h1>
</div>
</Link>
<Link
href={`/u/${getProfile(byte.by)?.slug}`}
className="flex items-center space-x-1 px-3 py-1"
>
<img
className="h-4 w-4 rounded-full bg-gray-200 dark:bg-gray-800"
src={getProfilePicture(byte.by, 'AVATAR')}
height={50}
width={50}
alt={`${getProfile(byte.by)?.slug}'s PFP`}
draggable={false}
/>
<span className="flex items-center space-x-1 font-medium">
<span>{getProfile(byte.by)?.slug}</span>
<Badge id={byte.by.id} size="xs" />
</span>
</Link>
<span>
<Link
href={getProfile(byte.by)?.link}
className="inline-flex items-center space-x-1 px-3 py-1"
>
<img
className="h-4 w-4 rounded-full bg-gray-200 dark:bg-gray-800"
src={getProfilePicture(byte.by, 'AVATAR')}
height={50}
width={50}
alt={`${getProfile(byte.by)?.slug}'s PFP`}
draggable={false}
/>
<span className="flex items-center space-x-1 font-medium">
<span>{getProfile(byte.by)?.slug}</span>
<Badge id={byte.by.id} size="xs" />
</span>
</Link>
</span>
</div>
)
})}
Expand Down
69 changes: 0 additions & 69 deletions apps/web/src/components/Home/Popping/UnlonelyStreams.tsx

This file was deleted.

61 changes: 0 additions & 61 deletions apps/web/src/components/Home/Popping/index.tsx

This file was deleted.

Loading