Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Drop zone alignment #21

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 25 additions & 22 deletions app/components/open-to/files/upload/index.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import FileDropzone from 'ember-file-upload/components/file-dropzone';
import fileQueue from 'ember-file-upload/helpers/file-queue';
import { t } from 'ember-intl';
import Avatar from '../../../avatar';
import Instructions from './instructions';
import { action } from '@ember/object';
import { on } from '@ember/modifier';
import { Button } from '@frontile/buttons';
Expand All @@ -19,36 +18,40 @@ export default class OpenToFilesUpload extends Component {
{{#let (fileQueue onFileAdded=this.uploadPhoto) as |queue|}}
<FileDropzone @queue={{queue}} class='' as |dropzone|>

{{#if dropzone.active}}
<Instructions>
<span
class='text-xl font-black shadow-md text-white bg-gradient-to-r from-indigo-500 from-10% via-sky-500 via-30% to-emerald-500 to-90% px-6 py-2 rounded-lg'
>
{{t 'drag-and-drop.drop-now'}}
</span>
</Instructions>
{{else}}
<div class='relative w-full aspect-square'>
<div class='absolute top-0 left-0 w-full aspect-square'>
<Avatar
class='border-dashed border-4 border-slate-400'
@file='/images/unicorn.webp'
/>
</div>
<div class='relative w-full aspect-square'>
<div class='absolute top-0 left-0 w-full aspect-square'>
<Avatar
class='border-dashed border-4
{{if dropzone.active "border-emerald-500" "border-slate-400"}}'
@file='/images/unicorn.webp'
/>
</div>

<Instructions>
<Button @intent='primary' {{on 'click' this.toggleFileSelector}}>
<div
class='relative top-0 left-0 w-full aspect-square text-center flex justify-center items-center'
>
<Button
@intent='primary'
{{on 'click' this.toggleFileSelector}}
class='{{if
dropzone.active
"bg-gradient-to-r from-indigo-500 from-10% via-sky-500 via-30% to-emerald-500 to-90%"
}}'
>
{{#if dropzone.active}}
{{t 'drag-and-drop.drop-now'}}
{{else}}
{{t 'drag-and-drop.instructions'}}
<input
id='file-input'
type='file'
{{queue.selectFile}}
class='hidden'
/>
</Button>
</Instructions>
{{/if}}
</Button>
</div>
{{/if}}
</div>
</FileDropzone>
{{/let}}
</template>
Expand Down
11 changes: 0 additions & 11 deletions app/components/open-to/files/upload/instructions.gjs

This file was deleted.

Loading