Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit a83762f

Browse files
committed
automatic formatting by prettier/eslint
1 parent 97872a0 commit a83762f

File tree

34 files changed

+224
-241
lines changed

34 files changed

+224
-241
lines changed

apps/web/src/components/Avatar/Avatar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { avatar, avatarVariants } from './Avatar.css'
77

88
export interface AvatarProps extends Omit<BoxProps, 'size'> {
99
address?: string
10-
size?: keyof typeof avatarVariants['size']
11-
variant?: keyof typeof avatarVariants['variant']
10+
size?: keyof (typeof avatarVariants)['size']
11+
variant?: keyof (typeof avatarVariants)['variant']
1212
src?: string | null
1313
}
1414

apps/web/src/components/Avatar/DaoAvatar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export interface DaoAvatarProps extends Omit<BoxProps, 'size'> {
1212
collectionAddress: string
1313
auctionAddress: string
1414
chainId: CHAIN_ID
15-
size?: keyof typeof avatarVariants['size']
16-
variant?: keyof typeof avatarVariants['variant']
15+
size?: keyof (typeof avatarVariants)['size']
16+
variant?: keyof (typeof avatarVariants)['variant']
1717
src?: string | null
1818
}
1919

apps/web/src/components/Fields/Date.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,20 @@ interface DateProps {
3030
disabled?: boolean
3131
}
3232

