Skip to content

Commit 452ccd1

Browse files
committed
move to @rneui
1 parent 38ad609 commit 452ccd1

9 files changed

+8052
-7965
lines changed

config-overrides.js

+37-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
1-
const path = require('path');
2-
const { override, addBabelPlugins, babelInclude } = require('customize-cra');
1+
const path = require("path");
2+
const {
3+
override,
4+
addBabelPlugins,
5+
babelInclude,
6+
addWebpackAlias,
7+
addBabelPresets,
8+
} = require("customize-cra");
39

410
module.exports = override(
5-
...addBabelPlugins('@babel/plugin-proposal-class-properties'),
6-
babelInclude([
7-
path.resolve(__dirname, 'node_modules/react-native-elements'),
8-
path.resolve(__dirname, 'node_modules/react-native-vector-icons'),
9-
path.resolve(__dirname, 'node_modules/react-native-ratings'),
10-
path.resolve(__dirname, 'src'),
11-
])
11+
...addBabelPlugins([
12+
"@babel/plugin-proposal-class-properties",
13+
{
14+
loose: true,
15+
},
16+
]),
17+
...addBabelPresets([
18+
"@babel/preset-env",
19+
{
20+
loose: true,
21+
targets: {
22+
browsers: ["> 1%", "last 2 versions"],
23+
},
24+
modules: "commonjs",
25+
},
26+
]),
27+
babelInclude(
28+
[
29+
path.resolve(__dirname, "node_modules/@rneui/base"),
30+
path.resolve(__dirname, "node_modules/@rneui/themed"),
31+
path.resolve(__dirname, "node_modules/react-native-vector-icons"),
32+
path.resolve(__dirname, "node_modules/react-native-ratings"),
33+
path.resolve(__dirname, "src"),
34+
],
35+
addWebpackAlias({
36+
"react-native$": "react-native-web",
37+
"react-native-linear-gradient": "react-native-web-linear-gradient",
38+
})
39+
)
1240
);

package.json

+13-8
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@react-native-community/toolbar-android": "^0.1.0-rc.2",
7-
"react": "^16.13.0",
8-
"react-dom": "^16.13.0",
9-
"react-native-elements": "^2.0.4",
10-
"react-native-vector-icons": "^6.7.0",
11-
"react-native-web": "^0.12.0",
12-
"react-scripts": "3.4.1"
6+
"@rneui/base": "^4.0.0-rc.4",
7+
"@rneui/themed": "^4.0.0-rc.4",
8+
"@types/react": "^18.0.14",
9+
"@types/react-dom": "^18.0.5",
10+
"react": "^18.2.0",
11+
"react-dom": "^18.2.0",
12+
"react-native": "^0.69.0",
13+
"react-native-safe-area-context": "^4.3.1",
14+
"react-native-vector-icons": "^9.2.0",
15+
"react-native-web": "^0.18.1",
16+
"typescript": "^4.7.4",
17+
"react-scripts": "^5.0.1"
1318
},
1419
"scripts": {
1520
"start": "react-app-rewired start",
@@ -35,6 +40,6 @@
3540
"devDependencies": {
3641
"@babel/plugin-proposal-class-properties": "^7.10.4",
3742
"customize-cra": "^1.0.0",
38-
"react-app-rewired": "^2.1.6"
43+
"react-app-rewired": "^2.2.1"
3944
}
4045
}

src/App.js

-30
This file was deleted.

src/App.tsx

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from "react";
2+
import "./App.css";
3+
import { Button, createTheme, ThemeProvider } from "@rneui/themed";
4+
5+
const theme = createTheme({});
6+
7+
function App() {
8+
return (
9+
<>
10+
<style type="text/css">{`
11+
@font-face {
12+
font-family: 'MaterialIcons';
13+
src: url(${require("react-native-vector-icons/Fonts/MaterialIcons.ttf")}) format('truetype');
14+
}
15+
16+
@font-face {
17+
font-family: 'FontAwesome';
18+
src: url(${require("react-native-vector-icons/Fonts/FontAwesome.ttf")}) format('truetype');
19+
}
20+
`}</style>
21+
22+
<ThemeProvider theme={theme}>
23+
<div className="App">
24+
<header className="App-header">
25+
<Button title="I'm a button from React Native Elements" />
26+
</header>
27+
</div>
28+
</ThemeProvider>
29+
</>
30+
);
31+
}
32+
33+
export default App;

src/index.js

-12
This file was deleted.

src/index.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import { createRoot } from "react-dom/client";
4+
import "./index.css";
5+
import App from "./App";
6+
7+
const root = createRoot(document.getElementById("root")!);
8+
9+
root.render(<App />);
10+
11+
// If you want your app to work offline and load faster, you can change
12+
// unregister() to register() below. Note this comes with some pitfalls.
13+
// Learn more about service workers: https://bit.ly/CRA-PWA

src/serviceWorker.js

-135
This file was deleted.

0 commit comments

Comments
 (0)