Skip to content

Commit

Permalink
make example more clear + better for big screens
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLindhout committed Jun 23, 2023
1 parent 396489f commit c54b046
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 281 deletions.
5 changes: 5 additions & 0 deletions docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ const config = {
position: 'left',
label: 'Docs',
},
{
href: 'https://www.reactnativepaperdates.com',
label: 'Example',
position: 'right',
},
{
href: 'https://github.com/web-ridge/react-native-paper-dates',
label: 'GitHub',
Expand Down
20 changes: 9 additions & 11 deletions example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')
const exclusionList = require('metro-config/src/defaults/exclusionList')
const escape = require('escape-string-regexp')
const { getDefaultConfig } = require('@expo/metro-config')
const exclusionList = require('metro-config/src/defaults/exclusionList')
const pak = require('../package.json')

const root = path.resolve(__dirname, '..')
Expand All @@ -9,13 +10,19 @@ const modules = Object.keys({
...pak.peerDependencies,
})

const defaultConfig = getDefaultConfig(__dirname)

module.exports = {
...defaultConfig,

projectRoot: __dirname,
watchFolders: [root],

// We need to make sure that only one version is loaded for peerDependencies
// So we blacklist them at the root, and alias them to the versions in example's node_modules
// So we block them at the root, and alias them to the versions in example's node_modules
resolver: {
...defaultConfig.resolver,

blacklistRE: exclusionList(
modules.map(
(m) =>
Expand All @@ -28,13 +35,4 @@ module.exports = {
return acc
}, {}),
},

transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
}
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Example app for react-native-paper-dates",
"version": "0.0.1",
"private": true,
"main": "index",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"android": "expo start --android",
"ios": "expo start --ios",
Expand Down
Loading

0 comments on commit c54b046

Please sign in to comment.