From 1dd6649f279f095ca218dc7e76036b033463c1c5 Mon Sep 17 00:00:00 2001 From: Julia Friesel <julia.friesel@gmail.com> Date: Mon, 6 Aug 2018 17:04:37 +0200 Subject: [PATCH] Make file extension work and remove some unneeded stuff --- components/settings.js | 11 +---------- lib/export-to-csv.js | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/components/settings.js b/components/settings.js index 9bc6c814..3abc167c 100644 --- a/components/settings.js +++ b/components/settings.js @@ -2,28 +2,19 @@ import React, { Component } from 'react' import { View, Button, - Text, ScrollView, Alert } from 'react-native' + import Share from 'react-native-share' import getDataAsCsvDataUri from '../lib/export-to-csv' import styles from '../styles/index' import { settings as labels } from './labels' export default class Settings extends Component { - constructor(props) { - super(props) - - this.state = { - pickerVisible: false - } - } - render() { return ( <ScrollView> - <Text style={styles.welcome}>{this.state.welcomeText}</Text> <View style={styles.homeButtons}> <View style={styles.homeButton}> <Button diff --git a/lib/export-to-csv.js b/lib/export-to-csv.js index 56bc4c51..d3b13216 100644 --- a/lib/export-to-csv.js +++ b/lib/export-to-csv.js @@ -8,7 +8,8 @@ export default function makeDataURI() { const csv = transformToCsv(cycleDaysSortedByDate) 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) { -- GitLab