Adopt Tamagui defaults for tabs and filters
This commit is contained in:
@@ -235,9 +235,7 @@ function EventsList({
|
||||
onEdit?: (slug: string) => void;
|
||||
}) {
|
||||
const { t } = useTranslation('management');
|
||||
const { text, muted, subtle, border, primary, surface, surfaceMuted, accentSoft, accent, shadow } = useAdminTheme();
|
||||
const activeBg = accentSoft;
|
||||
const activeBorder = accent;
|
||||
const { text, muted, subtle, border, primary, surface, surfaceMuted, shadow } = useAdminTheme();
|
||||
|
||||
const statusCounts = React.useMemo(() => buildEventStatusCounts(events), [events]);
|
||||
const filteredByStatus = React.useMemo(
|
||||
@@ -313,56 +311,49 @@ function EventsList({
|
||||
</Text>
|
||||
</XStack>
|
||||
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
||||
<XStack
|
||||
<ToggleGroup
|
||||
type="single"
|
||||
value={statusFilter}
|
||||
onValueChange={(value: string) => value && onStatusChange(value as EventStatusKey)}
|
||||
disableDeactivation
|
||||
orientation="horizontal"
|
||||
flexDirection="row"
|
||||
alignItems="center"
|
||||
padding="$1"
|
||||
borderRadius={999}
|
||||
gap="$1.5"
|
||||
borderRadius="$pill"
|
||||
borderWidth={1}
|
||||
borderColor={border}
|
||||
backgroundColor={surfaceMuted}
|
||||
>
|
||||
<ToggleGroup
|
||||
type="single"
|
||||
value={statusFilter}
|
||||
onValueChange={(value: string) => value && onStatusChange(value as EventStatusKey)}
|
||||
>
|
||||
<XStack gap="$1.5">
|
||||
{filters.map((filter) => {
|
||||
const active = filter.key === statusFilter;
|
||||
return (
|
||||
<ToggleGroup.Item
|
||||
key={filter.key}
|
||||
value={filter.key}
|
||||
borderRadius={999}
|
||||
borderWidth={1}
|
||||
borderColor={active ? activeBorder : 'transparent'}
|
||||
backgroundColor={active ? activeBg : 'transparent'}
|
||||
paddingVertical="$1.5"
|
||||
paddingHorizontal="$3"
|
||||
>
|
||||
<XStack alignItems="center" gap="$1.5">
|
||||
<Text fontSize="$xs" fontWeight="700" color={active ? primary : muted}>
|
||||
{filter.label}
|
||||
</Text>
|
||||
<XStack
|
||||
paddingHorizontal="$1.5"
|
||||
paddingVertical="$0.5"
|
||||
borderRadius={999}
|
||||
borderWidth={1}
|
||||
borderColor={active ? activeBorder : border}
|
||||
backgroundColor={surface}
|
||||
>
|
||||
<Text fontSize={10} fontWeight="800" color={active ? primary : muted}>
|
||||
{filter.count}
|
||||
</Text>
|
||||
</XStack>
|
||||
</XStack>
|
||||
</ToggleGroup.Item>
|
||||
);
|
||||
})}
|
||||
</XStack>
|
||||
</ToggleGroup>
|
||||
</XStack>
|
||||
{filters.map((filter) => (
|
||||
<ToggleGroup.Item
|
||||
key={filter.key}
|
||||
value={filter.key}
|
||||
borderRadius="$pill"
|
||||
paddingVertical="$1.5"
|
||||
paddingHorizontal="$3"
|
||||
>
|
||||
<XStack alignItems="center" gap="$1.5">
|
||||
<Text fontSize="$xs" fontWeight="600">
|
||||
{filter.label}
|
||||
</Text>
|
||||
<XStack
|
||||
paddingHorizontal="$1.5"
|
||||
paddingVertical="$0.5"
|
||||
borderRadius="$pill"
|
||||
borderWidth={1}
|
||||
borderColor={border}
|
||||
backgroundColor="$backgroundStrong"
|
||||
>
|
||||
<Text fontSize={10} fontWeight="700">
|
||||
{filter.count}
|
||||
</Text>
|
||||
</XStack>
|
||||
</XStack>
|
||||
</ToggleGroup.Item>
|
||||
))}
|
||||
</ToggleGroup>
|
||||
</ScrollView>
|
||||
</YStack>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user