Merge branch 'develop' into noah/cosmos-kit

This commit is contained in:
Serkan Reis
2023-10-15 20:46:20 +03:00
committed by GitHub
16 changed files with 159 additions and 26 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ export function FaviconsMetaTags() {
<link href="/assets/manifest.webmanifest" rel="manifest" />
<meta content="yes" name="mobile-web-app-capable" />
<meta content="#F0827D" name="theme-color" />
<meta content="StargazeStudio" name="application-name" />
<meta content="Stargaze Studio" name="application-name" />
<link href="/assets/apple-touch-icon-57x57.png" rel="apple-touch-icon" sizes="57x57" />
<link href="/assets/apple-touch-icon-60x60.png" rel="apple-touch-icon" sizes="60x60" />
<link href="/assets/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72" />
@@ -22,7 +22,7 @@ export function FaviconsMetaTags() {
<link href="/assets/apple-touch-icon-1024x1024.png" rel="apple-touch-icon" sizes="1024x1024" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black-translucent" name="apple-mobile-web-app-status-bar-style" />
<meta content="StargazeStudio" name="apple-mobile-web-app-title" />
<meta content="Stargaze Studio" name="apple-mobile-web-app-title" />
<link
href="/assets/apple-touch-startup-image-640x1136.png"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
+2 -2
View File
@@ -47,9 +47,9 @@ export const Layout = ({ children, metadata = {} }: LayoutProps) => {
<FaDesktop size={48} />
<h1 className="text-2xl font-bold">Unsupported Viewport</h1>
<p>
StargazeStudio is best viewed on the big screen.
Stargaze Studio is best viewed on the big screen.
<br />
Please open StargazeStudio on your tablet or desktop browser.
Please open Stargaze Studio on your tablet or desktop browser.
</p>
</div>
</div>
+10 -1
View File
@@ -181,7 +181,9 @@ export const CollectionActions = ({
type !== 'update_royalties_for_infinity_swap'
? 'Percentage of royalties to be paid'
: 'Change in share percentage',
placeholder: '5%',
placeholder: isEitherType(type, ['set_royalties_for_infinity_swap', 'update_royalties_for_infinity_swap'])
? '0.5%'
: '5%',
})
const showTokenUriField = isEitherType(type, ['mint_token_uri', 'update_token_metadata'])
@@ -310,6 +312,13 @@ export const CollectionActions = ({
royaltyShareState.value,
])
useEffect(() => {
if (isEitherType(type, ['set_royalties_for_infinity_swap']) && Number(royaltyShareState.value) > 5) {
royaltyShareState.onChange('5')
toast.error('Royalty share cannot be greater than 5% for Infinity Swap')
}
}, [royaltyShareState.value])
useEffect(() => {
const addresses: string[] = []
airdropAllocationArray.forEach((allocation) => {
@@ -119,7 +119,7 @@ export const UploadDetails = ({
if (event.target.files === null) return
const thumbnailCompatibleAssetTypes: AssetType[] = ['video', 'audio', 'html']
const thumbnailCompatibleFileNamesList: string[] = []
if (minterType === 'vending' || (minterType === 'base' && event.target.files.length > 1)) {
if (minterType === 'vending') {
//sort the files
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
//check if the sorted file names are in numerical order
@@ -146,6 +146,38 @@ export const UploadDetails = ({
return
}
}
} else if (minterType === 'base' && event.target.files.length > 1) {
//sort the files
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
//check if the sorted file names are in numerical order
const sortedFileNames = sortedFiles.map((file) => file.name.split('.')[0])
sortedFiles.map((file) => {
if (thumbnailCompatibleAssetTypes.includes(getAssetType(file.name))) {
thumbnailCompatibleFileNamesList.push(file.name.split('.')[0])
}
})
setThumbnailCompatibleAssetFileNames(thumbnailCompatibleFileNamesList)
console.log('Thumbnail Compatible Files: ', thumbnailCompatibleFileNamesList)
for (let i = 0; i < sortedFileNames.length - 1; i++) {
if (
isNaN(Number(sortedFileNames[i])) ||
isNaN(Number(sortedFileNames[i + 1])) ||
parseInt(sortedFileNames[i]) !== parseInt(sortedFileNames[i + 1]) - 1
) {
toast.error('The file names should be in numerical order.')
setThumbnailCompatibleAssetFileNames([])
addLogItem({
id: uid(),
message: 'The file names should be in numerical order.',
type: 'Error',
timestamp: new Date(),
})
//clear the input
event.target.value = ''
return
}
}
} else if (minterType === 'base' && event.target.files.length === 1) {
if (thumbnailCompatibleAssetTypes.includes(getAssetType(event.target.files[0].name))) {
thumbnailCompatibleFileNamesList.push(event.target.files[0].name.split('.')[0])
@@ -186,7 +218,23 @@ export const UploadDetails = ({
event.target.value = ''
return toast.error('The number of metadata files should be equal to the number of asset files.')
}
if (minterType === 'vending' || (minterType === 'base' && assetFilesArray.length > 1)) {
// compare the first file name for asset and metadata files
if (
minterType === 'base' &&
assetFilesArray.length > 1 &&
event.target.files[0].name.split('.')[0] !== assetFilesArray[0].name.split('.')[0]
) {
event.target.value = ''
toast.error('The metadata file names should match the asset file names.')
addLogItem({
id: uid(),
message: 'The metadata file names should match the asset file names.',
type: 'Error',
timestamp: new Date(),
})
return
}
if (minterType === 'vending') {
//sort the files
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
//check if the sorted file names are in numerical order
@@ -204,6 +252,28 @@ export const UploadDetails = ({
return
}
}
} else if (minterType === 'base' && assetFilesArray.length > 1) {
//sort the files
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
//check if the sorted file names are in numerical order
const sortedFileNames = sortedFiles.map((file) => file.name.split('.')[0])
for (let i = 0; i < sortedFileNames.length - 1; i++) {
if (
isNaN(Number(sortedFileNames[i])) ||
isNaN(Number(sortedFileNames[i + 1])) ||
parseInt(sortedFileNames[i]) !== parseInt(sortedFileNames[i + 1]) - 1
) {
toast.error('The file names should be in numerical order.')
addLogItem({
id: uid(),
message: 'The file names should be in numerical order.',
type: 'Error',
timestamp: new Date(),
})
event.target.value = ''
return
}
}
}
let loadedFileCount = 0
const files: File[] = []
+1 -1
View File
@@ -226,7 +226,7 @@ export const CollectionDetails = ({
<FormControl
className={clsx('mt-2')}
htmlId="timestamp"
subtitle="Trading start time offset will be set as 2 weeks by default."
subtitle="Trading start time offset will be set as 1 week by default."
title={`Trading Start Time (optional | ${timezone === 'Local' ? 'local)' : 'UTC)'}`}
>
<InputDateTime
@@ -711,7 +711,7 @@ export const OpenEditionMinterCreator = ({
return (
<div>
{/* TODO: Cancel once we're able to index on-chain metadata */}
<Conditional test>
<Conditional test={false}>
<div className="mx-10 mb-4 rounded border-2 border-white/20">
<div className="flex justify-center mb-2">
<div className="mt-3 ml-4 font-bold form-check form-check-inline">