diff --git a/app.js b/app.js index 92f7e57..7977ed4 100644 --- a/app.js +++ b/app.js @@ -1,9 +1,9 @@ import { createStackNavigator } from 'react-navigation' -import Home from './home' +import Home from './components/home' -import Calendar from './calendar' -import CycleDay from './cycle-day' -import Chart from './components/chart' +import Calendar from './components/calendar' +import CycleDay from './components/cycle-day' +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 import { YellowBox } from 'react-native' diff --git a/bleeding.js b/components/bleeding.js similarity index 96% rename from bleeding.js rename to components/bleeding.js index fcbcb50..69efb87 100644 --- a/bleeding.js +++ b/components/bleeding.js @@ -6,9 +6,9 @@ import { Switch } from 'react-native' import RadioForm from 'react-native-simple-radio-button' -import styles from './styles' -import { saveBleeding } from './db' -import { bleeding as labels } from './labels' +import styles from '../styles' +import { saveBleeding } from '../db' +import { bleeding as labels } from '../labels' export default class Bleeding extends Component { constructor(props) { diff --git a/calendar.js b/components/calendar.js similarity index 97% rename from calendar.js rename to components/calendar.js index 0a58513..70cc6ac 100644 --- a/calendar.js +++ b/components/calendar.js @@ -1,8 +1,8 @@ import React, { Component } from 'react' import { View } from 'react-native' import { Calendar } from 'react-native-calendars' -import * as styles from './styles' -import { getOrCreateCycleDay, bleedingDaysSortedByDate } from './db' +import * as styles from '../styles' +import { getOrCreateCycleDay, bleedingDaysSortedByDate } from '../db' export default class CalendarView extends Component { constructor(props) { diff --git a/components/chart.js b/components/chart/chart.js similarity index 98% rename from components/chart.js rename to components/chart/chart.js index b0a6711..2c70ed1 100644 --- a/components/chart.js +++ b/components/chart/chart.js @@ -10,8 +10,8 @@ import Svg,{ Path } from 'react-native-svg' import { LocalDate } from 'js-joda' -import { getCycleDay, getOrCreateCycleDay, cycleDaysSortedByDate } from '../db' -import getCycleDayNumberModule from '../get-cycle-day-number' +import { getCycleDay, getOrCreateCycleDay, cycleDaysSortedByDate } from '../../db' +import getCycleDayNumberModule from '../../lib/get-cycle-day-number' import styles from './styles' import config from './config' diff --git a/components/config.js b/components/chart/config.js similarity index 100% rename from components/config.js rename to components/chart/config.js diff --git a/components/styles.js b/components/chart/styles.js similarity index 100% rename from components/styles.js rename to components/chart/styles.js diff --git a/cycle-day-overview.js b/components/cycle-day-overview.js similarity index 93% rename from cycle-day-overview.js rename to components/cycle-day-overview.js index b5c5370..77b3bf4 100644 --- a/cycle-day-overview.js +++ b/components/cycle-day-overview.js @@ -4,10 +4,10 @@ import { Button, Text } from 'react-native' -import styles from './styles' -import { bleeding as labels} from './labels' -import cycleDayModule from './get-cycle-day-number' -import { bleedingDaysSortedByDate } from './db' +import styles from '../styles' +import { bleeding as labels} from '../labels' +import cycleDayModule from '../lib/get-cycle-day-number' +import { bleedingDaysSortedByDate } from '../db' const getCycleDayNumber = cycleDayModule() diff --git a/cycle-day.js b/components/cycle-day.js similarity index 91% rename from cycle-day.js rename to components/cycle-day.js index def2369..7b7b73f 100644 --- a/cycle-day.js +++ b/components/cycle-day.js @@ -3,12 +3,12 @@ import { View, Text } 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 BleedingEditView from './bleeding' import TemperatureEditView from './temperature' -import { formatDateForViewHeader } from './format' -import styles from './styles' +import { formatDateForViewHeader } from '../format' +import styles from '../styles' const getCycleDayNumber = cycleDayModule() diff --git a/home.js b/components/home.js similarity index 96% rename from home.js rename to components/home.js index 48c7948..5b39620 100644 --- a/home.js +++ b/components/home.js @@ -5,9 +5,9 @@ import { Text } from 'react-native' import { LocalDate } from 'js-joda' -import styles from './styles' -import cycleDayModule from './get-cycle-day-number' -import { getOrCreateCycleDay, bleedingDaysSortedByDate, deleteAll } from './db' +import styles from '../styles' +import cycleDayModule from '../lib/get-cycle-day-number' +import { getOrCreateCycleDay, bleedingDaysSortedByDate, deleteAll } from '../db' const getCycleDayNumber = cycleDayModule() diff --git a/temperature.js b/components/temperature.js similarity index 96% rename from temperature.js rename to components/temperature.js index ea158a1..ace6aa9 100644 --- a/temperature.js +++ b/components/temperature.js @@ -7,8 +7,8 @@ import { Switch } from 'react-native' -import { saveTemperature, getPreviousTemperature } from './db' -import styles from './styles' +import { saveTemperature, getPreviousTemperature } from '../db' +import styles from '../styles' export default class Temp extends Component { constructor(props) { diff --git a/get-cycle-day-number.js b/lib/get-cycle-day-number.js similarity index 95% rename from get-cycle-day-number.js rename to lib/get-cycle-day-number.js index 90646e4..d1b056a 100644 --- a/get-cycle-day-number.js +++ b/lib/get-cycle-day-number.js @@ -6,7 +6,7 @@ export default function config(opts = {}) { let bleedingDaysSortedByDate if (!opts.bleedingDaysSortedByDate) { // we only want to require (and run) the db module when not running the tests - bleedingDaysSortedByDate = require('./db').bleedingDaysSortedByDate + bleedingDaysSortedByDate = require('../db').bleedingDaysSortedByDate } else { bleedingDaysSortedByDate = opts.bleedingDaysSortedByDate } diff --git a/test/get-cycle-day.spec.js b/test/get-cycle-day.spec.js index 222d62e..8aaaddd 100644 --- a/test/get-cycle-day.spec.js +++ b/test/get-cycle-day.spec.js @@ -4,7 +4,7 @@ import dirtyChai from 'dirty-chai' const expect = chai.expect chai.use(dirtyChai) -import getCycleDayNumberModule from '../get-cycle-day-number' +import getCycleDayNumberModule from '../lib/get-cycle-day-number' describe('getCycleDay', () => { it('works for a simple example', function () {