Socket
Socket
Sign inDemoInstall

@bufferapp/analyze-export-picker

Package Overview
Dependencies
64
Maintainers
34
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.56.0 to 1.74.1

78

components/ExportPicker/index.jsx

@@ -1,33 +0,53 @@

import React from "react";
import React, { useState } from "react";
import PropTypes from "prop-types";
import Select from "@bufferapp/ui/Select";
class ExportPicker extends React.Component {
render() {
const { exporting, exportToCSV, exportToPNG, filename } = this.props;
import { Can, Cant, EXPORT } from "@bufferapp/analyze-account";
import { Button } from '@bufferapp/analyze-shared-components';
import UpgradeToPro from '@bufferapp/upgrade-to-pro';
const exportOptions = [
{
id: "csv",
title: "Export as CSV",
onItemClick: () => exportToCSV(filename),
},
{
id: "png",
title: "Export as Images",
onItemClick: () => exportToPNG(filename),
},
];
return (
<Select
onSelectClick={(selectedItem) =>
selectedItem.onItemClick()
}
label={exporting ? "Exporting..." : "Export as..."}
items={exportOptions}
disabled={exporting}
hideSearch
xPosition="right"
/>
);
}
function ExportPicker({
exporting,
exportToCSV,
exportToPNG,
filename,
}) {
const [showUpgrade, setShowUpgrade] = useState(false);
const exportOptions = [
{
id: "csv",
title: "Export as CSV",
onItemClick: () => exportToCSV(filename),
},
{
id: "png",
title: "Export as Images",
onItemClick: () => exportToPNG(filename),
},
];
return (
<React.Fragment>
<Can {...{EXPORT}}>
<Select
onSelectClick={(selectedItem) =>
selectedItem.onItemClick()
}
label={exporting ? "Exporting..." : "Export as..."}
items={exportOptions}
disabled={exporting}
hideSearch
xPosition="right"
/>
</Can>
<Cant {...{EXPORT}}>
<Button onClick={() => {setShowUpgrade(true)}}>Export as...</Button>
</Cant>
{showUpgrade && <UpgradeToPro
hide={() => {setShowUpgrade(false)}}
title="Unlock Charts Export"
description="Upgrade to get the most out of Buffers Analytics, and unlock PNG and CSV charts export!"
/>}
</React.Fragment>
);
}

@@ -34,0 +54,0 @@

@@ -26,2 +26,3 @@ import React from 'react';

exportPicker: {},
account: {},
});

@@ -28,0 +29,0 @@ const wrapper = mount(

{
"name": "@bufferapp/analyze-export-picker",
"version": "1.56.0",
"version": "1.74.1",
"description": "Export Dropdown",

@@ -25,3 +25,3 @@ "main": "index.js",

},
"gitHead": "cc22a98fe20db394dc94c4d849391971fab903f3"
"gitHead": "b4c7c64f1287f4b33ecc792471af2d2f4978d595"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc