|
1 | 1 | // @flow
|
2 |
| -// @jsx glam |
3 | 2 |
|
4 |
| -import glam from 'glam'; |
5 | 3 | import fetch from 'unfetch';
|
6 | 4 | import React, { Component } from 'react';
|
7 | 5 | import { withRouter } from 'react-router-dom';
|
@@ -44,30 +42,46 @@ const changes = [
|
44 | 42 |
|
45 | 43 | function getLabel({ icon, label }) {
|
46 | 44 | return (
|
47 |
| - <div style={{ alignItems: 'center', display: 'flex ' }}> |
| 45 | + <div style={{ alignItems: 'center', display: 'flex' }}> |
48 | 46 | <span style={{ fontSize: 18, marginRight: '0.5em' }}>{icon}</span>
|
49 | 47 | <span style={{ fontSize: 14 }}>{label}</span>
|
50 | 48 | </div>
|
51 | 49 | );
|
52 | 50 | }
|
53 | 51 |
|
54 |
| -const Gradient = ({ css, innerRef, style, ...props }) => ( |
| 52 | +const headerSelectStyles = { |
| 53 | + control: (base, { isFocused }) => ({ |
| 54 | + ...base, |
| 55 | + backgroundClip: 'padding-box', |
| 56 | + borderColor: 'rgba(0,0,0,0.1)', |
| 57 | + boxShadow: isFocused ? '0 0 0 1px #4C9AFF' : null, |
| 58 | + |
| 59 | + ':hover': { |
| 60 | + borderColor: 'rgba(0,0,0,0.2)', |
| 61 | + }, |
| 62 | + }), |
| 63 | + option: base => ({ |
| 64 | + ...base, |
| 65 | + padding: '4px 12px', |
| 66 | + }), |
| 67 | + placeholder: base => ({ |
| 68 | + ...base, |
| 69 | + color: 'black', |
| 70 | + }), |
| 71 | +}; |
| 72 | + |
| 73 | +const Gradient = props => ( |
55 | 74 | <div
|
56 | 75 | css={{
|
57 | 76 | backgroundColor: '#2684FF',
|
| 77 | + backgroundImage: 'linear-gradient(135deg, #2684FF 0%, #0747A6 100%)', |
58 | 78 | color: 'white',
|
59 | 79 | position: 'relative',
|
60 | 80 | zIndex: 2,
|
61 | 81 |
|
62 | 82 | [largeDevice]: {
|
63 | 83 | boxShadow: '0 5px 0 rgba(0, 0, 0, 0.08)',
|
64 | 84 | },
|
65 |
| - ...css, |
66 |
| - }} |
67 |
| - ref={innerRef} |
68 |
| - style={{ |
69 |
| - backgroundImage: 'linear-gradient(135deg, #2684FF 0%, #0747A6 100%)', |
70 |
| - ...style, |
71 | 85 | }}
|
72 | 86 | {...props}
|
73 | 87 | />
|
@@ -198,12 +212,13 @@ const Collapse = ({ height, isCollapsed, innerRef, ...props }) => {
|
198 | 212 | />
|
199 | 213 | );
|
200 | 214 | };
|
| 215 | + |
201 | 216 | const Content = ({ onChange, stars }) => (
|
202 | 217 | <div
|
203 | 218 | css={{
|
204 | 219 | marginTop: 16,
|
205 | 220 |
|
206 |
| - [largeDevice]: { display: 'flex ' }, |
| 221 | + [largeDevice]: { display: 'flex' }, |
207 | 222 | }}
|
208 | 223 | >
|
209 | 224 | <div css={{ flex: 1, [largeDevice]: { paddingRight: 30 } }}>
|
@@ -242,26 +257,7 @@ const Content = ({ onChange, stars }) => (
|
242 | 257 | onChange={onChange}
|
243 | 258 | value={null}
|
244 | 259 | placeholder="🎉 What's new in V2"
|
245 |
| - styles={{ |
246 |
| - control: (css, { isFocused }) => ({ |
247 |
| - ...css, |
248 |
| - backgroundClip: 'padding-box', |
249 |
| - borderColor: 'rgba(0,0,0,0.1)', |
250 |
| - boxShadow: isFocused ? '0 0 0 1px #4C9AFF' : null, |
251 |
| - |
252 |
| - ':hover': { |
253 |
| - borderColor: 'rgba(0,0,0,0.2)', |
254 |
| - }, |
255 |
| - }), |
256 |
| - option: css => ({ |
257 |
| - ...css, |
258 |
| - padding: '4px 12px', |
259 |
| - }), |
260 |
| - placeholder: css => ({ |
261 |
| - ...css, |
262 |
| - color: 'black', |
263 |
| - }), |
264 |
| - }} |
| 260 | + styles={headerSelectStyles} |
265 | 261 | />
|
266 | 262 | </div>
|
267 | 263 | </div>
|
|
0 commit comments