Skip to content

Commit

Permalink
chore: renames CardNumber element to CardNumberElement
Browse files Browse the repository at this point in the history
  • Loading branch information
brigonzalez committed Jul 24, 2023
1 parent 4966c27 commit 9497f47
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
View,
} from 'react-native';
import type { BTRef } from './src';
import { BasisTheoryElements, CardNumber } from './src';
import { BasisTheoryElements, CardNumberElement } from './src';

const App = (): JSX.Element => {
const ref = useRef<BTRef>(null);
Expand All @@ -17,7 +17,7 @@ const App = (): JSX.Element => {
<StatusBar />
<ScrollView contentInsetAdjustmentBehavior="automatic">
<View style={styles.viewContainer}>
<CardNumber
<CardNumberElement
btRef={ref}
placeholder="Card Number"
style={styles.cardNumber}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type UseCardNumberParams = {
inputBtRef?: BTRefBase;
};

export const useCardNumber = ({ btRef, inputBtRef }: UseCardNumberParams) => {
export const useCardNumberElement = ({ btRef, inputBtRef }: UseCardNumberParams) => {
const textInputRef = useRef<TextInput>(null);
const [id] = useState(uuid.v4() as string);
const [mask, setMask] = useState<Mask>(defaultCardNumberMask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ForwardedRef } from 'react';
import React from 'react';
import type { StyleProp, TextStyle } from 'react-native';
import type { BTRef, BTRefBase } from '../BaseElementTypes';
import { useCardNumber } from './CardNumber.hooks';
import { useCardNumberElement } from './CardNumberElement.hooks';
import MaskInput from 'react-native-mask-input';
import { _elementValues } from '../ElementValues';

Expand All @@ -14,15 +14,15 @@ type CardNumberProps = {
placeholder?: string;
};

export const CardNumber = ({
export const CardNumberElement = ({
btRef,
style,
editable,
placeholder,
inputBtRef,
}: CardNumberProps) => {
const { textInputRef, id, setTextInputValue, textInputValue, mask } =
useCardNumber({
useCardNumberElement({
btRef,
inputBtRef,
});
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CardNumber } from './components/CardNumber';
import { CardNumberElement } from './components/CardNumberElement';
import { BasisTheoryElements } from './BasisTheoryElements';
import type { BTRef } from './BaseElementTypes';

export type { BTRef };
export { CardNumber, BasisTheoryElements };
export { CardNumberElement, BasisTheoryElements };

0 comments on commit 9497f47

Please sign in to comment.