Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,35 @@ const SIZES = {
NORMAL: 28,
}

type Variant = 'normal' | 'compact'

interface NativeCircularStatusProps extends TouchableOpacityProps {
interface BaseProps extends TouchableOpacityProps {
readonly progress: number
readonly iconPause?: string
readonly iconPlay?: string
readonly paused?: boolean
renderContent?: (progress: number, paused: boolean) => React.ReactNode
readonly variant?: Variant
readonly animated?: boolean
readonly color?: string
readonly placeholderColor?: string
readonly placeholderProps?: ViewProps
readonly progressProps?: Progress.CirclePropTypes
}

interface NormalProps extends BaseProps {
readonly variant: 'normal'
readonly iconPause?: string
readonly iconPlay?: string
renderContent?: (progress: number, paused: boolean) => React.ReactNode
onPause?: () => void
onPlay?: () => void
onStatusChanged?: (paused: boolean) => void
readonly thinking?: boolean
readonly contentProps?: ViewProps
readonly iconProps?: Partial<IconProps>
readonly placeholderProps?: ViewProps
readonly progressProps?: Progress.CirclePropTypes
}

interface CompactProps extends BaseProps {
readonly variant: 'compact'
}

type NativeCircularStatusProps = NormalProps | CompactProps

const NativeCircularStatus = ({
progress,
iconPause = DEFAULTS.ICON_PAUSE,
Expand Down