Create components and lib folder
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import { createStackNavigator } from 'react-navigation'
|
import { createStackNavigator } from 'react-navigation'
|
||||||
import Home from './home'
|
import Home from './components/home'
|
||||||
|
|
||||||
import Calendar from './calendar'
|
import Calendar from './components/calendar'
|
||||||
import CycleDay from './cycle-day'
|
import CycleDay from './components/cycle-day'
|
||||||
import Chart from './components/chart'
|
import Chart from './components/chart/chart'
|
||||||
|
|
||||||
// this is until react native fixes this bug, see https://github.com/facebook/react-native/issues/18868#issuecomment-382671739
|
// this is until react native fixes this bug, see https://github.com/facebook/react-native/issues/18868#issuecomment-382671739
|
||||||
import { YellowBox } from 'react-native'
|
import { YellowBox } from 'react-native'
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
Switch
|
Switch
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import RadioForm from 'react-native-simple-radio-button'
|
import RadioForm from 'react-native-simple-radio-button'
|
||||||
import styles from './styles'
|
import styles from '../styles'
|
||||||
import { saveBleeding } from './db'
|
import { saveBleeding } from '../db'
|
||||||
import { bleeding as labels } from './labels'
|
import { bleeding as labels } from '../labels'
|
||||||
|
|
||||||
export default class Bleeding extends Component {
|
export default class Bleeding extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { View } from 'react-native'
|
import { View } from 'react-native'
|
||||||
import { Calendar } from 'react-native-calendars'
|
import { Calendar } from 'react-native-calendars'
|
||||||
import * as styles from './styles'
|
import * as styles from '../styles'
|
||||||
import { getOrCreateCycleDay, bleedingDaysSortedByDate } from './db'
|
import { getOrCreateCycleDay, bleedingDaysSortedByDate } from '../db'
|
||||||
|
|
||||||
export default class CalendarView extends Component {
|
export default class CalendarView extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -10,8 +10,8 @@ import Svg,{
|
|||||||
Path
|
Path
|
||||||
} from 'react-native-svg'
|
} from 'react-native-svg'
|
||||||
import { LocalDate } from 'js-joda'
|
import { LocalDate } from 'js-joda'
|
||||||
import { getCycleDay, getOrCreateCycleDay, cycleDaysSortedByDate } from '../db'
|
import { getCycleDay, getOrCreateCycleDay, cycleDaysSortedByDate } from '../../db'
|
||||||
import getCycleDayNumberModule from '../get-cycle-day-number'
|
import getCycleDayNumberModule from '../../lib/get-cycle-day-number'
|
||||||
import styles from './styles'
|
import styles from './styles'
|
||||||
import config from './config'
|
import config from './config'
|
||||||
|
|
||||||
@@ -4,10 +4,10 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Text
|
Text
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import styles from './styles'
|
import styles from '../styles'
|
||||||
import { bleeding as labels} from './labels'
|
import { bleeding as labels} from '../labels'
|
||||||
import cycleDayModule from './get-cycle-day-number'
|
import cycleDayModule from '../lib/get-cycle-day-number'
|
||||||
import { bleedingDaysSortedByDate } from './db'
|
import { bleedingDaysSortedByDate } from '../db'
|
||||||
|
|
||||||
const getCycleDayNumber = cycleDayModule()
|
const getCycleDayNumber = cycleDayModule()
|
||||||
|
|
||||||
@@ -3,12 +3,12 @@ import {
|
|||||||
View,
|
View,
|
||||||
Text
|
Text
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import cycleDayModule from './get-cycle-day-number'
|
import cycleDayModule from '../lib/get-cycle-day-number'
|
||||||
import DayView from './cycle-day-overview'
|
import DayView from './cycle-day-overview'
|
||||||
import BleedingEditView from './bleeding'
|
import BleedingEditView from './bleeding'
|
||||||
import TemperatureEditView from './temperature'
|
import TemperatureEditView from './temperature'
|
||||||
import { formatDateForViewHeader } from './format'
|
import { formatDateForViewHeader } from '../format'
|
||||||
import styles from './styles'
|
import styles from '../styles'
|
||||||
|
|
||||||
const getCycleDayNumber = cycleDayModule()
|
const getCycleDayNumber = cycleDayModule()
|
||||||
|
|
||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
Text
|
Text
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import { LocalDate } from 'js-joda'
|
import { LocalDate } from 'js-joda'
|
||||||
import styles from './styles'
|
import styles from '../styles'
|
||||||
import cycleDayModule from './get-cycle-day-number'
|
import cycleDayModule from '../lib/get-cycle-day-number'
|
||||||
import { getOrCreateCycleDay, bleedingDaysSortedByDate, deleteAll } from './db'
|
import { getOrCreateCycleDay, bleedingDaysSortedByDate, deleteAll } from '../db'
|
||||||
|
|
||||||
const getCycleDayNumber = cycleDayModule()
|
const getCycleDayNumber = cycleDayModule()
|
||||||
|
|
||||||
@@ -7,8 +7,8 @@ import {
|
|||||||
Switch
|
Switch
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
|
|
||||||
import { saveTemperature, getPreviousTemperature } from './db'
|
import { saveTemperature, getPreviousTemperature } from '../db'
|
||||||
import styles from './styles'
|
import styles from '../styles'
|
||||||
|
|
||||||
export default class Temp extends Component {
|
export default class Temp extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -6,7 +6,7 @@ export default function config(opts = {}) {
|
|||||||
let bleedingDaysSortedByDate
|
let bleedingDaysSortedByDate
|
||||||
if (!opts.bleedingDaysSortedByDate) {
|
if (!opts.bleedingDaysSortedByDate) {
|
||||||
// we only want to require (and run) the db module when not running the tests
|
// we only want to require (and run) the db module when not running the tests
|
||||||
bleedingDaysSortedByDate = require('./db').bleedingDaysSortedByDate
|
bleedingDaysSortedByDate = require('../db').bleedingDaysSortedByDate
|
||||||
} else {
|
} else {
|
||||||
bleedingDaysSortedByDate = opts.bleedingDaysSortedByDate
|
bleedingDaysSortedByDate = opts.bleedingDaysSortedByDate
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ import dirtyChai from 'dirty-chai'
|
|||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
chai.use(dirtyChai)
|
chai.use(dirtyChai)
|
||||||
|
|
||||||
import getCycleDayNumberModule from '../get-cycle-day-number'
|
import getCycleDayNumberModule from '../lib/get-cycle-day-number'
|
||||||
|
|
||||||
describe('getCycleDay', () => {
|
describe('getCycleDay', () => {
|
||||||
it('works for a simple example', function () {
|
it('works for a simple example', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user