Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add custom transform #4

Merged
merged 6 commits into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react"]
"presets": ["@babel/preset-react"]
}
50 changes: 25 additions & 25 deletions docs/example.cca24555.js → docs/example.be978658.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/example.be978658.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/example.cca24555.map

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <title>React Dropdown - TABLEFLIP EDITION</title> <link rel="stylesheet" href="main.93fbfc57.css"> </head> <body class="avenir tc bg-near-white"> <h1 class="pb4"> <span class="fw2 mr3">React Dropdown</span>TABLEFLIP EDITION </h1> <div id="root"></div> <script src="example.cca24555.js"></script> </body> </html>
<!DOCTYPE html><html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <title>React Dropdown - TABLEFLIP EDITION</title> <link rel="stylesheet" href="main.7da7e292.css"> </head> <body class="avenir tc bg-near-white"> <h1 class="pb4"> <span class="fw2 mr3">React Dropdown</span>TABLEFLIP EDITION </h1> <div id="root"></div> <script src="example.be978658.js"></script> </body> </html>
2 changes: 2 additions & 0 deletions docs/main.7da7e292.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/main.54e889d4.map → docs/main.8df98f4b.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions docs/main.93fbfc57.css

This file was deleted.

5 changes: 3 additions & 2 deletions example/example.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import {Dropdown, DropdownMenu} from '../src'

function AddFileDropdown ({label, background, boxShadow, open, onActivate, onDismiss, alignRight}) {
function AddFileDropdown ({ label, background, boxShadow, open, onActivate, onDismiss, alignRight, translateX, translateY }) {
return (
<Dropdown className='mh3'>
<button onClick={onActivate} className='br2 bg-blue white pa3 avenir fw5' style={{width: 200}}>
{label}
</button>
<DropdownMenu open={open} onDismiss={onDismiss} width={200} alignRight={alignRight} background={background} boxShadow={boxShadow}>
<DropdownMenu open={open} onDismiss={onDismiss} width={200} alignRight={alignRight} background={background} boxShadow={boxShadow} translateX={translateX} translateY={translateY}>
<nav className='pv1'>
<Option href='#'>Add File</Option>
<Option href='#'>Add Folder</Option>
Expand Down Expand Up @@ -41,6 +41,7 @@ class ExamplePage extends React.Component {
<AddFileDropdown label='default' open={open} onActivate={this.toggleDropdown} onDismiss={this.toggleDropdown} />
<AddFileDropdown label='aqua background' background='#69c4cd' open={open} onActivate={this.toggleDropdown} onDismiss={this.toggleDropdown} />
<AddFileDropdown label='pink shadow' boxShadow='0px 1px 10px 0px pink' open={open} onActivate={this.toggleDropdown} onDismiss={this.toggleDropdown} />
<AddFileDropdown label='with transforms' translateX={90} translateY={10} open={open} onActivate={this.toggleDropdown} onDismiss={this.toggleDropdown} />
</div>
)
}
Expand Down
Loading