Skip to content

Commit

Permalink
Added ActivityIndicator
Browse files Browse the repository at this point in the history
  • Loading branch information
procivisAG committed Oct 8, 2024
1 parent 6d03b5b commit 39aaacd
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@procivis/one-react-native-components",
"version": "0.1.57",
"version": "0.1.58",
"author": "Procivis AG (https://procivis.ch)",
"license": "Apache-2.0",
"description": "Common Procivis ONE UI components for react-native",
Expand Down
21 changes: 21 additions & 0 deletions src/activity-indicator/activity-indicator.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import React from 'react';

import ActivityIndicator from './activity-indicator';

const Basic: ComponentStory<typeof ActivityIndicator> = (args) => <ActivityIndicator {...args} />;

Basic.args = {};

export { Basic as ActivityIndicator };

export default {
title: 'base/activity/Activity Indicator',
component: ActivityIndicator,
parameters: {
design: {
type: 'figma',
url: 'https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=444-45709&node-type=symbol&t=OQxawbbArhzkDVkZ-0',
},
},
} as ComponentMeta<typeof ActivityIndicator>;
25 changes: 25 additions & 0 deletions src/activity-indicator/activity-indicator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { FC } from 'react';
import { StyleSheet, View } from 'react-native';
import { ViewProps } from 'react-native-svg/lib/typescript/fabric/utils';

import LoaderView, { LoaderViewState } from '../loader/loader';

type ActivityIndicatorProps = ViewProps & {
animate?: boolean;
};

const ActivityIndicator: FC<ActivityIndicatorProps> = ({ animate = true, style, ...props }) => {
return (
<View {...props} style={[styles.wrapper, style]}>
<LoaderView animate={animate} state={LoaderViewState.InProgress} />
</View>
);
};

const styles = StyleSheet.create({
wrapper: {
alignItems: 'center',
},
});

export default ActivityIndicator;
3 changes: 3 additions & 0 deletions src/activity-indicator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ActivityIndicator from './activity-indicator';

export { ActivityIndicator };
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './accessibility';
export * from './action-modal';
export * from './activity-indicator';
export * from './blur';
export * from './buttons';
export * from './camera';
Expand Down

0 comments on commit 39aaacd

Please sign in to comment.