Refactor for prod build
This commit is contained in:
parent
c6b8e10d73
commit
81dc8ed867
@ -34,5 +34,3 @@ export const AnchorButton = (props: AnchorButtonProps) => {
|
||||
</Anchor>
|
||||
)
|
||||
}
|
||||
|
||||
export default AnchorButton
|
||||
|
@ -39,4 +39,3 @@ export const Button = (props: ButtonProps) => {
|
||||
</button>
|
||||
)
|
||||
}
|
||||
export default Button
|
||||
|
@ -6,7 +6,7 @@ import { useMetadataAttributesState } from 'components/forms/MetadataAttributes.
|
||||
import { useEffect, useState } from 'react'
|
||||
import toast from 'react-hot-toast'
|
||||
|
||||
import Button from './Button'
|
||||
import { Button } from './Button'
|
||||
import { TextInput } from './forms/FormInput'
|
||||
import { useInputState } from './forms/FormInput.hooks'
|
||||
import { MetadataAttributes } from './forms/MetadataAttributes'
|
||||
@ -22,7 +22,6 @@ export interface MetadataModalProps {
|
||||
export const MetadataModal = (props: MetadataModalProps) => {
|
||||
const metadataFile: File = props.metadataFile
|
||||
const [metadata, setMetadata] = useState<any>(null)
|
||||
const [imageURL, setImageURL] = useState<string>('')
|
||||
|
||||
let parsedMetadata: any
|
||||
const parseMetadata = async () => {
|
||||
|
@ -5,7 +5,7 @@
|
||||
import { coin } from '@cosmjs/proto-signing'
|
||||
import { Alert } from 'components/Alert'
|
||||
import { Anchor } from 'components/Anchor'
|
||||
import Button from 'components/Button'
|
||||
import { Button } from 'components/Button'
|
||||
import {
|
||||
CollectionDetails,
|
||||
MintingDetails,
|
||||
|
@ -1,21 +0,0 @@
|
||||
import { PutObjectCommand, S3 } from '@aws-sdk/client-s3'
|
||||
import { S3_BUCKET, S3_ENDPOINT, S3_KEY, S3_REGION, S3_SECRET } from 'utils/constants'
|
||||
|
||||
const PARAMS = {
|
||||
Bucket: S3_BUCKET,
|
||||
ACL: 'private',
|
||||
}
|
||||
|
||||
const s3Client = new S3({
|
||||
endpoint: S3_ENDPOINT,
|
||||
region: S3_REGION,
|
||||
credentials: {
|
||||
accessKeyId: S3_KEY,
|
||||
secretAccessKey: S3_SECRET,
|
||||
},
|
||||
})
|
||||
|
||||
export const uploadObject = async (key: string, body: string) => {
|
||||
const data = await s3Client.send(new PutObjectCommand({ ...PARAMS, Key: key, Body: body }))
|
||||
return data
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
import type { AccountProps } from './isValidAccountsFile'
|
||||
|
||||
export const csvToArray = (str: string, delimiter = ',') => {
|
||||
let newline = '\n'
|
||||
if (str.includes('\r')) newline = '\r'
|
||||
if (str.includes('\r\n')) newline = '\r\n'
|
||||
|
||||
const headers = str.slice(0, str.indexOf(newline)).split(delimiter)
|
||||
if (headers.length !== 2) {
|
||||
throw new Error('Invalid accounts file')
|
||||
}
|
||||
if (headers[0] !== 'address' || headers[1] !== 'amount') {
|
||||
throw new Error('Invalid accounts file')
|
||||
}
|
||||
|
||||
const rows = str.slice(str.indexOf('\n') + 1).split(newline)
|
||||
|
||||
const arr = rows
|
||||
.filter((row) => row !== '')
|
||||
.map((row) => {
|
||||
const values = row.split(delimiter)
|
||||
const el = headers.reduce((object, header, index) => {
|
||||
// @ts-expect-error assume object as Record<string, unknown>
|
||||
object[header] = values[index]
|
||||
return object
|
||||
}, {})
|
||||
return el
|
||||
})
|
||||
|
||||
return arr as AccountProps[]
|
||||
}
|
Loading…
Reference in New Issue
Block a user