Skip to content

Commit

Permalink
use base tamagui spinner for now
Browse files Browse the repository at this point in the history
  • Loading branch information
latter-bolden committed Apr 5, 2024
1 parent 4659a66 commit fefee41
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/ChannelSearch/SearchStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function SearchStatus({
<>
{!searchComplete && (
<View marginRight="$s">
<LoadingSpinner height={14} />
<LoadingSpinner />
</View>
)}
{numResults > 0 && (
Expand Down
16 changes: 15 additions & 1 deletion packages/ui/src/components/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ import {
useColorScheme,
} from 'react-native';
import { useTailwind } from 'tailwind-rn';
import { ColorTokens } from 'tamagui';

import { Spinner } from '../core';

type Props = {
height?: number;
durationMs?: number;
};

export const LoadingSpinner = ({ height = 24, durationMs = 1000 }: Props) => {
export function LoadingSpinner({
size,
color,
}: {
size?: 'large' | 'small';
color?: ColorTokens;
}) {
return <Spinner size={size} color={color ?? '$color.gray700'} />;
}

// Do not use this, here for reference only
const LegacySpinner = ({ height = 24, durationMs = 1000 }: Props) => {
const rotationDegree = useRef(new Animated.Value(0)).current;
const tailwind = useTailwind();
const isDarkMode = useColorScheme() === 'dark';
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/core/tamagui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export {
ScrollView,
YGroup,
SizableText,
Spinner,
TextArea,
Text,
} from 'tamagui';
Expand Down

0 comments on commit fefee41

Please sign in to comment.