Fix sticky task search bar
This commit is contained in:
@@ -750,56 +750,58 @@ export default function MobileEventTasksPage() {
|
||||
</YStack>
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
borderRadius={20}
|
||||
borderWidth={2}
|
||||
borderColor={stickyBorder}
|
||||
backgroundColor={stickySurface}
|
||||
padding="$3"
|
||||
shadowColor={stickyShadow}
|
||||
shadowOpacity={0.16}
|
||||
shadowRadius={16}
|
||||
shadowOffset={{ width: 0, height: 10 }}
|
||||
style={{
|
||||
position: 'sticky',
|
||||
top: 'calc(env(safe-area-inset-top, 0px) + 76px)',
|
||||
zIndex: 45,
|
||||
}}
|
||||
<YStack
|
||||
position="sticky"
|
||||
zIndex={45}
|
||||
width="100%"
|
||||
style={{ top: 'calc(env(safe-area-inset-top, 0px) + 76px)' }}
|
||||
>
|
||||
<XStack alignItems="center" space="$2">
|
||||
<XStack flex={1}>
|
||||
<MobileInput
|
||||
type="search"
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
placeholder={t('events.tasks.search', 'Search photo tasks')}
|
||||
compact
|
||||
/>
|
||||
</XStack>
|
||||
<Pressable onPress={() => setShowEmotionFilterSheet(true)}>
|
||||
<XStack
|
||||
alignItems="center"
|
||||
space="$1.5"
|
||||
paddingVertical="$2"
|
||||
paddingHorizontal="$3"
|
||||
borderRadius={14}
|
||||
borderWidth={1}
|
||||
borderColor={border}
|
||||
backgroundColor={surface}
|
||||
>
|
||||
<Text fontSize={11} fontWeight="700" color={text}>
|
||||
{t('events.tasks.emotionFilterShort', 'Emotion')}
|
||||
</Text>
|
||||
<Text fontSize={11} color={muted}>
|
||||
{emotionFilter
|
||||
? emotions.find((e) => String(e.id) === emotionFilter)?.name ?? t('events.tasks.customEmotion', 'Custom emotion')
|
||||
: t('events.tasks.allEmotions', 'All')}
|
||||
</Text>
|
||||
<ChevronDown size={14} color={muted} />
|
||||
<Card
|
||||
borderRadius={20}
|
||||
borderWidth={2}
|
||||
borderColor={stickyBorder}
|
||||
backgroundColor={stickySurface}
|
||||
padding="$3"
|
||||
shadowColor={stickyShadow}
|
||||
shadowOpacity={0.16}
|
||||
shadowRadius={16}
|
||||
shadowOffset={{ width: 0, height: 10 }}
|
||||
>
|
||||
<XStack alignItems="center" space="$2">
|
||||
<XStack flex={1}>
|
||||
<MobileInput
|
||||
type="search"
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
placeholder={t('events.tasks.search', 'Search photo tasks')}
|
||||
compact
|
||||
/>
|
||||
</XStack>
|
||||
</Pressable>
|
||||
</XStack>
|
||||
</Card>
|
||||
<Pressable onPress={() => setShowEmotionFilterSheet(true)}>
|
||||
<XStack
|
||||
alignItems="center"
|
||||
space="$1.5"
|
||||
paddingVertical="$2"
|
||||
paddingHorizontal="$3"
|
||||
borderRadius={14}
|
||||
borderWidth={1}
|
||||
borderColor={border}
|
||||
backgroundColor={surface}
|
||||
>
|
||||
<Text fontSize={11} fontWeight="700" color={text}>
|
||||
{t('events.tasks.emotionFilterShort', 'Emotion')}
|
||||
</Text>
|
||||
<Text fontSize={11} color={muted}>
|
||||
{emotionFilter
|
||||
? emotions.find((e) => String(e.id) === emotionFilter)?.name ?? t('events.tasks.customEmotion', 'Custom emotion')
|
||||
: t('events.tasks.allEmotions', 'All')}
|
||||
</Text>
|
||||
<ChevronDown size={14} color={muted} />
|
||||
</XStack>
|
||||
</Pressable>
|
||||
</XStack>
|
||||
</Card>
|
||||
</YStack>
|
||||
</YStack>
|
||||
) : null}
|
||||
|
||||
|
||||
@@ -270,6 +270,8 @@ describe('MobileEventTasksPage', () => {
|
||||
expect(await screen.findByText('Photo tasks for this event')).toBeInTheDocument();
|
||||
expect(screen.getByText('Quick jump')).toBeInTheDocument();
|
||||
expect(screen.getByText('assigned')).toBeInTheDocument();
|
||||
expect(screen.getByPlaceholderText('Search photo tasks')).toBeInTheDocument();
|
||||
expect(screen.getByText('Emotion')).toBeInTheDocument();
|
||||
|
||||
expect(api.getTaskCollections).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ event_type: 'wedding' }),
|
||||
|
||||
Reference in New Issue
Block a user