Compare commits
2 Commits
luggage-li
...
luggage-li
| Author | SHA1 | Date | |
|---|---|---|---|
| 063e5090ed | |||
| 354a13e9a9 |
@@ -14,7 +14,7 @@ import TripsTab from './tabs/TripsTab';
|
|||||||
import ItemsTab from './tabs/ItemsTab';
|
import ItemsTab from './tabs/ItemsTab';
|
||||||
import CheckupTab from './tabs/CheckupTab';
|
import CheckupTab from './tabs/CheckupTab';
|
||||||
import HistoryTab from './tabs/HistoryTab';
|
import HistoryTab from './tabs/HistoryTab';
|
||||||
import { emptyData, STORAGE_KEY } from './constants';
|
import { emptyData, ITEM_PLACEMENTS, STORAGE_KEY } from './constants';
|
||||||
import { findBestTripId, makeId, parseYMD, todayYMD } from './utils/date';
|
import { findBestTripId, makeId, parseYMD, todayYMD } from './utils/date';
|
||||||
import { styles } from './styles';
|
import { styles } from './styles';
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ const emptyItemForm = () => ({
|
|||||||
category: '',
|
category: '',
|
||||||
status: 'unpacked',
|
status: 'unpacked',
|
||||||
placement: 'suitcase',
|
placement: 'suitcase',
|
||||||
|
placementCustom: '',
|
||||||
lentTo: '',
|
lentTo: '',
|
||||||
imageUri: '',
|
imageUri: '',
|
||||||
imageQuality: 'balanced',
|
imageQuality: 'balanced',
|
||||||
@@ -43,6 +44,7 @@ const emptyItemForm = () => ({
|
|||||||
const emptyCheckupNoForm = () => ({
|
const emptyCheckupNoForm = () => ({
|
||||||
status: 'unpacked',
|
status: 'unpacked',
|
||||||
placement: 'suitcase',
|
placement: 'suitcase',
|
||||||
|
placementCustom: '',
|
||||||
lentTo: '',
|
lentTo: '',
|
||||||
updateMasterList: false,
|
updateMasterList: false,
|
||||||
});
|
});
|
||||||
@@ -430,13 +432,17 @@ export default function AppRoot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openEditItemModal(item) {
|
function openEditItemModal(item) {
|
||||||
|
const existingPlacement = item.placement || 'suitcase';
|
||||||
|
const hasPresetPlacement = ITEM_PLACEMENTS.includes(existingPlacement);
|
||||||
|
|
||||||
setItemForm({
|
setItemForm({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.name || '',
|
name: item.name || '',
|
||||||
description: item.description || '',
|
description: item.description || '',
|
||||||
category: item.category || '',
|
category: item.category || '',
|
||||||
status: item.status || 'unpacked',
|
status: item.status || 'unpacked',
|
||||||
placement: item.placement || 'suitcase',
|
placement: hasPresetPlacement ? existingPlacement : 'other',
|
||||||
|
placementCustom: hasPresetPlacement || existingPlacement === 'other' ? '' : existingPlacement,
|
||||||
lentTo: item.lentTo || '',
|
lentTo: item.lentTo || '',
|
||||||
imageUri: item.imageUri || '',
|
imageUri: item.imageUri || '',
|
||||||
imageQuality: item.imageQuality || 'balanced',
|
imageQuality: item.imageQuality || 'balanced',
|
||||||
@@ -456,6 +462,12 @@ export default function AppRoot() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resolvedPlacement = itemForm.placement === 'other' ? itemForm.placementCustom.trim() : itemForm.placement;
|
||||||
|
if (!resolvedPlacement) {
|
||||||
|
showAlert('Missing location', 'Please enter a custom location for "other".');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
setData((prev) => {
|
setData((prev) => {
|
||||||
@@ -467,7 +479,7 @@ export default function AppRoot() {
|
|||||||
description: itemForm.description.trim(),
|
description: itemForm.description.trim(),
|
||||||
category: itemForm.category.trim(),
|
category: itemForm.category.trim(),
|
||||||
status: itemForm.status,
|
status: itemForm.status,
|
||||||
placement: itemForm.placement,
|
placement: resolvedPlacement,
|
||||||
lentTo: itemForm.status === 'lent-to' ? itemForm.lentTo.trim() : '',
|
lentTo: itemForm.status === 'lent-to' ? itemForm.lentTo.trim() : '',
|
||||||
imageUri: itemForm.imageUri,
|
imageUri: itemForm.imageUri,
|
||||||
imageQuality: itemForm.imageQuality,
|
imageQuality: itemForm.imageQuality,
|
||||||
@@ -650,9 +662,14 @@ export default function AppRoot() {
|
|||||||
function openCurrentCheckupNo() {
|
function openCurrentCheckupNo() {
|
||||||
const entry = checkupCurrentEntry;
|
const entry = checkupCurrentEntry;
|
||||||
if (!entry) return;
|
if (!entry) return;
|
||||||
|
|
||||||
|
const existingPlacement = entry.current.placement || 'suitcase';
|
||||||
|
const hasPresetPlacement = ITEM_PLACEMENTS.includes(existingPlacement);
|
||||||
|
|
||||||
setCheckupNoForm({
|
setCheckupNoForm({
|
||||||
status: entry.current.status || 'unpacked',
|
status: entry.current.status || 'unpacked',
|
||||||
placement: entry.current.placement || 'suitcase',
|
placement: hasPresetPlacement ? existingPlacement : 'other',
|
||||||
|
placementCustom: hasPresetPlacement || existingPlacement === 'other' ? '' : existingPlacement,
|
||||||
lentTo: entry.current.lentTo || '',
|
lentTo: entry.current.lentTo || '',
|
||||||
updateMasterList: false,
|
updateMasterList: false,
|
||||||
});
|
});
|
||||||
@@ -663,9 +680,15 @@ export default function AppRoot() {
|
|||||||
const entry = checkupCurrentEntry;
|
const entry = checkupCurrentEntry;
|
||||||
if (!entry) return;
|
if (!entry) return;
|
||||||
|
|
||||||
|
const resolvedPlacement = checkupNoForm.placement === 'other' ? checkupNoForm.placementCustom.trim() : checkupNoForm.placement;
|
||||||
|
if (!resolvedPlacement) {
|
||||||
|
showAlert('Missing location', 'Please enter a custom location for "other".');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const patch = {
|
const patch = {
|
||||||
status: checkupNoForm.status,
|
status: checkupNoForm.status,
|
||||||
placement: checkupNoForm.placement,
|
placement: resolvedPlacement,
|
||||||
lentTo: checkupNoForm.status === 'lent-to' ? checkupNoForm.lentTo.trim() : '',
|
lentTo: checkupNoForm.status === 'lent-to' ? checkupNoForm.lentTo.trim() : '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ export default function ItemCard({ item, onEdit, onDelete, onQuickPack, onQuickU
|
|||||||
<View style={styles.itemMain}>
|
<View style={styles.itemMain}>
|
||||||
<View style={styles.cardRow}>
|
<View style={styles.cardRow}>
|
||||||
<View style={styles.flex}>
|
<View style={styles.flex}>
|
||||||
<Text style={styles.itemTitle}>{item.name}</Text>
|
<Text style={styles.itemTitle} numberOfLines={1}>{item.name}</Text>
|
||||||
<Text style={styles.itemMeta}>{item.category || 'uncategorized'} · {formatStatusLabel(item.status, item.lentTo)}</Text>
|
<Text style={styles.itemMeta} numberOfLines={1}>{item.category || 'uncategorized'} · {formatStatusLabel(item.status, item.lentTo)}</Text>
|
||||||
<Text style={styles.itemMeta}>Location: {item.placement}</Text>
|
<Text style={styles.itemMeta}>Location: {item.placement}</Text>
|
||||||
{item.status === 'lent-to' && !!item.lentTo ? <Text style={styles.itemMeta}>Borrower: {item.lentTo}</Text> : null}
|
{item.status === 'lent-to' && !!item.lentTo ? <Text style={styles.itemMeta} numberOfLines={1}>Borrower: {item.lentTo}</Text> : null}
|
||||||
{!!item.description ? <Text style={styles.itemMeta}>{item.description}</Text> : null}
|
{!!item.description ? <Text style={styles.itemMeta} numberOfLines={2}>{item.description}</Text> : null}
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.stackButtons}>
|
<View style={styles.stackButtons}>
|
||||||
<Pressable style={styles.miniBtn} onPress={() => onEdit(item)}>
|
<Pressable style={styles.miniBtn} onPress={() => onEdit(item)}>
|
||||||
@@ -49,10 +49,10 @@ export default function ItemCard({ item, onEdit, onDelete, onQuickPack, onQuickU
|
|||||||
|
|
||||||
<View style={styles.quickStatusRow}>
|
<View style={styles.quickStatusRow}>
|
||||||
<Pressable style={[styles.quickStatusBtn, isPacked && styles.quickStatusBtnActive]} onPress={onQuickPack}>
|
<Pressable style={[styles.quickStatusBtn, isPacked && styles.quickStatusBtnActive]} onPress={onQuickPack}>
|
||||||
<Text style={[styles.quickStatusBtnText, isPacked && styles.quickStatusBtnTextActive]}>Pack</Text>
|
<Text style={[styles.quickStatusBtnText, isPacked && styles.quickStatusBtnTextActive]}>Packed</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<Pressable style={[styles.quickStatusBtn, isUnpacked && styles.quickStatusBtnActive]} onPress={onQuickUnpack}>
|
<Pressable style={[styles.quickStatusBtn, isUnpacked && styles.quickStatusBtnActive]} onPress={onQuickUnpack}>
|
||||||
<Text style={[styles.quickStatusBtnText, isUnpacked && styles.quickStatusBtnTextActive]}>Unpack</Text>
|
<Text style={[styles.quickStatusBtnText, isUnpacked && styles.quickStatusBtnTextActive]}>Unpacked</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -103,6 +103,18 @@ export default function CheckupFlowModal({
|
|||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
|
{noForm.placement === 'other' ? (
|
||||||
|
<Field label="Custom location">
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
value={noForm.placementCustom}
|
||||||
|
onChangeText={(v) => setNoForm((prev) => ({ ...prev, placementCustom: v }))}
|
||||||
|
placeholder="bath-kit"
|
||||||
|
placeholderTextColor="#6b7280"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
) : null}
|
||||||
|
|
||||||
{noForm.status === 'lent-to' ? (
|
{noForm.status === 'lent-to' ? (
|
||||||
<Field label="Lent to">
|
<Field label="Lent to">
|
||||||
<TextInput
|
<TextInput
|
||||||
|
|||||||
@@ -81,6 +81,18 @@ export default function ItemModal({
|
|||||||
<ChipGroup options={ITEM_PLACEMENTS} value={itemForm.placement} onChange={(v) => updateItemForm('placement', v)} />
|
<ChipGroup options={ITEM_PLACEMENTS} value={itemForm.placement} onChange={(v) => updateItemForm('placement', v)} />
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
|
{itemForm.placement === 'other' ? (
|
||||||
|
<Field label="Custom location">
|
||||||
|
<TextInput
|
||||||
|
style={styles.input}
|
||||||
|
value={itemForm.placementCustom}
|
||||||
|
onChangeText={(v) => updateItemForm('placementCustom', v)}
|
||||||
|
placeholder="bath-kit"
|
||||||
|
placeholderTextColor="#6b7280"
|
||||||
|
/>
|
||||||
|
</Field>
|
||||||
|
) : null}
|
||||||
|
|
||||||
{itemForm.status === 'lent-to' ? (
|
{itemForm.status === 'lent-to' ? (
|
||||||
<Field label="Lent to">
|
<Field label="Lent to">
|
||||||
<TextInput
|
<TextInput
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ export const styles = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 14,
|
||||||
paddingTop: 12,
|
paddingTop: 10,
|
||||||
paddingBottom: TAB_BAR_HEIGHT + 22,
|
paddingBottom: TAB_BAR_HEIGHT + 20,
|
||||||
gap: 14,
|
gap: 10,
|
||||||
},
|
},
|
||||||
statusSpacer: {
|
statusSpacer: {
|
||||||
height: Platform.OS === 'android' ? 8 : 0,
|
height: Platform.OS === 'android' ? 8 : 0,
|
||||||
@@ -86,7 +86,7 @@ export const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
section: {
|
section: {
|
||||||
gap: 12,
|
gap: 10,
|
||||||
},
|
},
|
||||||
sectionTitle: {
|
sectionTitle: {
|
||||||
color: '#f1f5f9',
|
color: '#f1f5f9',
|
||||||
@@ -105,8 +105,8 @@ export const styles = StyleSheet.create({
|
|||||||
borderRadius: 16,
|
borderRadius: 16,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: '#1f2937',
|
borderColor: '#1f2937',
|
||||||
padding: 12,
|
padding: 10,
|
||||||
gap: 8,
|
gap: 6,
|
||||||
},
|
},
|
||||||
cardActive: {
|
cardActive: {
|
||||||
borderColor: '#60a5fa',
|
borderColor: '#60a5fa',
|
||||||
@@ -120,12 +120,12 @@ export const styles = StyleSheet.create({
|
|||||||
borderRadius: 16,
|
borderRadius: 16,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: '#1e293b',
|
borderColor: '#1e293b',
|
||||||
padding: 12,
|
padding: 10,
|
||||||
gap: 10,
|
gap: 8,
|
||||||
},
|
},
|
||||||
cardRow: {
|
cardRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: 10,
|
gap: 8,
|
||||||
},
|
},
|
||||||
cardTitle: {
|
cardTitle: {
|
||||||
color: '#f8fafc',
|
color: '#f8fafc',
|
||||||
@@ -134,8 +134,8 @@ export const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
cardMeta: {
|
cardMeta: {
|
||||||
color: '#94a3b8',
|
color: '#94a3b8',
|
||||||
marginTop: 3,
|
marginTop: 2,
|
||||||
fontSize: 13,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
tripHistoryLabel: {
|
tripHistoryLabel: {
|
||||||
color: '#93c5fd',
|
color: '#93c5fd',
|
||||||
@@ -148,8 +148,8 @@ export const styles = StyleSheet.create({
|
|||||||
borderRadius: 18,
|
borderRadius: 18,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: '#334155',
|
borderColor: '#334155',
|
||||||
padding: 12,
|
padding: 10,
|
||||||
gap: 8,
|
gap: 6,
|
||||||
},
|
},
|
||||||
tripHeroImage: {
|
tripHeroImage: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@@ -160,7 +160,7 @@ export const styles = StyleSheet.create({
|
|||||||
tripHeroTitle: {
|
tripHeroTitle: {
|
||||||
color: '#f8fafc',
|
color: '#f8fafc',
|
||||||
fontWeight: '800',
|
fontWeight: '800',
|
||||||
fontSize: 22,
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
tripListTitle: {
|
tripListTitle: {
|
||||||
color: '#cbd5e1',
|
color: '#cbd5e1',
|
||||||
@@ -290,19 +290,19 @@ export const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
stackButtons: {
|
stackButtons: {
|
||||||
gap: 7,
|
gap: 6,
|
||||||
},
|
},
|
||||||
miniBtn: {
|
miniBtn: {
|
||||||
backgroundColor: '#1e293b',
|
backgroundColor: '#1e293b',
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
paddingVertical: 7,
|
paddingVertical: 6,
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 9,
|
||||||
},
|
},
|
||||||
miniBtnDanger: {
|
miniBtnDanger: {
|
||||||
backgroundColor: '#3b1d22',
|
backgroundColor: '#3b1d22',
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
paddingVertical: 7,
|
paddingVertical: 6,
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 9,
|
||||||
},
|
},
|
||||||
miniBtnText: {
|
miniBtnText: {
|
||||||
color: '#e2e8f0',
|
color: '#e2e8f0',
|
||||||
@@ -324,18 +324,18 @@ export const styles = StyleSheet.create({
|
|||||||
alignSelf: 'stretch',
|
alignSelf: 'stretch',
|
||||||
},
|
},
|
||||||
itemThumbWrap: {
|
itemThumbWrap: {
|
||||||
paddingTop: 10,
|
paddingTop: 8,
|
||||||
paddingLeft: 10,
|
paddingLeft: 8,
|
||||||
},
|
},
|
||||||
itemThumbSmall: {
|
itemThumbSmall: {
|
||||||
width: 46,
|
width: 42,
|
||||||
height: 46,
|
height: 42,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
backgroundColor: '#0b1220',
|
backgroundColor: '#0b1220',
|
||||||
},
|
},
|
||||||
itemThumbPlaceholder: {
|
itemThumbPlaceholder: {
|
||||||
width: 46,
|
width: 42,
|
||||||
height: 46,
|
height: 42,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
backgroundColor: '#0b1220',
|
backgroundColor: '#0b1220',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@@ -344,12 +344,12 @@ export const styles = StyleSheet.create({
|
|||||||
borderColor: '#243244',
|
borderColor: '#243244',
|
||||||
},
|
},
|
||||||
itemThumbPlaceholderText: {
|
itemThumbPlaceholderText: {
|
||||||
fontSize: 18,
|
fontSize: 16,
|
||||||
},
|
},
|
||||||
itemMain: {
|
itemMain: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
padding: 10,
|
padding: 8,
|
||||||
gap: 8,
|
gap: 6,
|
||||||
},
|
},
|
||||||
itemTitle: {
|
itemTitle: {
|
||||||
color: '#f8fafc',
|
color: '#f8fafc',
|
||||||
@@ -358,17 +358,17 @@ export const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
itemMeta: {
|
itemMeta: {
|
||||||
color: '#94a3b8',
|
color: '#94a3b8',
|
||||||
marginTop: 2,
|
marginTop: 1,
|
||||||
fontSize: 13,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
quickStatusRow: {
|
quickStatusRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: 8,
|
gap: 6,
|
||||||
marginTop: 2,
|
marginTop: 1,
|
||||||
},
|
},
|
||||||
quickStatusBtn: {
|
quickStatusBtn: {
|
||||||
paddingVertical: 6,
|
paddingVertical: 5,
|
||||||
paddingHorizontal: 12,
|
paddingHorizontal: 10,
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: '#334155',
|
borderColor: '#334155',
|
||||||
@@ -381,7 +381,7 @@ export const styles = StyleSheet.create({
|
|||||||
quickStatusBtnText: {
|
quickStatusBtnText: {
|
||||||
color: '#cbd5e1',
|
color: '#cbd5e1',
|
||||||
fontWeight: '700',
|
fontWeight: '700',
|
||||||
fontSize: 12,
|
fontSize: 11,
|
||||||
},
|
},
|
||||||
quickStatusBtnTextActive: {
|
quickStatusBtnTextActive: {
|
||||||
color: '#dbeafe',
|
color: '#dbeafe',
|
||||||
@@ -576,8 +576,8 @@ export const styles = StyleSheet.create({
|
|||||||
tabItem: {
|
tabItem: {
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
gap: 4,
|
gap: 3,
|
||||||
minWidth: 58,
|
minWidth: 56,
|
||||||
},
|
},
|
||||||
tabAddBtn: {
|
tabAddBtn: {
|
||||||
width: 54,
|
width: 54,
|
||||||
@@ -595,7 +595,7 @@ export const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
tabLabel: {
|
tabLabel: {
|
||||||
color: '#94a3b8',
|
color: '#94a3b8',
|
||||||
fontSize: 12,
|
fontSize: 11,
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
},
|
},
|
||||||
tabLabelActive: {
|
tabLabelActive: {
|
||||||
@@ -673,8 +673,8 @@ export const styles = StyleSheet.create({
|
|||||||
borderRadius: 20,
|
borderRadius: 20,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: '#1e293b',
|
borderColor: '#1e293b',
|
||||||
padding: 16,
|
padding: 14,
|
||||||
gap: 10,
|
gap: 8,
|
||||||
},
|
},
|
||||||
closeText: {
|
closeText: {
|
||||||
color: '#93c5fd',
|
color: '#93c5fd',
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default function TripsTab({
|
|||||||
<View style={styles.flex}>
|
<View style={styles.flex}>
|
||||||
<Text style={styles.cardTitle}>{trip.name}</Text>
|
<Text style={styles.cardTitle}>{trip.name}</Text>
|
||||||
<Text style={styles.cardMeta}>{trip.location || 'No location'} · {trip.startDate} → {trip.endDate}</Text>
|
<Text style={styles.cardMeta}>{trip.location || 'No location'} · {trip.startDate} → {trip.endDate}</Text>
|
||||||
<Text style={styles.cardMeta}>{defaultTemplateTripId === trip.id ? 'Default template' : ' '}</Text>
|
{defaultTemplateTripId === trip.id ? <Text style={styles.cardMeta}>Default template</Text> : null}
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.stackButtons}>
|
<View style={styles.stackButtons}>
|
||||||
<Pressable style={styles.miniBtn} onPress={() => openView(trip.id)}>
|
<Pressable style={styles.miniBtn} onPress={() => openView(trip.id)}>
|
||||||
|
|||||||
Reference in New Issue
Block a user