mirror of
https://github.com/kremalicious/portfolio.git
synced 2025-01-05 11:25:00 +01:00
Merge pull request #35 from kremalicious/file-saver
FileSaver.js 2.0.0-rc.2
This commit is contained in:
commit
d463d97114
@ -21,7 +21,7 @@
|
|||||||
"new": "babel-node ./scripts/new.js"
|
"new": "babel-node ./scripts/new.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"file-saver": "^1.3.8",
|
"file-saver": "^2.0.0-rc.2",
|
||||||
"gatsby": "^2.0.11",
|
"gatsby": "^2.0.11",
|
||||||
"gatsby-image": "^2.0.10",
|
"gatsby-image": "^2.0.10",
|
||||||
"gatsby-plugin-favicon": "^3.1.4",
|
"gatsby-plugin-favicon": "^3.1.4",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { StaticQuery, graphql } from 'gatsby'
|
import { StaticQuery, graphql } from 'gatsby'
|
||||||
import FileSaver from 'file-saver'
|
import saveAs from 'file-saver'
|
||||||
import vCard from 'vcf'
|
import vCard from 'vcf'
|
||||||
|
|
||||||
const query = graphql`
|
const query = graphql`
|
||||||
@ -61,7 +61,7 @@ const Vcard = () => (
|
|||||||
const downloadVcard = (vcard, meta) => {
|
const downloadVcard = (vcard, meta) => {
|
||||||
const name = meta.addressbook.split('/').join('')
|
const name = meta.addressbook.split('/').join('')
|
||||||
const blob = new Blob([vcard], { type: 'text/x-vcard' })
|
const blob = new Blob([vcard], { type: 'text/x-vcard' })
|
||||||
FileSaver.saveAs(blob, name)
|
saveAs(blob, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
const constructVcard = meta => {
|
const constructVcard = meta => {
|
||||||
|
Loading…
Reference in New Issue
Block a user