33-
const Date: React.FC<DateProps> = (
34-
{
35-
inputLabel,
36-
formik,
37-
id,
38-
errorMessage,
39-
helperText,
40-
autoSubmit,
41-
value,
42-
placeholder,
43-
altFormat,
44-
enableTime = false,
45-
dateFormat = 'Y-m-d',
46-
disabled = false,
47-
}
48-
) => {
33+
const Date: React.FC<DateProps> = ({
34+
inputLabel,
35+
formik,
36+
id,
37+
errorMessage,
38+
helperText,
39+
autoSubmit,
40+
value,
41+
placeholder,
42+
altFormat,
43+
enableTime = false,
44+
dateFormat = 'Y-m-d',
45+
disabled = false,
46+
}) => {
4947
const ref = React.useRef(null)
5048

5149
React.useEffect(() => {

apps/web/src/components/Home/GetStarted.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const GetStarted = () => {
2929
!address
3030
? openConnectModal
3131
: wagmiChain?.id != chain.id
32-
? handleSwitchNetwork
33-
: handleClick
32+
? handleSwitchNetwork
33+
: handleClick
3434
}
3535
h="x16"
3636
fontWeight={'display'}

apps/web/src/hooks/useArtworkPreview.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { BaseSyntheticEvent } from 'react'
22

33
import { OrderedTraits } from 'src/components/Artwork/LayerBox'
4-
54
import { RENDERER_BASE } from 'src/constants/rendererBase'
65

76
import { ImageProps } from './useArtworkUpload'
@@ -169,7 +168,7 @@ export const useArtworkPreview = ({ images, orderedLayers }: UseArtworkPreviewPr
169168
}
170169

171170
if (isInit) {
172-
imagesToDraw[0].onload = function() {
171+
imagesToDraw[0].onload = function () {
173172
generate()
174173
setIsInit(false)
175174
}

apps/web/src/modules/create-dao/components/CreateNavigation/NavSection.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ export const NavSection: React.FC<{
3939
!!setUpArtwork.artwork.length
4040
? 'previewActive'
4141
: activeSection === 4 && !!setUpArtwork.artwork.length
42-
? 'preview'
43-
: sections[activeSection]?.title === section?.title
44-
? sections.indexOf(section) + 1 === sections.length
45-
? 'flowCircleActiveLast'
46-
: 'flowCircleActive'
47-
: fulfilledSections.includes(section?.title)
48-
? sections.indexOf(section) + 1 === sections.length
49-
? 'flowFulfilledCircleLast'
50-
: 'flowFulfilledCircle'
51-
: sections.indexOf(section) + 1 === sections.length
52-
? 'flowCircleLast'
53-
: 'flowCircle'
42+
? 'preview'
43+
: sections[activeSection]?.title === section?.title
44+
? sections.indexOf(section) + 1 === sections.length
45+
? 'flowCircleActiveLast'
46+
: 'flowCircleActive'
47+
: fulfilledSections.includes(section?.title)
48+
? sections.indexOf(section) + 1 === sections.length
49+
? 'flowFulfilledCircleLast'
50+
: 'flowFulfilledCircle'
51+
: sections.indexOf(section) + 1 === sections.length
52+
? 'flowCircleLast'
53+
: 'flowCircle'
5454
)
5555

5656
setTitleType(
@@ -59,12 +59,12 @@ export const NavSection: React.FC<{
5959
!!setUpArtwork.artwork.length
6060
? 'previewActive'
6161
: activeSection === 4 && !!setUpArtwork.artwork.length
62-
? 'preview'
63-
: fulfilledSections.includes(section?.title)
64-
? 'fulfilled'
65-
: sections[activeSection]?.title === section?.title
66-
? 'active'
67-
: 'default'
62+
? 'preview'
63+
: fulfilledSections.includes(section?.title)
64+
? 'fulfilled'
65+
: sections[activeSection]?.title === section?.title
66+
? 'active'
67+
: 'default'
6868
)
6969
}, [section, sections, fulfilledSections, activeSection, setUpArtwork])
7070

apps/web/src/modules/create-dao/components/ReviewAndDeploy/ReviewAndDeploy.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { defaultBackButton } from 'src/components/Fields/styles.css'
2121
import { Icon } from 'src/components/Icon'
2222
import { PUBLIC_MANAGER_ADDRESS } from 'src/constants/addresses'
2323
import { NULL_ADDRESS } from 'src/constants/addresses'
24+
import { RENDERER_BASE } from 'src/constants/rendererBase'
2425
import { managerAbi } from 'src/data/contract/abis'
2526
import { managerV2Abi } from 'src/data/contract/abis/ManagerV2'
2627
import { L2_CHAINS } from 'src/data/contract/chains'
@@ -35,7 +36,6 @@ import {
3536
import type { AddressType } from 'src/typings'
3637
import { toSeconds } from 'src/utils/helpers'
3738
import { sanitizeStringForJSON } from 'src/utils/sanitize'
38-
import { RENDERER_BASE } from 'src/constants/rendererBase'
3939

4040
import { useFormStore } from '../../stores'
4141
import { PreviewArtwork } from './PreviewArtwork'
@@ -233,7 +233,7 @@ export const ReviewAndDeploy: React.FC<ReviewAndDeploy> = ({ title }) => {
233233
topics: deployEvent?.topics || [],
234234
data: deployEvent?.data || '0x',
235235
})
236-
} catch { }
236+
} catch {}
237237

238238
const deployedAddresses = parsedEvent?.args
239239

@@ -320,7 +320,7 @@ export const ReviewAndDeploy: React.FC<ReviewAndDeploy> = ({ title }) => {
320320
justify={'center'}
321321
className={
322322
deployCheckboxStyleVariants[
323-
hasConfirmedTerms ? 'confirmed' : 'default'
323+
hasConfirmedTerms ? 'confirmed' : 'default'
324324
]
325325
}
326326
onClick={() => setHasConfirmedTerms((bool) => !bool)}
@@ -350,7 +350,7 @@ export const ReviewAndDeploy: React.FC<ReviewAndDeploy> = ({ title }) => {
350350
justify={'center'}
351351
className={
352352
deployCheckboxStyleVariants[
353-
hasConfirmedChain ? 'confirmed' : 'default'
353+
hasConfirmedChain ? 'confirmed' : 'default'
354354
]
355355
}
356356
onClick={() => setHasConfirmedChain((bool) => !bool)}
@@ -372,7 +372,7 @@ export const ReviewAndDeploy: React.FC<ReviewAndDeploy> = ({ title }) => {
372372
justify={'center'}
373373
className={
374374
deployCheckboxStyleVariants[
375-
hasConfirmedRewards ? 'confirmed' : 'default'
375+
hasConfirmedRewards ? 'confirmed' : 'default'
376376
]
377377
}
378378
onClick={() => setHasConfirmedRewards((bool) => !bool)}
@@ -383,7 +383,9 @@ export const ReviewAndDeploy: React.FC<ReviewAndDeploy> = ({ title }) => {
383383
<Flex className={deployCheckboxHelperText}>
384384
I have read the{' '}
385385
<a
386-
href={'https://builder-docs.vercel.app/guides/builder-protocol-rewards/'}
386+
href={
387+
'https://builder-docs.vercel.app/guides/builder-protocol-rewards/'
388+
}
387389
target="_blank"
388390
className={atoms({ color: 'accent' })}
389391
rel="noreferrer"

apps/web/src/modules/create-proposal/components/FixRendererBase/FixRendererBase.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ export const FixRendererBase = ({
2424
const createProposal = useProposalStore((state) => state.createProposal)
2525
const chain = useChainStore((x) => x.chain)
2626

27-
const {
28-
description,
29-
transaction,
30-
shouldFix,
31-
} = useRendererBaseFix({
27+
const { description, transaction, shouldFix } = useRendererBaseFix({
3228
chainId: chain.id,
3329
addresses,
3430
})

apps/web/src/modules/create-proposal/components/TransactionForm/Escrow/Escrow.tsx

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1+
import { InvoiceMetadata, Milestone as MilestoneMetadata } from '@smartinvoicexyz/types'
12
import { Stack } from '@zoralabs/zord'
23
import { useCallback } from 'hono/jsx'
34
import { uploadFile } from 'ipfs-service'
45
import { useRouter } from 'next/router'
56
import { useState } from 'react'
67
import useSWR from 'swr'
78
import { encodeFunctionData, formatEther } from 'viem'
8-
import { useDaoStore } from 'src/modules/dao'
99

1010
import SWR_KEYS from 'src/constants/swrKeys'
1111
import { ProposalsResponse } from 'src/data/subgraph/requests/proposalsQuery'
1212
import { getProposals } from 'src/data/subgraph/requests/proposalsQuery'
1313
import { TransactionType } from 'src/modules/create-proposal/constants'
1414
import { useProposalStore } from 'src/modules/create-proposal/stores'
15+
import { useDaoStore } from 'src/modules/dao'
1516
import { getChainFromLocalStorage } from 'src/utils/getChainFromLocalStorage'
16-
import { InvoiceMetadata, Milestone as MilestoneMetadata } from '@smartinvoicexyz/types'
1717

1818
import EscrowForm from './EscrowForm'
1919
import { EscrowFormValues } from './EscrowForm.schema'
2020
import {
21-
encodeEscrowData,
21+
ESCROW_TYPE,
2222
deployEscrowAbi,
23+
encodeEscrowData,
2324
getEscrowBundler,
24-
ESCROW_TYPE,
2525
} from './EscrowUtils'
2626

2727
export const Escrow: React.FC = () => {
@@ -48,7 +48,7 @@ export const Escrow: React.FC = () => {
4848
const handleEscrowTransaction = useCallback(
4949
async (values: EscrowFormValues) => {
5050
if (!treasury) {
51-
return;
51+
return
5252
}
5353
const ipfsDataToUpload: InvoiceMetadata = {
5454
title: 'Proposal #' + (lastProposalId + 1),
@@ -59,38 +59,44 @@ export const Escrow: React.FC = () => {
5959
endDate: new Date(
6060
values.milestones[values.milestones.length - 1].endDate
6161
).getTime(),
62-
milestones: values.milestones.map((x, index) => ({
63-
id: 'milestone-00' + index,
64-
title: x.title,
65-
description: x.description,
66-
endDate: new Date(x.endDate).getTime() / 1000, // in seconds
67-
createdAt: Date.now() / 1000, // in seconds
68-
// set start date 7 days from submission in seconds
69-
startDate: index === 0 ? (Date.now() / 1000) + 7 * 24 * 60 * 60 : new Date(values.milestones[index - 1].endDate).getTime() / 1000,
70-
resolverType: 'kleros',
71-
klerosCourt: 1,
72-
...(x.mediaType && x.mediaUrl
73-
? {
74-
documents: [
75-
{
76-
id: 'doc-001',
77-
type: 'ipfs',
78-
src: x.mediaUrl,
79-
mimeType: x.mediaType,
80-
createdAt: new Date().getTime() / 1000,
81-
},
82-
],
83-
}
84-
: {}),
85-
} as MilestoneMetadata)),
62+
milestones: values.milestones.map(
63+
(x, index) =>
64+
({
65+
id: 'milestone-00' + index,
66+
title: x.title,
67+
description: x.description,
68+
endDate: new Date(x.endDate).getTime() / 1000, // in seconds
69+
createdAt: Date.now() / 1000, // in seconds
70+
// set start date 7 days from submission in seconds
71+
startDate:
72+
index === 0
73+
? Date.now() / 1000 + 7 * 24 * 60 * 60
74+
: new Date(values.milestones[index - 1].endDate).getTime() / 1000,
75+
resolverType: 'kleros',
76+
klerosCourt: 1,
77+
...(x.mediaType && x.mediaUrl
78+
? {
79+
documents: [
80+
{
81+
id: 'doc-001',
82+
type: 'ipfs',
83+
src: x.mediaUrl,
84+
mimeType: x.mediaType,
85+
createdAt: new Date().getTime() / 1000,
86+
},
87+
],
88+
}
89+
: {}),
90+
}) as MilestoneMetadata
91+
),
8692
}
8793

8894
const jsonDataToUpload = JSON.stringify(ipfsDataToUpload, null, 2)
8995
const fileToUpload = new File([jsonDataToUpload], 'escrow-data.json', {
9096
type: 'application/json',
9197
})
9298

93-
let cid: string, uri: string;
99+
let cid: string, uri: string
94100

95101
try {
96102
console.log('Uploading to IPFS...')
@@ -128,7 +134,13 @@ export const Escrow: React.FC = () => {
128134
calldata: encodeFunctionData({
129135
abi: deployEscrowAbi,
130136
functionName: 'deployEscrow',
131-
args: [values.recipientAddress, milestoneAmounts, escrowData, ESCROW_TYPE, fundAmount],
137+
args: [
138+
values.recipientAddress,
139+
milestoneAmounts,
140+
escrowData,
141+
ESCROW_TYPE,
142+
fundAmount,
143+
],
132144
}),
133145
value: formatEther(BigInt(fundAmount)),
134146
}
@@ -151,10 +163,7 @@ export const Escrow: React.FC = () => {
151163

152164
return (
153165
<Stack>
154-
<EscrowForm
155-
onSubmit={handleEscrowTransaction}
156-
isSubmitting={isSubmitting}
157-
/>
166+
<EscrowForm onSubmit={handleEscrowTransaction} isSubmitting={isSubmitting} />
158167
{ipfsUploadError?.message && <div>Error: {ipfsUploadError.message}</div>}
159168
</Stack>
160169
)

apps/web/src/modules/create-proposal/components/TransactionForm/Escrow/EscrowForm.schema.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const EscrowFormSchema = yup
6565
recipientAddress: addressValidationSchema.test(
6666
'not-same-as-client',
6767
'Recipient address must be different from client address',
68-
function(value) {
68+
function (value) {
6969
return value?.toLowerCase() !== this?.parent.clientAddress.toLowerCase()
7070
}
7171
),
@@ -79,7 +79,7 @@ export const EscrowFormSchema = yup
7979
.test(
8080
'after-last-milestone',
8181
'Safety valve date must be at least 30 days after the last milestone date.',
82-
function(value) {
82+
function (value) {
8383
const milestones = (this.parent.milestones || []) as MilestoneFormValues[]
8484
if (milestones.length === 0) return true
8585

@@ -105,7 +105,7 @@ export const EscrowFormSchema = yup
105105
.test(
106106
'addresses-not-same',
107107
'Client address and recipient address must be different',
108-
function(values) {
108+
function (values) {
109109
return values.clientAddress !== values.recipientAddress
110110
}
111111
)

0 commit comments

Comments
 (0)