-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
378 additions
and
143 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
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 |
---|---|---|
|
@@ -81,7 +81,7 @@ Card.propTypes = { | |
actions: T.func, | ||
card: T.shape( | ||
CardTypes.propTypes | ||
).isRequired | ||
) | ||
} | ||
|
||
export { | ||
|
40 changes: 0 additions & 40 deletions
40
src/plugin/flashcard/Resources/modules/resources/flashcard/components/info.jsx
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
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
76 changes: 76 additions & 0 deletions
76
src/plugin/flashcard/Resources/modules/resources/flashcard/components/rules.jsx
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,76 @@ | ||
import React from 'react' | ||
import classes from 'classnames' | ||
import {PropTypes as T} from 'prop-types' | ||
|
||
import {trans} from '#/main/app/intl' | ||
|
||
const SessionRule= props => { | ||
let icon = <span className={'fa fa-fw fa-map-marker'}/> | ||
if (props.index > 1 && props.index < 7) { | ||
icon = <span className={'fa fa-fw fa-arrow-turn-down icon-mirror'}/> | ||
} else if (props.index === 7) { | ||
icon = <span className={'fa fa-fw fa-flag-checkered'}/> | ||
} | ||
|
||
let rule = props.index | ||
if (props.index === 1) { | ||
rule = trans('session_cards_all', {}, 'flashcard') | ||
} else if (props.index === 2 || props.index === 4) { | ||
rule = trans('session_cards_1x', {}, 'flashcard') + ' + ' + trans('session_cards_failed', {}, 'flashcard') | ||
} else if (props.index === 3) { | ||
rule = trans('session_cards_2x', {}, 'flashcard') + ' + ' + trans('session_cards_failed', {}, 'flashcard') | ||
} else if (props.index === 5) { | ||
rule = trans('session_cards_failed', {}, 'flashcard') | ||
} else if (props.index === 6) { | ||
rule = trans('session_cards_1x', {}, 'flashcard') + ' + ' + trans('session_cards_2x', {}, 'flashcard') + ' + ' + trans('session_cards_failed', {}, 'flashcard') | ||
} else if (props.index === 7) { | ||
rule = trans('session_cards_3x', {}, 'flashcard') + ' + ' + trans('session_cards_failed', {}, 'flashcard') | ||
} | ||
|
||
let classList = ['icon-with-text-right'] | ||
if (props.index < props.session || (props.index === props.session && props.completed)) { | ||
classList.push('session-rule-done') | ||
} | ||
|
||
return ( | ||
<li className="session-rule"> | ||
<div className={classes(classList)}> | ||
{icon} | ||
</div> | ||
<div className=""> | ||
Session {props.index} : {trans('session_cards_start', {}, 'flashcard') + ' ' + rule}. | ||
</div> | ||
</li> | ||
) | ||
} | ||
|
||
SessionRule.propTypes = { | ||
session: T.number, | ||
rule: T.number, | ||
completed: T.bool, | ||
index: T.number | ||
} | ||
|
||
const LeitnerRules = (props) => { | ||
return ( | ||
<ul className="sessions-rules"> | ||
{Array.from({ length: 7 }, (_, index) => ( | ||
<SessionRule | ||
key={index} | ||
session={props.session} | ||
completed={props.completed} | ||
index={index + 1} | ||
/> | ||
))} | ||
</ul> | ||
) | ||
} | ||
|
||
LeitnerRules.propTypes = { | ||
session: T.number, | ||
completed: T.bool | ||
} | ||
|
||
export { | ||
LeitnerRules | ||
} |
Oops, something went wrong.