Skip to content

Commit

Permalink
Merge pull request #52 from gunnartorfis/refactor/remove-lucide-react…
Browse files Browse the repository at this point in the history
…-native
  • Loading branch information
hyoban authored Sep 9, 2024
2 parents d1a3763 + e5d16e4 commit 0fe5948
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 30 deletions.
1 change: 0 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@react-navigation/native-stack": "^6.9.12",
"expo": "~51.0.32",
"expo-status-bar": "~1.12.1",
"lucide-react-native": "^0.438.0",
"nativewind": "4.1.6",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.7.0",
"lucide-react-native": "^0.438.0",
"nativewind": "^4.1.6",
"prettier": "^3.3.3",
"react": "18.2.0",
Expand All @@ -99,7 +98,6 @@
"@types/react": "^18.2.44"
},
"peerDependencies": {
"lucide-react-native": ">=0",
"nativewind": "*",
"react": "*",
"react-native": "*",
Expand Down
12 changes: 6 additions & 6 deletions src/gestures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ export const ToastSwipeHandler: React.FC<

const pan = Gesture.Pan()
.onBegin(() => {
"worklet";
'worklet';

if (!enabled) {
return;
}
runOnJS(onBegin)();
})
.onChange((event) => {
"worklet";
'worklet';

if (!enabled) {
return;
}
Expand All @@ -65,8 +65,8 @@ export const ToastSwipeHandler: React.FC<
}
})
.onFinalize(() => {
"worklet";
'worklet';

if (!enabled) {
return;
}
Expand Down
88 changes: 88 additions & 0 deletions src/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import Svg, { type SvgProps, Circle, Path } from 'react-native-svg';

interface IconProps extends SvgProps {
size?: number;
}

export const CircleCheck = ({ size, ...props }: IconProps) => (
<Svg
width={size || 24}
height={size || 24}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
{...props}
>
<Circle cx={12} cy={12} r={10} />
<Path d="m9 12 2 2 4-4" />
</Svg>
);

export const CircleX = ({ size, ...props }: IconProps) => (
<Svg
width={size || 24}
height={size || 24}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
{...props}
>
<Circle cx={12} cy={12} r={10} />
<Path d="m15 9-6 6M9 9l6 6" />
</Svg>
);

export const Info = ({ size, ...props }: IconProps) => (
<Svg
width={size || 24}
height={size || 24}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
{...props}
>
<Circle cx={12} cy={12} r={10} />
<Path d="M12 16v-4M12 8h.01" />
</Svg>
);

export const TriangleAlert = ({ size, ...props }: IconProps) => (
<Svg
width={size || 24}
height={size || 24}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
{...props}
>
<Path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4M12 17h.01" />
</Svg>
);

export const X = ({ size, ...props }: IconProps) => (
<Svg
width={size || 24}
height={size || 24}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
{...props}
>
<Path d="M18 6 6 18M6 6l12 12" />
</Svg>
);
8 changes: 1 addition & 7 deletions src/toast.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
CircleCheck,
CircleX,
Info,
TriangleAlert,
X,
} from 'lucide-react-native';
import { CircleCheck, CircleX, Info, TriangleAlert, X } from './icons';
import * as React from 'react';
import { ActivityIndicator, Pressable, Text, View } from 'react-native';
import Animated from 'react-native-reanimated';
Expand Down
14 changes: 0 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13943,17 +13943,6 @@ __metadata:
languageName: node
linkType: hard

"lucide-react-native@npm:^0.438.0":
version: 0.438.0
resolution: "lucide-react-native@npm:0.438.0"
peerDependencies:
react: ^16.5.1 || ^17.0.0 || ^18.0.0
react-native: "*"
react-native-svg: ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0
checksum: f3d7a0c3b0e910ac88df3db10e13bbe7154640d1da53ca06b7a59209b17772b4e972e6f050d0fe8b3b0be30934597f0536edafb2f5719260176c85e5bfcdb096
languageName: node
linkType: hard

"macos-release@npm:^3.1.0":
version: 3.3.0
resolution: "macos-release@npm:3.3.0"
Expand Down Expand Up @@ -19331,7 +19320,6 @@ __metadata:
"@react-navigation/native-stack": ^6.9.12
expo: ~51.0.32
expo-status-bar: ~1.12.1
lucide-react-native: ^0.438.0
nativewind: 4.1.6
react: 18.2.0
react-dom: 18.2.0
Expand Down Expand Up @@ -19364,7 +19352,6 @@ __metadata:
eslint-config-prettier: ^9.0.0
eslint-plugin-prettier: ^5.0.1
jest: ^29.7.0
lucide-react-native: ^0.438.0
nativewind: ^4.1.6
prettier: ^3.3.3
react: 18.2.0
Expand All @@ -19378,7 +19365,6 @@ __metadata:
release-it: ^17.6.0
typescript: ^5.5.4
peerDependencies:
lucide-react-native: ">=0"
nativewind: "*"
react: "*"
react-native: "*"
Expand Down

0 comments on commit 0fe5948

Please sign in to comment.