Skip to content

Commit

Permalink
yes
Browse files Browse the repository at this point in the history
  • Loading branch information
YourUsername committed Jun 30, 2024
1 parent 1277a08 commit 147d6cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
11 changes: 2 additions & 9 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function App() {

return (
<>
<Toaster />
<Toaster containerClassName="mt-12 md:mt-0" />
<DeleteModal {...deleteModal} />

<Navbar onDeleteAll={onDeleteAll} onCleanUp={onCleanUp} mode={mode} setMode={setMode} />
Expand All @@ -111,15 +111,8 @@ export function App() {

{(mode == "gallery" || mode == "generation") && (
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 px-4 md:px-8">
<GenerationScreen
onTouched={() => setMode("generation")}
disabled={generating}
generationForm={generationForm}
onApply={onGenerate}
className={generationStyle}
/>
<GenerationScreen disabled={generating} generationForm={generationForm} onApply={onGenerate} className={generationStyle} />
<ResultsScreen
onTouched={() => setMode("gallery")}
selected={selected}
setSelected={setSelected}
onCopy={onCopy}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/GenerationScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const StyleHelper = () => (
</>
)

export const GenerationScreen = ({ onTouched, disabled, generationForm, onApply, className = "" }) => {
export const GenerationScreen = ({ disabled, generationForm, onApply, className = "" }) => {
const { values, errors, validate, setValues, register } = generationForm

const isDalle3 = values.model == "dall-e-3"
Expand All @@ -35,7 +35,7 @@ export const GenerationScreen = ({ onTouched, disabled, generationForm, onApply,
}, [isDalle3])

return (
<Screen onTouched={onTouched} className={`pt-16 pb-4 ${className}`}>
<Screen className={`pt-16 pb-4 ${className}`}>
{/* Prompt */}
<Label className={!!errors.prompt ? "text-cancel" : ""}>Prompt</Label>
<Textarea
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Results/ResultsScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EmptyScreen = ({ className = "" }) => (
</Screen>
)

export const ResultsScreen = ({ onTouched, selected, setSelected, generations, onDelete, onCopy, className = "" }) => {
export const ResultsScreen = ({ selected, setSelected, generations, onDelete, onCopy, className = "" }) => {
// useEffect(() => {
// if (selected == generations.length - 1) setSelected((value) => value - 1)
// }, [generations])
Expand All @@ -20,7 +20,7 @@ export const ResultsScreen = ({ onTouched, selected, setSelected, generations, o
<>
{generations.length == 0 && <EmptyScreen className={className} />}
{generations.length > 0 && (
<Screen onTouched={onTouched} className={`pt-16 ${className}`}>
<Screen className={`pt-16 ${className}`}>
<>
<GenerationGrid generation={generations[selected]} />
<GenerationInfo onCopy={onCopy} onDelete={onDelete} generation={generations[selected]} />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Screen.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { VStack } from "@/components/VStack"

export const Screen = ({ onTouched=null, children = null, className = "" }) => {
return <VStack onClick={onTouched} className={`relative min-h-screen ${className}`}>{children}</VStack>
export const Screen = ({ children = null, className = "" }) => {
return <VStack className={`relative min-h-screen ${className}`}>{children}</VStack>
}

0 comments on commit 147d6cc

Please sign in to comment.