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

main => testnet #167

Merged
merged 17 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"@next/next/no-img-element": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"jsx-a11y/role-supports-aria-props": "off"
"jsx-a11y/role-supports-aria-props": "off",
"no-use-before-define" :"error"
},
"ignorePatterns": ["/src/generated/types.ts"]
}
63 changes: 53 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,70 @@
name: "Bug Report"
description: 'Report a reproducible bug in the Lenster'
labels: 'needs review'
description: "Report a reproducible bug in the Lenster"
labels: "needs review"
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
- type: markdown

- type: checkboxes
attributes:
value: If you leave out sections there is a high likelihood your issue will be closed.
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true

- type: textarea
attributes:
label: Summary
description: Describe the issue in 1 or 2 sentences
placeholder: Clearly describe what the expected behavior is vs. what is actually happening.
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: true
required: false

- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false

- type: textarea
attributes:
label: Steps To Reproduce
description: Steps or code snippets to reproduce the behavior.
validations:
required: false

- type: dropdown
attributes:
label: What platform(s) does this occur on?
multiple: true
options:
- Android
- iOS
- Web
- Mobile
validations:
required: true

- type: dropdown
attributes:
label: What browser(s) does this occur on?
multiple: true
options:
- Chrome
- Firefox
- Brave
- Safari
- Edge
- Others
validations:
required: true

