Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions NewArch/src/RNGalleryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {ComponentListPage} from './ComponentListPage';
import {ButtonExamplePage} from './examples/ButtonExamplePage';
// import {CheckBoxExamplePage} from './examples/CheckBoxExamplePage';
import {ClipboardExamplePage} from './examples/ClipboardExamplePage';
// import {ConfigExamplePage} from './examples/ConfigExamplePage';
import {ConfigExamplePage} from './examples/ConfigExamplePage';
// import {DatePickerExamplePage} from './examples/DatePickerExamplePage';
// import {TimePickerExamplePage} from './examples/TimePickerExamplePage';
// import {SketchExamplePage} from './examples/SketchExamplePage';
Expand Down Expand Up @@ -114,12 +114,12 @@ export const RNGalleryList: Array<IRNGalleryExample> = [
type: 'System',
new: true,
},
// {
// key: 'Config',
// component: ConfigExamplePage,
// textIcon: '\uE753',
// type: 'Status and Info',
// },
Copy link
Contributor

Choose a reason for hiding this comment

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

This should stay commented out until react-native-config is actually added as a dependency in the NewArch project.

{
key: 'Config',
component: ConfigExamplePage,
textIcon: '\uE753',
type: 'Status and Info',
},
// {
// key: 'DatePicker',
// component: DatePickerExamplePage,
Expand Down
10 changes: 8 additions & 2 deletions NewArch/src/examples/ConfigExamplePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ import {Text} from 'react-native';
import React from 'react';
import {Example} from '../components/Example';
import {Page} from '../components/Page';
import Config from 'react-native-config';
import {useTheme} from '../Navigation';

// Fallback config values when react-native-config is not installed
const Config = {
SERVICE_URL: 'https://example.com',
SERVICE_PORT: '8080',
SERVICE_API_KEY: '74970b3d-0bfb-4611-ba1d-dff7209ecc39',
};

Copy link
Contributor

Choose a reason for hiding this comment

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

react-native-config isn't in package.json Hardcoding values defeats the purpose of this example , it no longer demonstrates the library.

export const ConfigExamplePage: React.FunctionComponent<{}> = () => {
const {colors} = useTheme();

Expand All @@ -24,7 +30,7 @@ export const ConfigExamplePage: React.FunctionComponent<{}> = () => {
documentation={[
{
label: 'Config',
url: 'https://github.com/luggit/react-native-config',
url: 'https://github.com/react-native-config/react-native-config',
},
]}>
<Example title="Config Information" code={example}>
Expand Down