Skip to content

Commit

Permalink
Tidy up imports. Bump @bytescale/upload-widget-react.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwagerfield committed Sep 20, 2023
1 parent 59ff101 commit 2f21ac6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
14 changes: 7 additions & 7 deletions app/dream/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import { AnimatePresence, motion } from "framer-motion";
import Image from "next/image";
import { useState } from "react";
import { UrlBuilder } from "@bytescale/sdk";
import { UploadWidgetConfig } from "@bytescale/upload-widget";
import { UploadDropzone } from "@bytescale/upload-widget-react";
import { CompareSlider } from "../../components/CompareSlider";
import Footer from "../../components/Footer";
Expand All @@ -14,8 +16,6 @@ import appendNewToName from "../../utils/appendNewToName";
import downloadPhoto from "../../utils/downloadPhoto";
import DropDown from "../../components/DropDown";
import { roomType, rooms, themeType, themes } from "../../utils/dropdownTypes";
import {UploadWidgetConfig} from "@bytescale/upload-widget";
import {UrlBuilder} from "@bytescale/sdk";

const options: UploadWidgetConfig = {
apiKey: !!process.env.NEXT_PUBLIC_UPLOAD_API_KEY
Expand Down Expand Up @@ -55,12 +55,12 @@ export default function DreamPage() {
const UploadDropZone = () => (
<UploadDropzone
options={options}
onUpdate={(files) => {
if (files.length !== 0) {
const image = files[0];
const imageName = image.originalFile.originalFileName
onUpdate={({ uploadedFiles }) => {
if (uploadedFiles.length !== 0) {
const image = uploadedFiles[0];
const imageName = image.originalFile.originalFileName;
const imageUrl = UrlBuilder.url({
accountId: image.originalFile.accountId,
accountId: image.accountId,
filePath: image.filePath,
options: {
transformation: "preset",
Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "next start"
},
"dependencies": {
"@bytescale/upload-widget-react": "^4.1.0",
"@bytescale/upload-widget-react": "^4.9.0",
"@headlessui/react": "^1.7.7",
"@headlessui/tailwindcss": "^0.1.2",
"@heroicons/react": "^2.0.16",
Expand Down

0 comments on commit 2f21ac6

Please sign in to comment.