Skip to content

Commit

Permalink
Merge pull request #29580 from kubabutkiewicz/ts-migration/LinearGrad…
Browse files Browse the repository at this point in the history
…ient/component

[No QA] [TS migration] Migrate 'LinearGradient' component to TypeScript
  • Loading branch information
aldo-expensify authored Nov 6, 2023
2 parents 7601f89 + 45f910c commit 4089595
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/components/LinearGradient/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/components/LinearGradient/index.native.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/components/LinearGradient/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import LinearGradientNative from 'react-native-linear-gradient';
import LinearGradient from './types';

const LinearGradientImplementation: LinearGradient = LinearGradientNative;

export default LinearGradientImplementation;
6 changes: 6 additions & 0 deletions src/components/LinearGradient/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import LinearGradientWeb from 'react-native-web-linear-gradient';
import LinearGradient from './types';

const LinearGradientImplementation: LinearGradient = LinearGradientWeb;

export default LinearGradientImplementation;
5 changes: 5 additions & 0 deletions src/components/LinearGradient/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import LinearGradientNative from 'react-native-linear-gradient';

type LinearGradient = typeof LinearGradientNative;

export default LinearGradient;
6 changes: 6 additions & 0 deletions src/types/modules/react-native-web-linear-gradient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */
declare module 'react-native-web-linear-gradient' {
import LinearGradient from 'react-native-linear-gradient';

export default LinearGradient;
}

0 comments on commit 4089595

Please sign in to comment.