Skip to content

Commit 0e544e4

Browse files
authored
Add SWM icon pack support. (#3114)
## Description This PR replaces expo `Entypo` icons with [SWM icons](https://github.com/software-mansion-labs/swm-icon-pack-react) ## Test plan open the example app and see chevrons next to every button
1 parent fbfe9a7 commit 0e544e4

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

example/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
StackScreenProps,
1515
} from '@react-navigation/stack';
1616
import { NavigationContainer, ParamListBase } from '@react-navigation/native';
17-
import Entypo from '@expo/vector-icons/Entypo';
1817
import {
1918
GestureHandlerRootView,
2019
RectButton,
@@ -77,6 +76,8 @@ import EmptyExample from './src/empty/EmptyExample';
7776
import RectButtonBorders from './src/release_tests/rectButton';
7877
import { ListWithHeader } from './src/ListWithHeader';
7978

79+
import { Icon } from '@swmansion/icons';
80+
8081
interface Example {
8182
name: string;
8283
component: React.ComponentType;
@@ -326,7 +327,7 @@ function MainScreenItem({ name, onPressItem }: MainScreenItemProps) {
326327
return (
327328
<RectButton style={[styles.button]} onPress={() => onPressItem(name)}>
328329
<Text>{name}</Text>
329-
<Entypo name="chevron-right" size={24} color="#bbb" />
330+
<Icon name="chevron-small-right" size={24} color="#bbb" />
330331
</RectButton>
331332
);
332333
}

example/app.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@
2626
},
2727
"web": {
2828
"favicon": "./assets/favicon.png"
29-
}
29+
},
30+
"plugins": [
31+
[
32+
"expo-font",
33+
{
34+
"fonts": [
35+
"./node_modules/@swmansion/icons/fonts/broken/swm-icons-broken.ttf",
36+
"./node_modules/@swmansion/icons/fonts/outline/swm-icons-outline.ttf",
37+
"./node_modules/@swmansion/icons/fonts/curved/swm-icons-curved.ttf"
38+
]
39+
}
40+
]
41+
]
3042
}
3143
}

example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"@react-navigation/elements": "^1.3.7",
2424
"@react-navigation/native": "^6.1.17",
2525
"@react-navigation/stack": "^6.3.29",
26+
"@swmansion/icons": "^0.0.1",
2627
"expo": "^51.0.0",
28+
"expo-font": "~12.0.10",
2729
"hoist-non-react-statics": "^3.3.2",
2830
"invariant": "^2.2.4",
2931
"patch-package": "^6.5.1",

example/yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,11 @@
20242024
dependencies:
20252025
"@sinonjs/commons" "^3.0.0"
20262026

2027+
"@swmansion/icons@^0.0.1":
2028+
version "0.0.1"
2029+
resolved "https://registry.yarnpkg.com/@swmansion/icons/-/icons-0.0.1.tgz#8171b857be9885e1565138bf358b073f6585ca43"
2030+
integrity sha512-MjqBDtxzMRa++iPT0RkBPPOV+wIGvzVMGKQTw9thk8GKt+UAhT9NKkfK4BhiKKvKnKkCHfYCvdidNlN+jpHLrQ==
2031+
20272032
"@tsconfig/react-native@^3.0.5":
20282033
version "3.0.5"
20292034
resolved "https://registry.yarnpkg.com/@tsconfig/react-native/-/react-native-3.0.5.tgz#c4971b1eca2e8cdf7b0d25f40193a782039c1abd"
@@ -4039,6 +4044,13 @@ expo-file-system@~17.0.1:
40394044
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-17.0.1.tgz#b9f8af8c1c06ec71d96fd7a0d2567fa9e1c88f15"
40404045
integrity sha512-dYpnZJqTGj6HCYJyXAgpFkQWsiCH3HY1ek2cFZVHFoEc5tLz9gmdEgTF6nFHurvmvfmXqxi7a5CXyVm0aFYJBw==
40414046

4047+
expo-font@~12.0.10:
4048+
version "12.0.10"
4049+
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-12.0.10.tgz#62deaf1f46159d7839f01305f44079268781b1db"
4050+
integrity sha512-Q1i2NuYri3jy32zdnBaHHCya1wH1yMAsI+3CCmj9zlQzlhsS9Bdwcj2W3c5eU5FvH2hsNQy4O+O1NnM6o/pDaQ==
4051+
dependencies:
4052+
fontfaceobserver "^2.1.0"
4053+
40424054
expo-font@~12.0.4:
40434055
version "12.0.4"
40444056
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-12.0.4.tgz#c3d9b7fc152286c1e2beae80f97b94ca4622db34"

0 commit comments

Comments
 (0)