Skip to content

Commit

Permalink
Drop indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Feb 28, 2025
1 parent bf10bb8 commit 7d8381a
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function AccountListItem({

return (
<ListBoxItem textValue={account.id} {...props}>
{({ isDragging, isDropTarget }) => (
{({ isDropTarget }) => (
<Button
onPress={() => onSelect(account.id)}
style={{
Expand All @@ -145,7 +145,6 @@ function AccountListItem({
borderRadius: 6,
boxShadow: `0 1px 1px ${theme.mobileAccountShadow}`,
marginTop: 10,
...(isDragging ? { backgroundColor: 'red' } : {}),
...(isDropTarget ? { backgroundColor: 'blue' } : {}),
}}
data-testid="account-list-item"
Expand Down Expand Up @@ -340,6 +339,18 @@ function AccountList({
[...keys].map(key => ({
'text/plain': accountListData.getItem(key).id,
})),
renderDropIndicator() {
return (
<View
style={{
width: '100%',
height: 2,
backgroundColor: 'red',
opacity: 0.5,
}}
/>
);
},
onReorder(e) {
const [key] = e.keys;
const accountIdToMove = key as AccountEntity['id'];
Expand Down

0 comments on commit 7d8381a

Please sign in to comment.