Skip to content
Open
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
7 changes: 6 additions & 1 deletion app/assets/javascripts/components/composition-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import CompositionFormHeader from './composition-form-header.jsx'
import CompositionNotes from './composition-notes.jsx'
import EditPlayerSelectionRow from './edit-player-selection-row.jsx'
import MapSegmentHeader from './map-segment-header.jsx'
import Notification from './notification.jsx'
import PlayerEditModal from './player-edit-modal.jsx'

import OverwatchTeamCompsApi from '../models/overwatch-team-comps-api'
Expand Down Expand Up @@ -256,7 +257,11 @@ export default class CompositionForm extends React.Component {
allowDuplicates } = this.state

if (typeof mapID !== 'number') {
return <p className="container">Loading...</p>
if (isRequestOut) {
return <p className="container">Loading...</p>
}

return <Notification type="error" message="Oops! You've wandered too far into the dungeon." />
}

const editingPlayer = this.getPlayerToEdit()
Expand Down
41 changes: 41 additions & 0 deletions app/assets/javascripts/components/notification.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import PropTypes from 'prop-types'

class Notification extends React.Component {
constructor(props) {
super(props)
this.state = { visible: true }
}

toggle() {
this.setState({ visible: !this.state.visible })
}

render() {
const { message, type } = this. props
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a stray space after this.. 👀


if (!this.state.visible) {
return null
}

return (
<div className={`${type}-alert container`}>
<div className="inner-container text-center">
{message}
<button
className="button-close"
type="button"
onClick={() => this.toggle()}
></button>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about &times; instead?

</div>
</div>
)
}
}

//Display this crazy stuff
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this comment? 😀

Notification.propTypes = {
message: PropTypes.string.isRequired,
type: PropTypes.string.isRequired
}

export default Notification
16 changes: 16 additions & 0 deletions app/assets/stylesheets/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,24 @@ $defend: #0E9ED2;
$light-defend: #deeff8;
$block: #111318;
$form: #F6F6F7;

$error: #d27c87;
$error-dark: #7d4a50;
$notice: $defend;
$notice-dark: darken($notice, 50%);
// Maybe a new color?
$notice-me-senpai: #6289e0;

// UI Colors - By Use
$error-message-bg: $error;
$error-message-border: $error;
$error-message-text: $white;
$notice-message-bg: $defend;
$notice-message-border: $defend;
$notice-message-text: $white;
$success: #22c65b;


// Heroes
$ana: #408fff;
$bastion: #bac1c9;
Expand Down
28 changes: 28 additions & 0 deletions app/assets/stylesheets/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,34 @@
text-decoration: underline;
}
}
.hover-white{
&:hover,
&:focus {
color: $white;
}
}
.button-close {
@extend .button-link;
float: right;
color: $white;
&:hover,
&:focus {
color: $white;
text-decoration: none;
}
.notice-alert & {
margin-top: -3.5px;
color: $notice-dark;
@extend .hover-white;
}
.error-alert & {
margin-top: -3.5px;
color: $error-dark;
@extend .hover-white;
}
}



.input {
-moz-appearance: none;
Expand Down
26 changes: 25 additions & 1 deletion app/assets/stylesheets/structure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
.layout-children-container {
flex: 1 0 auto;
}

.container-fluid{
width: 100%;
}
.container {
position: relative;
margin: 0 auto;
Expand All @@ -20,6 +22,28 @@
width: 100%;
}

.inner-container {
@extend .container;
width: 1110px;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in a media query? Actually I don't know if the app has a responsive layout right now, so maybe it doesn't matter. 🤔

padding: 0;
}

.notice-alert {
z-index: 10;
height: 60px;
padding: 23px 20px 20px 20px;
margin-top: -52px;
position: fixed;
color: $notice-message-text;
background: $notice-message-bg;
}

.error-alert {
@extend .notice-alert;
color: $error-message-text;
background: $error-message-bg;
}

.footer {
padding: 3rem 1.5rem 6rem;
background-color: $form;
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ body, button, input, select, textarea {
font-family: $font-stack;
}

.text-center {
text-align: center;
}

pre, code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: inherit;
Expand Down Expand Up @@ -71,3 +75,4 @@ h4 {
display: inline-block;
text-align: left;
}

4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ default: &default

development:
<<: *default
database: db/development
database: overwatch_team_comps_development

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test
database: overwatch_team_comps_test

production:
<<: *default
Expand Down