Skip to content

Commit

Permalink
few more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
domino14 committed Aug 18, 2018
1 parent 9d4eec3 commit 079bfe3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ChallengeButton = (props) => {
if (props.selectedChallenge === props.challenge.id) {
extraClassName = 'btn-info';
} else if (props.solvedChallenges.includes(props.challenge.id)) {
extraClassName = 'btn-grayed-out';
extraClassName = 'btn-link';
} else {
extraClassName = 'btn-default';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ChallengeDialogContainer extends React.Component {
}

loadChallengePlayedInfo() {
// Load the challenge-related stuff.
// Load info showing whether user has played this challenge.
this.props.showSpinner();
this.props.api.call(CHALLENGES_PLAYED_URL, {
lexicon: this.props.lexicon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const LIST_TYPE_AEROLITH_LISTS = 'Aerolith Lists';
const LIST_TYPE_SAVED_LIST = 'My Saved Lists';
const FLASHCARD_URL = '/flashcards/';

const DATE_FORMAT_STRING = 'YYYY-MM-DD';

const NO_LOAD_WHILE_PLAYING = (
'Please wait until the end of the game to perform that action.');

Expand All @@ -35,6 +33,7 @@ The Collins Official Scrabble Words 2015 (CSW15) is copyright of
HarperCollins Publishers 2015 and used with permission.`;

const DEFAULT_TIME_PER_QUIZ = '5'; // minutes
const DEFAULT_TIME_PER_BLANK_QUIZ = '10';

const notifyError = (error) => {
Notifications.alert('Error', `Failed to process: ${error}`);
Expand Down Expand Up @@ -140,9 +139,13 @@ class TableCreator extends React.Component {
// Reset dialog is called from the parent. This is a bit of an anti
// pattern. We just make sure we reload any lists/etc when a user
// reopens the dialog.
// XXX: TODO fixme
resetDialog() {
this.loadInfoForListType(this.state.activeListType);
if (this.challengeDialogContainer) {
// XXX: This is an anti-pattern, but modals and React don't play
// 100% well together.
this.challengeDialogContainer.loadChallengePlayedInfo();
}
}

showModal() {
Expand Down Expand Up @@ -356,6 +359,9 @@ class TableCreator extends React.Component {
notifyError={notifyError}
setTimeAndQuestions={this.setTimeAndQuestions}
disabled={this.props.gameGoing}
ref={(ref) => {
this.challengeDialogContainer = ref;
}}
/>);
break;
case LIST_TYPE_WORDSEARCH:
Expand Down Expand Up @@ -433,10 +439,17 @@ class TableCreator extends React.Component {
});
if (option !== LIST_TYPE_CHALLENGE) {
// Reset the time back to the defaults.
this.setState({
desiredTime: DEFAULT_TIME_PER_QUIZ,
questionsPerRound: 50,
});
if (option !== LIST_TYPE_BLANKS) {
this.setState({
desiredTime: DEFAULT_TIME_PER_QUIZ,
questionsPerRound: 50,
});
} else {
this.setState({
desiredTime: DEFAULT_TIME_PER_BLANK_QUIZ,
questionsPerRound: 50,
});
}
}
this.loadInfoForListType(option);
}}
Expand Down
3 changes: 0 additions & 3 deletions djAerolith/wordwalls/templates/wordwalls/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
max-width:1200px;
}
}
.btn-grayed-out {
background-color: #777777;
}
</style>

{% if USE_GA %}
Expand Down

0 comments on commit 079bfe3

Please sign in to comment.