-
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.
Merge pull request #9 from mbustosp/feature/counter-creation
Feature/counter creation
- Loading branch information
Showing
33 changed files
with
1,003 additions
and
120 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 @@ | ||
@import '../../../common/variables'; | ||
|
||
.oval-button { | ||
height: 40px; | ||
background-color: $color-silver; | ||
|
||
border: 1px solid $color-almost-silver; | ||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||
border-radius: 99px; | ||
|
||
padding: 8px 18px; | ||
box-sizing: border-box; | ||
} |
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,28 @@ | ||
/** | ||
* Core dependencies | ||
*/ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import Button from '../Button'; | ||
|
||
/** | ||
* Styles | ||
*/ | ||
import './OvalButton.scss'; | ||
|
||
const OvalButton = ({ onClick, label, className, disabled, children }) => { | ||
return ( | ||
<Button | ||
className={classNames('oval-button', { 'oval-button--disabled': disabled }, className)} | ||
onClick={onClick} | ||
label={label} | ||
disabled={disabled} | ||
> | ||
{children} | ||
</Button> | ||
); | ||
}; | ||
|
||
OvalButton.propTypes = { ...Button.propTypes }; | ||
|
||
export default OvalButton; |
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 |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
&--non-generic { | ||
width: 100%; | ||
max-width: 380px; | ||
height: 48px; | ||
padding: 8px; | ||
margin: 1px; | ||
|
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 '../../../common/variables'; | ||
|
||
.alert { | ||
width: 100%; | ||
height: 100%; | ||
position: fixed; | ||
left: 0; | ||
top: 0; | ||
|
||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
background-color: rgba(black, 0.8); | ||
z-index: 5; | ||
|
||
&__content { | ||
width: 310px; | ||
min-height: 190px; | ||
max-height: 100vh; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
|
||
background: $color-background-tip; | ||
box-shadow: 0 24px 38px rgba(0, 0, 0, 0.14); | ||
border-radius: 10px; | ||
|
||
padding: 20px 28px; | ||
|
||
&__title { | ||
margin-bottom: 8px; | ||
} | ||
|
||
&__message { | ||
margin-bottom: 20px; | ||
} | ||
} | ||
} |
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,36 @@ | ||
/** | ||
* Core dependencies | ||
*/ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
/** | ||
* Styles | ||
*/ | ||
import './Alert.scss'; | ||
|
||
const Alert = ({ title, message, children }) => { | ||
return ( | ||
<div className="alert"> | ||
<div className="alert__content"> | ||
<h1 className="alert__content__title">{title}</h1> | ||
<div className="alert__content__message">{message}</div> | ||
<div className="alert__content__action">{children}</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
Alert.propTypes = { | ||
title: PropTypes.string, | ||
message: PropTypes.string, | ||
children: PropTypes.node, | ||
}; | ||
|
||
Alert.defaultProps = { | ||
title: '', | ||
message: '', | ||
children: null, | ||
}; | ||
|
||
export default Alert; |
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,14 @@ | ||
@import 'src/common/variables'; | ||
|
||
.error-alert { | ||
|
||
|
||
|
||
&__actions { | ||
display: flex; | ||
|
||
button:first-child { | ||
margin-right: 10px; | ||
} | ||
} | ||
} |
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 @@ | ||
/** | ||
* Core dependencies | ||
*/ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Alert from '../Alert'; | ||
import ActionButton from '../../atoms/ActionButton'; | ||
|
||
/** | ||
* Styles | ||
*/ | ||
import './ErrorAlert.scss'; | ||
|
||
const ErrorAlert = ({ title, onDismiss, onRetry }) => { | ||
return ( | ||
<Alert title={title} message="The internet connection appears to be offline"> | ||
<div className="error-alert__actions"> | ||
{onRetry ? ( | ||
<ActionButton className="error-alert__button-retry" onClick={onRetry} label="Retry" /> | ||
) : null} | ||
<ActionButton | ||
className="error-alert__button-dismiss" | ||
onClick={onDismiss} | ||
label="Dismiss" | ||
lightTheme | ||
/> | ||
</div> | ||
</Alert> | ||
); | ||
}; | ||
|
||
ErrorAlert.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
onDismiss: PropTypes.func.isRequired, | ||
onRetry: PropTypes.func, | ||
}; | ||
|
||
ErrorAlert.defaultProps = { | ||
onRetry: null, | ||
}; | ||
|
||
export default ErrorAlert; |
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,20 @@ | ||
.examples-modal { | ||
z-index: 4; | ||
|
||
&__content { | ||
&__section { | ||
font-weight: 600; | ||
font-size: 17px; | ||
line-height: 23px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
&__examples { | ||
overflow-x: auto; | ||
} | ||
|
||
&--overflow { | ||
padding-right: 0; | ||
} | ||
} | ||
} |
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,56 @@ | ||
/** | ||
* Core dependencies | ||
*/ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Modal from '../Modal'; | ||
import ExamplesScroll from '../ExamplesScroll'; | ||
|
||
/** | ||
* Styles | ||
*/ | ||
import './ExamplesModal.scss'; | ||
|
||
const ExamplesModal = ({ onClose, onSelect }) => { | ||
return ( | ||
<Modal | ||
title="Examples" | ||
onClose={onClose} | ||
className="examples-modal" | ||
contentClassName="examples-modal__content--overflow" | ||
> | ||
<div className="examples-modal__content"> | ||
<h2 className="examples-modal__content__section">Drinks</h2> | ||
<div className="examples-modal__content__examples"> | ||
<ExamplesScroll | ||
onClick={(title) => onSelect(title)} | ||
titles={['Cups of coffee', 'Glasses of water', 'Shops of Bier']} | ||
/> | ||
</div> | ||
|
||
<h2 className="examples-modal__content__section">Food</h2> | ||
<div className="examples-modal__content__examples"> | ||
<ExamplesScroll | ||
onClick={(title) => onSelect(title)} | ||
titles={['Pan con pescado', 'Schnitzel', 'Fish & Chips']} | ||
/> | ||
</div> | ||
|
||
<h2 className="examples-modal__content__section">Misc</h2> | ||
<div className="examples-modal__content__examples"> | ||
<ExamplesScroll | ||
onClick={(title) => onSelect(title)} | ||
titles={['AAA Batteries', 'Printers', 'Partners', 'Friends', 'Face masks']} | ||
/> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
ExamplesModal.propTypes = { | ||
onClose: PropTypes.func.isRequired, | ||
onSelect: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default ExamplesModal; |
14 changes: 14 additions & 0 deletions
14
src/components/molecules/ExamplesScroll/ExamplesScroll.scss
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,14 @@ | ||
.examples-scroll { | ||
display: flex; | ||
width: 100%; | ||
flex-wrap: nowrap; | ||
|
||
button { | ||
margin-right: 12px; | ||
flex-shrink: 0; | ||
} | ||
|
||
button:last-child { | ||
margin-right: 24px; | ||
} | ||
} |
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,35 @@ | ||
/** | ||
* Core dependencies | ||
*/ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import OvalButton from '../../atoms/OvalButton'; | ||
|
||
/** | ||
* Styles | ||
*/ | ||
import './ExamplesScroll.scss'; | ||
|
||
const ExamplesScroll = ({ titles, onClick, disabled }) => { | ||
return ( | ||
<div className="examples-scroll"> | ||
{titles.map((title) => ( | ||
<OvalButton onClick={() => onClick(title)} disabled={disabled} label={title} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
ExamplesScroll.propTypes = { | ||
titles: PropTypes.arrayOf(PropTypes.string), | ||
onClick: PropTypes.func, | ||
disabled: PropTypes.bool, | ||
}; | ||
|
||
ExamplesScroll.defaultProps = { | ||
titles: '', | ||
onClick: () => true, | ||
disabled: false, | ||
}; | ||
|
||
export default ExamplesScroll; |
Oops, something went wrong.