Skip to content

Commit

Permalink
Improve right card layout on small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-bauer committed Jul 18, 2024
1 parent 6d5bbaa commit db2ec09
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,30 +204,33 @@ export default function Home() {

{/* Right side */}
<div className='w-1/2 divide-y divide-gray-200 overflow-hidden rounded-md bg-white/70 shadow'>
<div className='flex flex-wrap items-center justify-between px-4 py-4'>
<div className='flex flex-wrap items-center justify-between gap-4 p-4'>
{/* Card header */}
<PrimaryButton tabIndex={20} type='submit' form='contributor-form'>
<PrimaryButton
tabIndex={20}
type='submit'
className='order-1'
form='contributor-form'
>
<PlayIcon className='-ml-0.5 h-5 w-5' />
Generate Text
</PrimaryButton>

<div>
<select
id='generator-style'
name='generator style'
tabIndex={21}
onChange={(e) => setSelectedStyle(e.target.value)}
className='block w-full rounded-md border-0 py-1.5 pl-3 pr-10 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 sm:text-sm sm:leading-6'
>
{Object.entries(availableStyles).map(([key, _]) => (
<option key={key}>{key}</option>
))}
</select>
</div>
<select
id='generator-style'
name='generator style'
tabIndex={21}
onChange={(e) => setSelectedStyle(e.target.value)}
className='order-3 w-full rounded-md border-0 py-1.5 text-gray-dark ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 lg:order-2 lg:w-44 lg:grow'
>
{Object.entries(availableStyles).map(([key, _]) => (
<option key={key}>{key}</option>
))}
</select>

<SecondaryButton
type='submit'
className='w-24'
className='order-2 sm:w-24 lg:order-3'
tabIndex={22}
onClick={onCopyHandler}
>
Expand All @@ -237,7 +240,9 @@ export default function Home() {
<ClipboardIcon
className={`-ml-0.5 h-5 w-5 ${showSuccessCopy ? 'hidden' : ''}`}
/>
{showSuccessCopy ? 'Copied!' : 'Copy'}
<span className='hidden sm:flex'>
{showSuccessCopy ? 'Copied!' : 'Copy'}
</span>
</SecondaryButton>
</div>
<div className='px-4 py-5'>
Expand Down

0 comments on commit db2ec09

Please sign in to comment.