Skip to content

Instantly share code, notes, and snippets.

@almet
Last active November 3, 2016 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almet/ce26bd2ee8ab21291bfdf805fe1c432a to your computer and use it in GitHub Desktop.
Save almet/ce26bd2ee8ab21291bfdf805fe1c432a to your computer and use it in GitHub Desktop.
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