Skip to content

Commit

Permalink
🔁 Sync testnet with main (#138)
Browse files Browse the repository at this point in the history
* 🔁 Sync testnet with main (#133) (#134)

* 🔁 Sync testnet with main (#106) (#107)

* feat: add sybil badge (#89)

* feat: add badges comp (#90)

* chore: add sybil badge

* feat: add tooltip to badges (#91)

* feat: collect publication without profile 🚀  (#92)

* feat: add isConnected store

* chore: use setIsConnected

* chore: add proper disconnect

* chore: add valid check

* chore: add create profile component

* feat: add unauthed user menu items

* chore: update error message

* chore: cleanup

* fix: remove unused isAuthenticated

* fix: nonce issue for non profile users

* fix: allowance fetch

* fix: remove current user deps in collect module

* feat: add non auth follow (#93)

* feat: add non auth crowdfund support (#94)

* chore: update sponsor link

* ⬆️ deps(dev): Bump eslint-config-next from 12.2.2 to 12.2.3 (#100)

Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 12.2.2 to 12.2.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v12.2.3/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bigint <69431456+bigint@users.noreply.github.com>

* ⬆️ deps: Bump next from 12.2.2 to 12.2.3 (#97)

Bumps [next](https://github.com/vercel/next.js) from 12.2.2 to 12.2.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v12.2.2...v12.2.3)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bigint <69431456+bigint@users.noreply.github.com>

* ⬆️ deps: Bump plyr-react from 5.0.2 to 5.1.0 (#99)

Bumps [plyr-react](https://github.com/chintan9/plyr-react) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/chintan9/plyr-react/releases)
- [Changelog](https://github.com/chintan9/plyr-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/chintan9/plyr-react/commits)

---
updated-dependencies:
- dependency-name: plyr-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ deps: Bump zod from 3.17.9 to 3.17.10 (#98)

Bumps [zod](https://github.com/colinhacks/zod) from 3.17.9 to 3.17.10.
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md)
- [Commits](colinhacks/zod@v3.17.9...v3.17.10)

---
updated-dependencies:
- dependency-name: zod
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add entire pub clickable

* fix: use clickable props

* chore: cleanup full post comp

* chore: cleanup post type

* Revert "feat: add entire pub clickable" (#104)

* chore: use article tag

* fix: add stopPropagation for post actions

* revert: make pub clickable

* chore: refactor show more

* chore: add user check

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove unnecessary boolean casts (#108)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* Fix explicit type declarations (#109)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* fix: add passhref and closes #120

* fix: remove unused onClick

* Remove the undefined type from optional property (#110)

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* fix: remove unused clickable

* fix: remove unused param

* chore: update yarn.lock

* fix: typo in walletselector comp

Co-Authored-By: Barabazs <31799121+Barabazs@users.noreply.github.com>

* feat: add profile warning below navbar (#130)

* fix: use pascal case for seo tag (#131)

* chore: fix #129

* fix: #129

* fix: use const instead of let (#132)

* fix: use const and closes #124

* fix: remove unused variable and closes #123

* fix: add type to button and closes #127

* fix: add title to iframe and closes #119

* fix: add sandbox and closes #111

* fix: sandbox in iframe

* fix: escape special chars and closes #118

Co-authored-by: bigint <69431456+bigint@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Barabazs <31799121+Barabazs@users.noreply.github.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Barabazs <31799121+Barabazs@users.noreply.github.com>

* chore: update yarn.lock

* feat: add relevant people to pub sidebar (#135)

* fix: remove skip condition

* fix: typo

* Update verified.ts

verified more lens core team members + creative partners

* ⬆️ deps(dev): Bump @typescript-eslint/eslint-plugin (#136)

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.30.7 to 5.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.31.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bigint <69431456+bigint@users.noreply.github.com>

Co-authored-by: bigint <69431456+bigint@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Barabazs <31799121+Barabazs@users.noreply.github.com>
Co-authored-by: David Silverman <oneski@users.noreply.github.com>
  • Loading branch information
6 people committed Jul 26, 2022
1 parent a0393db commit a5a263d
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 61 deletions.
2 changes: 1 addition & 1 deletion data/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const apps = [
},
{
id: 'iris',
name: 'iris',
name: 'Iris',
logo: 'iris.png'
},
{
Expand Down
23 changes: 23 additions & 0 deletions data/verified.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
export const mainnetVerified = [
'0x07' /** @wassim.lens */,
'0x2816' /** @cryptoguicci.lens */,
'0x2c6d' /** @shefi.lens */,
'0x2e09' /** @defidad.lens */,
'0x27' /** @0xjim.lens */,
'0x25b7' /** @stefan.lens */,
'0x2d' /** @sasicodes.lens */,
'0x1966' /** @hazbobo.lens */,
'0x1ef0' /** @lefteris.lens */,
'0x03f9' /** @ilyab.lens */,
'0x0f30' /** @thewayloveworks.lens */,
'0x31' /** @mariariivari.lens */,
'0x30fb' /** @debridge.lens */,
'0x8d94' /** @josephdelong.lens */,
'0x0d31' /** @irisapp.lens */,
'0x5b5b' /** @karmawav.lens */,
'0x09f1' /** @xinobi.lens */,
'0x2057' /** @refraction.lens */,
'0x1ed2' /** @dcbuilder.lens */,
'0x0f83' /** @ddwchen.lens */,
'0x45' /** @keeks.lens */,
'0x0dcf' /** @santi.lens */,
'0x8635' /** @teaparty.lens */,
'0x1053' /** @finematics.lens */,
'0x1c19' /** @gabriel.lens */,
'0x8e79' /** @primary.lens */,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@types/react-dom": "^18.0.6",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"autoprefixer": "^10.4.7",
"cypress": "^10.3.1",
"eslint": "^8.20.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/RecommendedProfiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const RecommendedProfiles: FC = () => {
<Title />
<Card testId="recommended-users">
<CardBody className="space-y-4">
<ErrorMessage title="Failed to recommendations" error={error} />
<ErrorMessage title="Failed to load recommendations" error={error} />
{randomizeArray(data?.recommendedProfiles)
?.slice(0, 5)
?.map((profile: Profile) => (
Expand Down
91 changes: 91 additions & 0 deletions src/components/Post/RelevantPeople.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { gql, useQuery } from '@apollo/client'
import UserProfileShimmer from '@components/Shared/Shimmer/UserProfileShimmer'
import UserProfile from '@components/Shared/UserProfile'
import { Card, CardBody } from '@components/UI/Card'
import { ErrorMessage } from '@components/UI/ErrorMessage'
import { LensterPost } from '@generated/lenstertypes'
import { Profile } from '@generated/types'
import { MinimalProfileFields } from '@gql/MinimalProfileFields'
import Logger from '@lib/logger'
import React, { FC } from 'react'

const RELEVANT_PEOPLE_QUERY = gql`
query RelevantPeople($request: ProfileQueryRequest!) {
profiles(request: $request) {
items {
...MinimalProfileFields
isFollowedByMe
}
}
}
${MinimalProfileFields}
`

interface Props {
publication: LensterPost
}

const RelevantPeople: FC<Props> = ({ publication }) => {
const mentions =
publication?.metadata?.content?.match(/([\s+])@([^\s]+)/g, '$1[~$2]') ?? []

mentions.push(publication?.profile?.handle)

const processedMentions = mentions
? mentions.map((mention: string) => {
const trimmedMention = mention.trim().replace('@', '').replace("'s", '')

if (trimmedMention.length > 9) {
return mention.trim().replace('@', '').replace("'s", '')
} else {
return publication?.profile?.handle
}
})
: []

const cleanedMentions = [...new Set(processedMentions)]

const { data, loading, error } = useQuery(RELEVANT_PEOPLE_QUERY, {
variables: { request: { handles: cleanedMentions.slice(0, 5) } },
onCompleted(data) {
Logger.log(
'[Query]',
`Fetched ${data?.cleanedMentions?.length} relevant people`
)
}
})

if (loading)
return (
<Card>
<CardBody className="space-y-4">
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
</CardBody>
</Card>
)

if (data?.profiles?.items?.length === 0) return null

return (
<Card testId="relevant-people">
<CardBody className="space-y-4">
<ErrorMessage title="Failed to load relevant people" error={error} />
{data?.profiles?.items?.map((profile: Profile) => (
<div key={profile?.id} className="truncate">
<UserProfile
profile={profile}
isFollowing={profile.isFollowedByMe}
showFollow
/>
</div>
))}
</CardBody>
</Card>
)
}

export default RelevantPeople
9 changes: 9 additions & 0 deletions src/components/Post/Shimmer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ const PostPageShimmer: FC = () => {
<UserProfileShimmer />
</CardBody>
</Card>
<Card>
<CardBody className="space-y-4">
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
<UserProfileShimmer showFollow />
</CardBody>
</Card>
<Card>
<CardBody className="flex justify-between">
<div className="w-1/2 h-3 rounded-lg shimmer" />
Expand Down
2 changes: 2 additions & 0 deletions src/components/Post/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useAppPersistStore } from 'src/store/app'

import FullPost from './FullPost'
import IPFSHash from './IPFSHash'
import RelevantPeople from './RelevantPeople'
import PostPageShimmer from './Shimmer'
import ViaApp from './ViaApp'

Expand Down Expand Up @@ -130,6 +131,7 @@ const ViewPost: NextPage = () => {
</CardBody>
<ViaApp appConfig={appConfig} />
</Card>
<RelevantPeople publication={post} />
<IPFSHash ipfsHash={post?.onChainContentURI} />
<Footer />
</GridItemFour>
Expand Down
Loading

0 comments on commit a5a263d

Please sign in to comment.