Compare commits

...

3 Commits

Author SHA1 Message Date
Brandon Presley 2515b0995c Update screenshots 2022-07-08 14:34:39 +12:00
Brandon Presley 218a4e2b88 Remove ellipsis buttons from every Set
The home screen must be as clutter-free
as possible.
2022-07-08 14:34:32 +12:00
Brandon Presley 40447880ca Remove console.log in EditSet 2022-07-08 14:33:47 +12:00
7 changed files with 9 additions and 8 deletions

View File

@ -24,7 +24,6 @@ export default function EditSet({
const db = useContext(DatabaseContext);
useEffect(() => {
console.log('Setting created...');
if (set)
setNewSet({
...set,

View File

@ -1,4 +1,5 @@
import React, {useContext, useState} from 'react';
import {GestureResponderEvent, Text, View} from 'react-native';
import {IconButton, List, Menu} from 'react-native-paper';
import {DatabaseContext} from './App';
import Set from './set';
@ -13,6 +14,7 @@ export default function SetItem({
onRemove: () => void;
}) {
const [showMenu, setShowMenu] = useState(false);
const [anchor, setAnchor] = useState({x: 0, y: 0});
const db = useContext(DatabaseContext);
const remove = async () => {
@ -27,6 +29,11 @@ export default function SetItem({
setShowMenu(false);
};
const longPress = (e: GestureResponderEvent) => {
setAnchor({x: e.nativeEvent.pageX, y: e.nativeEvent.pageY});
setShowMenu(true);
};
return (
<>
<List.Item
@ -35,15 +42,10 @@ export default function SetItem({
}}
title={item.name}
description={`${item.reps} x ${item.weight}${item.unit}`}
onLongPress={() => setShowMenu(true)}
onLongPress={longPress}
right={() => (
<Menu
anchor={
<IconButton
icon="ellipsis-vertical"
onPress={() => setShowMenu(true)}
/>
}
anchor={anchor}
visible={showMenu}
onDismiss={() => setShowMenu(false)}>
<Menu.Item icon="trash" onPress={remove} title="Delete" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 60 KiB