Skip to content

Commit

Permalink
Draw: improve layout
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros authored and jimjonesbabyfreshout committed Feb 19, 2024
1 parent 8a31ea8 commit d7385e2
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions src/apps/draw/TextToImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ProdiaSettings } from '~/modules/t2i/prodia/ProdiaSettings';
import type { TextToImageProvider } from '~/common/components/useCapabilities';

import { ProviderSelect } from './components/ProviderSelect';
import { AppPlaceholder } from '../AppPlaceholder';


export function TextToImage(props: {
Expand Down Expand Up @@ -38,28 +39,37 @@ export function TextToImage(props: {
}, [setShowProviderSettings]);


return <Box sx={{ display: 'flex', flexDirection: 'column' }}>
return <>

<Box sx={{ flex: 0, display: 'flex', flexDirection: 'column' }}>

{/* Service / Options Button */}
<Box sx={{ display: 'flex', flexDirection: 'row', gap: 1 }}>
<ProviderSelect {...props} />
<Button
variant={settingsShown ? 'solid' : 'outlined'}
color={settingsShown ? 'primary' : 'neutral'}
endDecorator={<ConstructionIcon />}
onClick={handleToggleProviderSettings}
sx={{ backgroundColor: settingsShown ? undefined : 'background.surface' }}
>
Options
</Button>
</Box>

{/* Options */}
{settingsShown && (
<Card variant='outlined' sx={{ my: 1, borderTopColor: 'primary.softActiveBg' }}>
<CardContent sx={{ gap: 2 }}>
<ProviderConfig />
</CardContent>
</Card>
)}

{/* Service */}
<Box sx={{ display: 'flex', flexDirection: 'row', gap: 2 }}>
<ProviderSelect {...props} />
<Button
variant={settingsShown ? 'solid' : 'outlined'}
endDecorator={<ConstructionIcon />}
onClick={handleToggleProviderSettings}
>
Options
</Button>
</Box>

{/* Service Settings */}
{settingsShown && (
<Card variant='outlined' sx={{ my: 1, borderTopColor: 'primary.softActiveBg' }}>
<CardContent sx={{ gap: 2 }}>
<ProviderConfig />
</CardContent>
</Card>
)}
{/* Main */}
<AppPlaceholder />

</Box>;
</>;
}

0 comments on commit d7385e2

Please sign in to comment.