Skip to content

Instantly share code, notes, and snippets.

@almet almet/changes.diff
Last active Nov 3, 2016

Embed
What would you like to do?
diff --git a/formbuilder/components/AdminView.js b/formbuilder/components/AdminView.js
index 249fc74..9a8739c 100644
--- a/formbuilder/components/AdminView.js
+++ b/formbuilder/components/AdminView.js
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import CSVDownloader from "./CSVDownloader";
import XLSDownloader from "./XLSDownloader";
-import DownloadFormatDropdown from "./DownloadFormatDropdown";
import URLDisplay from "./URLDisplay";
import {getFormID, getFormURL} from "../utils";
@@ -24,10 +23,20 @@ export default class AdminView extends Component {
content = (
<div>
<h3>Results for {title}</h3>
- <DownloadFormatDropdown className="pull-right">
- <i className="glyphicon glyphicon-download" />
- Download as..
- </DownloadFormatDropdown>
+ <DropdownButton title="Download as..." id="bg-nested-dropdown">
+ <MenuItem>
+ <CSVDownloader
+ schema={this.props.schema}
+ fields={schemaFields}
+ records={this.props.records} />
+ </MenuItem>
+ <MenuItem>
+ <XLSDownloader
+ schema={this.props.schema}
+ fields={schemaFields}
+ records={this.props.records} />
+ </MenuItem>
+ </DropdownButton>
<URLDisplay url={formUrl} />
<table className="table table-striped">
<thead>
diff --git a/formbuilder/components/DownloadFormatDropdown.js b/formbuilder/components/DownloadFormatDropdown.js
deleted file mode 100644
index 6f3bdf8..0000000
--- a/formbuilder/components/DownloadFormatDropdown.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import React, { Component } from "react";
-
-import {Dropdown, MenuItem} from "react-bootstrap";
-
-import CSVDownloader from "./CSVDownloader";
-import XLSDownloader from "./XLSDownloader";
-
-import config from "../config";
-
-export default class DownloadFormatDropdown extends Component {
- render () {
- return (
- <Dropdown id="split-button-dropup">
- <Dropdown.Menu>
- <MenuItem>
-
- </MenuItem>
- </Dropdown.Menu>
- </Dropdown>
- );
- }
-}
-
-DownloadFormatDropdown.defaultProps = {
- bsStyle: "default"
-};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.