-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified Preferences container (added new components, modified styles…
…), added PasswordInput, Button, Icon components.WIP
- Loading branch information
Priscila Oliveira
authored and
Priscila Oliveira
committed
Dec 11, 2017
1 parent
b165166
commit 4975988
Showing
51 changed files
with
627 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react' | ||
import glamorous from 'glamorous' | ||
import RaisedButton from 'material-ui/RaisedButton' | ||
|
||
const radiusMap = { | ||
topLeft: 'borderTopLeftRadius', | ||
topRight: 'borderTopRightRadius', | ||
bottomRight: 'borderBottomRightRadius', | ||
bottomLeft: 'borderBottomLeftRadius', | ||
all: 'borderRadius' | ||
} | ||
|
||
const Button = glamorous(({ | ||
borderRadius, | ||
noRadius = false, | ||
radiusDir = 'all', | ||
radius = 2, | ||
sm = false, | ||
...props | ||
}) => ( | ||
<RaisedButton | ||
buttonStyle={{ | ||
[radiusMap[radiusDir]]: radius, | ||
...!sm && ({ | ||
height: 50, | ||
lineHeight: '50px', | ||
}), | ||
...noRadius && ({ | ||
borderRadius: 0 | ||
}) | ||
}} | ||
style={{ | ||
...!sm && ({ | ||
marginTop: 20, | ||
height: 50 | ||
}) | ||
}} | ||
{...props} | ||
/> | ||
))() | ||
|
||
export default Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/components/FileInput/styles.js → src/components/FileInput/indexStyles.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import glamorous from 'glamorous' | ||
|
||
const Wrapper = glamorous.span({ | ||
display: 'inline-block', | ||
verticalAlign: 'middle', | ||
}) | ||
|
||
const Table = glamorous.span({ | ||
height: '100%', | ||
width: '100%', | ||
display: 'table' | ||
}) | ||
|
||
const TableCell = glamorous.span(({ sm, md, lg, customSize, rotate45, name }) => ({ | ||
display: 'table-cell', | ||
verticalAlign: 'middle', | ||
transition: 'all .3s ease-in-out', | ||
transform: rotate45 ? 'rotate(45deg) scale(1.1)' : 'none', | ||
opacity: name === 'settings' && !rotate45 ? 0.5 : 1, | ||
':hover': { | ||
opacity: 1 | ||
}, | ||
...getSize(sm, md, lg, customSize), | ||
})) | ||
|
||
const getSize = (sm, md, lg, customSize) => { | ||
let result = { width: '100%', height: '100%' } | ||
if (sm) { result = { width: 18, height: 18 } } | ||
if (md) { result = { width: 24, height: 24 } } | ||
if (lg) { result = { width: 32, height: 32 } } | ||
if (customSize) { result = { width: customSize, height: customSize } } | ||
return result | ||
} | ||
|
||
export { | ||
Wrapper, | ||
Table, | ||
TableCell | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react' | ||
import glamorous from 'glamorous' | ||
import RaisedButton from 'material-ui/RaisedButton' | ||
|
||
const radiusMap = { | ||
topLeft: 'borderTopLeftRadius', | ||
topRight: 'borderTopRightRadius', | ||
bottomRight: 'borderBottomRightRadius', | ||
bottomLeft: 'borderBottomLeftRadius', | ||
all: 'borderRadius' | ||
} | ||
|
||
const Img = glamorous.div({ | ||
backgroundRepeat: 'no-repeat', | ||
backgroundSize: 'cover', | ||
}, ({ url, borderRadius = 2, width = '100%', height = '100%' }) => ({ | ||
width, | ||
height, | ||
borderRadius, | ||
backgroundImage: `url(${url})` | ||
})) | ||
|
||
export default Img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { Component } from 'react' | ||
import { intlShape, injectIntl } from 'react-intl' | ||
import { Field } from 'redux-form' | ||
import Visibility from 'material-ui/svg-icons/action/visibility' | ||
import VisibilityOff from 'material-ui/svg-icons/action/visibility-off' | ||
import TextInput from 'components/TextInput' | ||
import messages from './messages' | ||
import { PasswordWrapper, CheckBoxField } from './indexStyles' | ||
|
||
class PasswordInput extends Component { | ||
|
||
static propTypes = { | ||
intl: intlShape | ||
} | ||
|
||
constructor() { | ||
super() | ||
this.handleSetShowPassword = ::this.handleSetShowPassword | ||
this.state = { showPassword: false } | ||
} | ||
|
||
handleSetShowPassword() { | ||
this.setState({ showPassword: !this.state.showPassword }) | ||
} | ||
|
||
render() { | ||
const { intl } = this.props | ||
const { showPassword } = this.state | ||
return ( | ||
<PasswordWrapper> | ||
<Field | ||
name='password' | ||
component={TextInput} | ||
type={showPassword ? 'text' : 'password'} | ||
label={intl.formatMessage(messages['randomQuotes.components.passwordInput.password'])} | ||
fullWidth | ||
/> | ||
<CheckBoxField | ||
name='show' | ||
type='checkbox' | ||
onCheck={this.handleSetShowPassword} | ||
iconStyle={{ fill: 'rgba(0, 0, 0, 0.22)', marginRight: 0 }} | ||
checkedIcon={<Visibility />} | ||
uncheckedIcon={<VisibilityOff />} | ||
/> | ||
</PasswordWrapper> | ||
) | ||
} | ||
} | ||
|
||
export default injectIntl(PasswordInput) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react' | ||
import glamorous from 'glamorous' | ||
import Checkbox from 'material-ui/Checkbox' | ||
|
||
const PasswordWrapper = glamorous.div({ | ||
position: 'relative' | ||
}) | ||
|
||
const Wrapper = glamorous.div({ | ||
height: '100%', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignContent: 'center', | ||
background: '#FFFFFF' | ||
}) | ||
|
||
const CheckBoxField = glamorous(props => ( | ||
<Checkbox {...props} /> | ||
))({ | ||
position: 'absolute !important', | ||
top: 30, | ||
right: 0, | ||
width: 'auto !important' | ||
}) | ||
|
||
export { | ||
PasswordWrapper, | ||
Wrapper, | ||
CheckBoxField | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineMessages } from 'react-intl' | ||
|
||
export default defineMessages({ | ||
'randomQuotes.components.passwordInput.password': { | ||
id: 'randomQuotes.components.passwordInput.password', | ||
defaultMessage: 'Password' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,26 @@ | ||
import React from 'react' | ||
import glamorous from 'glamorous' | ||
import img from './img/loading.svg' | ||
|
||
export const Spinner = () => ( | ||
<div className='Spinner Spinner--centered' /> | ||
) | ||
const Spinner = glamorous.div({ | ||
textAlign: 'center', | ||
margin: '0 auto', | ||
width: 38, | ||
display: 'block', | ||
':after': { | ||
content: '', | ||
display: 'block', | ||
paddingBottom: '100%', | ||
background: `url(${img}) center center no-repeat`, | ||
size: 'cover', | ||
animationName: 'spin', | ||
animationDuration: '750ms', | ||
animationIterationCount: 'infinite', | ||
animationTimingFunction: 'linear', | ||
} | ||
}, ({ centered = true }) => ({ | ||
position: centered ? 'absolute' : 'relative', | ||
top: centered ? '50%' : 'auto', | ||
left: centered ? '50%' : 'auto' | ||
})) | ||
|
||
export default Spinner |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.