Skip to content

Commit

Permalink
Small bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
viral-sangani committed Apr 16, 2024
1 parent 88b9e5c commit 4e91174
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/components/common/SecretImageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function SecretImageView({
<span>500 x 500 px max</span>
</li>
<li className="text-gray-500 ml-5">
<span>Mas 1MB</span>
<span>Max 1MB</span>
</li>
<li className="text-gray-500 ml-5">
<span>Square shapes are recommended</span>
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/components/create/ImageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ImageView({ handleImageUpload, imageSrc, setView }: Props) {
<span>500 x 500 px max</span>
</li>
<li className="text-gray-500 ml-5">
<span>Mas 1MB</span>
<span>Max 1MB</span>
</li>
<li className="text-gray-500 ml-5">
<span>Square shapes are recommended</span>
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/pages/collections/[address].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Collections: React.FC<Props> = ({ address: userAddress, collection }) => {
<div className="flex flex-col justify-center items-center md:pt-20 pt-4 max-w-xl mx-auto w-full">
<div className="flex flex-col justify-start w-full">
{collection.length > 0 ? (
<span className="px-5 text-lg font-bold">2023</span>
<span className="px-5 text-lg font-bold">All Collection</span>
) : (
<NoToast />
)}
Expand All @@ -73,6 +73,7 @@ const Collections: React.FC<Props> = ({ address: userAddress, collection }) => {

export async function getServerSideProps({ params }: { params: any }) {
const res = await getUserCollection(params.address as string);
console.log("🚀 ~ getServerSideProps ~ res:", res);
if (!res) {
return {
redirect: {
Expand Down
26 changes: 18 additions & 8 deletions packages/frontend/pages/create/secret.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ export default function New() {

const handleImageUpload = (e: any) => {
const file = e.target.files[0];
setImage(file);
if (file) {
const reader = new FileReader();
reader.onload = () => {
setImageSrc(reader.result);
};
reader.readAsDataURL(file);
var fileSize = e.target.files[0].size / 1024;
if (fileSize > 1025) {
toast.error("🚨 Please make sure file size should not be more than 1MB.");
} else {
setImage(file);
if (file) {
const reader = new FileReader();
reader.onload = () => {
setImageSrc(reader.result);
};
reader.readAsDataURL(file);
}
}
};

Expand Down Expand Up @@ -108,7 +113,7 @@ export default function New() {

const signer = await connector?.getWalletClient();
const signature = await signer?.signMessage({
message: JSON.stringify(reqObj)
message: JSON.stringify(reqObj),
});

var firebaseRes = await axios({
Expand Down Expand Up @@ -138,6 +143,11 @@ export default function New() {
const handleSecretCheck = async () => {
setSecretCheckLoading(true);
try {
if (!imageSrc) {
toast.error("🚨 Please upload an image first.");
setSecretCheckLoading(false);
return;
}
const response = await axios({
method: "post",
url: getApiEndpoint().checkSecretEndpoint,
Expand Down

0 comments on commit 4e91174

Please sign in to comment.