- type: textarea
attributes:
label: Anything else?
description: |
Screenshots? Anything that will give us more context about the issue you are encountering!

Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Feature Request"
description: "Request a feature for Lenster"
labels: "needs review"
body:
- type: textarea
attributes:
label: Summary
description: Describe the feature in 1 or 2 sentences
placeholder: Clearly describe what you want to see in Lenster.
validations:
required: true
6 changes: 5 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ export default defineConfig({
env: {
is_mainnet: process.env.NEXT_PUBLIC_IS_MAINNET === 'true'
},
e2e: { setupNodeEvents() {} }
e2e: {
setupNodeEvents() {
//do nothing
}
}
})
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"dependencies": {
"@apollo/client": "^3.6.9",
"@giphy/js-fetch-api": "^4.3.1",
"@giphy/react-components": "^5.12.0",
"@giphy/react-components": "^5.13.0",
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^2.9.6",
"@sentry/nextjs": "^7.7.0",
"@sentry/nextjs": "^7.8.0",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tippyjs/react": "^4.2.6",
"@types/react-mentions": "^4.1.6",
Expand Down Expand Up @@ -56,19 +56,19 @@
"react-mentions": "4.4.7",
"use-streak": "^1.0.4",
"uuid": "^8.3.2",
"wagmi": "^0.5.11",
"wagmi": "^0.6.0",
"zod": "^3.17.10",
"zustand": "^4.0.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.10.0",
"@graphql-codegen/cli": "^2.11.2",
"@graphql-codegen/fragment-matcher": "^3.3.0",
"@graphql-codegen/typescript": "^2.7.2",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/line-clamp": "^0.4.0",
"@types/node": "^18.0.6",
"@types/node": "^18.6.2",
"@types/react": "^18.0.15",
"@types/react-copy-to-clipboard": "^5.0.3",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.0.6",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^8.3.4",
Expand Down
22 changes: 16 additions & 6 deletions src/components/Comment/NewComment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ import {
} from 'src/constants'
import { useAppPersistStore, useAppStore } from 'src/store/app'
import { v4 as uuid } from 'uuid'
import { useContractWrite, useSignTypedData } from 'wagmi'
import {
useContractWrite,
usePrepareContractWrite,
useSignTypedData
} from 'wagmi'

const Attachment = dynamic(() => import('../../Shared/Attachment'), {
loading: () => <div className="mb-1 w-5 h-5 rounded-lg shimmer" />
Expand Down Expand Up @@ -137,15 +141,20 @@ const NewComment: FC<Props> = ({
setSelectedModule(defaultModuleData)
setFeeData(defaultFeeData)
}
const { config } = usePrepareContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'commentWithSig',
enabled: false
})

const {
data,
error,
isLoading: writeLoading,
write
} = useContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'commentWithSig',
...config,
onSuccess() {
onCompleted()
},
Expand Down Expand Up @@ -213,9 +222,10 @@ const NewComment: FC<Props> = ({
data: { broadcast: result }
} = await broadcast({ variables: { request: { id, signature } } })

if ('reason' in result) write({ args: inputStruct })
if ('reason' in result)
write?.({ recklesslySetUnpreparedArgs: inputStruct })
} else {
write({ args: inputStruct })
write?.({ recklesslySetUnpreparedArgs: inputStruct })
}
} catch (error) {
Logger.warn('[Sign Error]', error)
Expand Down
22 changes: 16 additions & 6 deletions src/components/Community/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import {
import Custom404 from 'src/pages/404'
import { useAppPersistStore, useAppStore } from 'src/store/app'
import { v4 as uuid } from 'uuid'
import { useContractWrite, useSignTypedData } from 'wagmi'
import {
useContractWrite,
usePrepareContractWrite,
useSignTypedData
} from 'wagmi'
import { object, string } from 'zod'

const newCommunitySchema = object({
Expand All @@ -59,14 +63,19 @@ const Create: NextPage = () => {
}
})

const { config } = usePrepareContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'postWithSig',
enabled: false
})

const {
data,
isLoading: writeLoading,
write
} = useContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'postWithSig',
...config,
onError(error: any) {
toast.error(error?.data?.message ?? error?.message)
}
Expand Down Expand Up @@ -142,9 +151,10 @@ const Create: NextPage = () => {
data: { broadcast: result }
} = await broadcast({ variables: { request: { id, signature } } })

if ('reason' in result) write({ args: inputStruct })
if ('reason' in result)
write?.({ recklesslySetUnpreparedArgs: inputStruct })
} else {
write({ args: inputStruct })
write?.({ recklesslySetUnpreparedArgs: inputStruct })
}
} catch (error) {
Logger.warn('[Sign Error]', error)
Expand Down
19 changes: 15 additions & 4 deletions src/components/Community/Join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ import {
SIGN_WALLET
} from 'src/constants'
import { useAppPersistStore, useAppStore } from 'src/store/app'
import { useAccount, useContractWrite, useSignTypedData } from 'wagmi'
import {
useAccount,
useContractWrite,
usePrepareContractWrite,
useSignTypedData
} from 'wagmi'

const CREATE_COLLECT_TYPED_DATA_MUTATION = gql`
mutation CreateCollectTypedData(
Expand Down Expand Up @@ -75,10 +80,15 @@ const Join: FC<Props> = ({ community, setJoined, showJoin = true }) => {
toast.success('Joined successfully!')
}

const { isLoading: writeLoading, write } = useContractWrite({
const { config } = usePrepareContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'collectWithSig',
enabled: false
})

const { isLoading: writeLoading, write } = useContractWrite({
...config,
onSuccess() {
onCompleted()
},
Expand Down Expand Up @@ -133,9 +143,10 @@ const Join: FC<Props> = ({ community, setJoined, showJoin = true }) => {
data: { broadcast: result }
} = await broadcast({ variables: { request: { id, signature } } })

if ('reason' in result) write({ args: inputStruct })
if ('reason' in result)
write?.({ recklesslySetUnpreparedArgs: inputStruct })
} else {
write({ args: inputStruct })
write?.({ recklesslySetUnpreparedArgs: inputStruct })
}
} catch (error) {
Logger.warn('[Sign Error]', error)
Expand Down
22 changes: 16 additions & 6 deletions src/components/Crowdfund/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ import {
import Custom404 from 'src/pages/404'
import { useAppPersistStore, useAppStore } from 'src/store/app'
import { v4 as uuid } from 'uuid'
import { useContractWrite, useSignTypedData } from 'wagmi'
import {
useContractWrite,
usePrepareContractWrite,
useSignTypedData
} from 'wagmi'
import { object, string } from 'zod'

const MODULES_CURRENCY_QUERY = gql`
Expand Down Expand Up @@ -92,14 +96,19 @@ const Create: NextPage = () => {
}
})

const { config } = usePrepareContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'postWithSig',
enabled: false
})

const {
data,
isLoading: writeLoading,
write
} = useContractWrite({
addressOrName: LENSHUB_PROXY,
contractInterface: LensHubProxy,
functionName: 'postWithSig',
...config,
onError(error: any) {
toast.error(error?.data?.message ?? error?.message)
}
Expand Down Expand Up @@ -178,9 +187,10 @@ const Create: NextPage = () => {
data: { broadcast: result }
} = await broadcast({ variables: { request: { id, signature } } })

if ('reason' in result) write({ args: inputStruct })
if ('reason' in result)
write?.({ recklesslySetUnpreparedArgs: inputStruct })
} else {
write({ args: inputStruct })
write?.({ recklesslySetUnpreparedArgs: inputStruct })
}
} catch (error) {
Logger.warn('[Sign Error]', error)
Expand Down
Loading