Make file extension work and remove some unneeded stuff
This commit is contained in:
+1
-10
@@ -2,28 +2,19 @@ import React, { Component } from 'react'
|
|||||||
import {
|
import {
|
||||||
View,
|
View,
|
||||||
Button,
|
Button,
|
||||||
Text,
|
|
||||||
ScrollView,
|
ScrollView,
|
||||||
Alert
|
Alert
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
|
|
||||||
import Share from 'react-native-share'
|
import Share from 'react-native-share'
|
||||||
import getDataAsCsvDataUri from '../lib/export-to-csv'
|
import getDataAsCsvDataUri from '../lib/export-to-csv'
|
||||||
import styles from '../styles/index'
|
import styles from '../styles/index'
|
||||||
import { settings as labels } from './labels'
|
import { settings as labels } from './labels'
|
||||||
|
|
||||||
export default class Settings extends Component {
|
export default class Settings extends Component {
|
||||||
constructor(props) {
|
|
||||||
super(props)
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
pickerVisible: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<Text style={styles.welcome}>{this.state.welcomeText}</Text>
|
|
||||||
<View style={styles.homeButtons}>
|
<View style={styles.homeButtons}>
|
||||||
<View style={styles.homeButton}>
|
<View style={styles.homeButton}>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ export default function makeDataURI() {
|
|||||||
|
|
||||||
const csv = transformToCsv(cycleDaysSortedByDate)
|
const csv = transformToCsv(cycleDaysSortedByDate)
|
||||||
const encoded = Base64.encodeURI(csv)
|
const encoded = Base64.encodeURI(csv)
|
||||||
return `data:text/csv;base64,${encoded}`
|
// this is the MIME type android/libcore/MimeUtils expects, so we oblige
|
||||||
|
return `data:text/comma-separated-values;base64,${encoded}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformToCsv(cycleDays) {
|
function transformToCsv(cycleDays) {
|
||||||
|
|||||||
Reference in New Issue
Block a user