Skip to content

Commit

Permalink
flicker issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vidhi Kataria authored and Vidhi Kataria committed Feb 28, 2022
1 parent eb0575b commit 5725c55
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 112 deletions.
203 changes: 92 additions & 111 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,118 +1,99 @@
const withFonts = require("next-fonts");
const { withNativebase } = require("@native-base/next-adapter");
const path = require("path");
const withMDX = require("@next/mdx")({
extension: /\.mdx?$/,
});
const path = require("path");

// const { withExpo } = require("@expo/next-adapter");
const redirectsJSON = require("./redirects.json");
const withPlugins = require("next-compose-plugins");
const withTM = require("next-transpile-modules")([
"native-base",
"react-native",
"react-native-svg",
"react-native-web",
"react-native-safe-area-context",
"@react-aria/visually-hidden",
"@react-native-aria/button",
"@react-native-aria/checkbox",
"@react-native-aria/combobox",
"@react-native-aria/focus",
"@react-native-aria/interactions",
"@react-native-aria/listbox",
"@react-native-aria/overlays",
"@react-native-aria/radio",
"@react-native-aria/slider",
"@react-native-aria/tabs",
"@react-native-aria/utils",
"@react-stately/combobox",
"@react-stately/radio",
"react-native-vector-icons",
"@native-base/next-adapter",
"@native-base/icons",
// "@expo/vector-icons",
// "react-native-safe-area-context",
// "@react-aria/visually-hidden",
// "@react-native-aria/button",
// "@react-native-aria/checkbox",
// "@react-native-aria/combobox",
// "@react-native-aria/focus",
// "@react-native-aria/interactions",
// "@react-native-aria/listbox",
// "@react-native-aria/overlays",
// "@react-native-aria/radio",
// "@react-native-aria/slider",
// "@react-native-aria/tabs",
// "@react-native-aria/utils",
// "@react-stately/combobox",
// "@react-stately/radio",
]);

module.exports = withPlugins([[withTM], [withFonts], [withMDX]], {
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
// webpack: (config) => {
// config.resolve.alias = {
// ...(config.resolve.alias || {}),
// // Transform all direct `react-native` imports to `react-native-web`
// "react-native$": "react-native-web",
// };
// config.resolve.extensions = [
// ".web.js",
// ".web.ts",
// ".web.tsx",
// ...config.resolve.extensions,
// ];
// return config;
// },
async redirects() {
return [
{
source: "/discord",
destination: "https://discord.com/invite/TSgCw2UPmb",
permanent: true,
},
{
source: "/blogs",
destination: "https://nativebase.io/blogs",
permanent: true,
},
...redirectsJSON,
];
},
images: {
domains: [
"docs.nativebase.io",
"media-exp1.licdn.com",
"mir-s3-cdn-cf.behance.net",
"avatars.githubusercontent.com",
"images.opencollective.com",
"pbs.twimg.com",
],
},
env: {
environment: process.env.ENVIRONMENT,
},
webpack: (config) => {
config.module.rules.push({
test: /\.ttf$/,
loader: "url-loader", // or directly file-loader
include: path.resolve(__dirname, "node_modules/@native-base/icons"),
});
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
"react-native$": "react-native-web",
"@native-base/icons": "react-native-vector-icons",
};
config.resolve.extensions = [
".web.js",
".web.ts",
".web.tsx",
...config.resolve.extensions,
];
return config;
},
i18n: {
locales: ["en"],
defaultLocale: "en",
module.exports = withNativebase({
dependencies: ["@native-base/icons"],
plugins: [[withMDX]],
nextConfig: {
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
// webpack: (config) => {
// config.resolve.alias = {
// ...(config.resolve.alias || {}),
// // Transform all direct `react-native` imports to `react-native-web`
// "react-native$": "react-native-web",
// };
// config.resolve.extensions = [
// ".web.js",
// ".web.ts",
// ".web.tsx",
// ...config.resolve.extensions,
// ];
// return config;
// },
async redirects() {
return [
{
source: "/discord",
destination: "https://discord.com/invite/TSgCw2UPmb",
permanent: true,
},
{
source: "/blogs",
destination: "https://nativebase.io/blogs",
permanent: true,
},
...redirectsJSON,
];
},
images: {
domains: [
"docs.nativebase.io",
"media-exp1.licdn.com",
"mir-s3-cdn-cf.behance.net",
"avatars.githubusercontent.com",
"images.opencollective.com",
"pbs.twimg.com",
],
},
env: {
environment: process.env.ENVIRONMENT,
},
webpack: (config) => {
config.module.rules.push({
test: /\.ttf$/,
loader: "url-loader", // or directly file-loader
include: path.resolve(__dirname, "node_modules/@native-base/icons"),
});
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
"react-native$": "react-native-web",
// "@native-base/icons": "react-native-vector-icons",
};
config.resolve.extensions = [
".web.js",
".web.ts",
".web.tsx",
...config.resolve.extensions,
];
return config;
},
i18n: {
locales: ["en"],
defaultLocale: "en",
},
// webpack: (config, options) => {
// config.module.rules.push({
// test: /\.ttf$/,
// loader: "url-loader", // or directly file-loader
// include: path.resolve(__dirname, "node_modules/@native-base/icons"),
// });
// config.resolve.alias = {
// ...(config.resolve.alias || {}),
// "react-native$": "react-native-web",
// };
// config.resolve.extensions = [
// ".web.js",
// ".web.ts",
// ".web.tsx",
// ...config.resolve.extensions,
// ];
// return config;
// },
},
});
2 changes: 1 addition & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
position: relative;
background-color: #0f172a;
/* background-color: #0f172a; */
}
#nativebase-body-light ::-moz-selection {
/* Code for Firefox */
Expand Down

1 comment on commit 5725c55

@vercel
Copy link

@vercel vercel bot commented on 5725c55 Feb 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.