Skip to content

Commit

Permalink
fix(ui): Visual Bugs When Dragging Items Into Empty Tiers (#139)
Browse files Browse the repository at this point in the history
* Refactor CSS

* Remove unnecessary CSS

* Fix min heights

* Add back min-h-20

---------

Co-authored-by: Isaac Yong <dev@infinia.space>
  • Loading branch information
HecticKiwi and infinia-yzl authored Dec 30, 2024
1 parent 1330036 commit 5a71357
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/DragDropTierList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const TierItems = memo<{
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={`w-full flex flex-wrap p-0 rounded-md ${snapshot.isDraggingOver ? 'ring-1 ring-accent-foreground' : ''}`}
className={`w-full min-h-17 md:min-h-21 flex flex-wrap p-0 rounded-md ${snapshot.isDraggingOver ? 'ring-1 ring-accent-foreground' : ''}`}
>
{tier.items.map((item, itemIndex) => (
<Draggable key={item.id} draggableId={item.id} index={itemIndex}>
Expand All @@ -49,7 +49,7 @@ const TierItems = memo<{
{...provided.draggableProps}
{...provided.dragHandleProps}
className={`
m-0.5 rounded-md
m-0.5 rounded-md
${snapshot.isDragging ? 'shadow-md ring-2' : ''}
`}
style={{
Expand Down Expand Up @@ -116,7 +116,7 @@ const TierRow = memo<{
<div
className={`flex ${labelPosition === 'left' ? 'flex-row' : labelPosition === 'right' ? 'flex-row-reverse' : 'flex-col'} items-center`}>
{(labelPosition === 'left' || labelPosition === 'right') && (
<div className="w-18 md:w-40">
<div className="md:w-40">
<EditableLabel
text={tier.name}
onSave={(newText) => onSaveLabel(index, newText)}
Expand Down
2 changes: 1 addition & 1 deletion components/ItemTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ItemTile: React.FC<ItemTileProps> = memo(({
const handleDelete = useCallback(() => onDelete(id), [id, onDelete]);

const tileContent = (
<div className="relative w-16 h-16 sm:w-18 sm:h-18 md:w-20 md:h-20 overflow-hidden rounded-md">
<div className="relative w-16 h-16 md:w-20 md:h-20 overflow-hidden rounded-md">
{imageUrl ? (
<>
<div className="absolute inset-0 overflow-hidden">
Expand Down
4 changes: 4 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const config = {
},
},
extend: {
spacing: {
"17": "4.25rem",
"21": "5.25rem",
},
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
heading: ["var(--font-heading)", ...fontFamily.sans],
Expand Down

0 comments on commit 5a71357

Please sign in to comment.