Skip to content

Commit

Permalink
style(junior): add transition on feedback messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelie-crouillebois committed Nov 15, 2024
1 parent 0037622 commit 2fb40dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions junior/app/components/bubble.gjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import {tracked} from '@glimmer/tracking';
import MarkdownToHtml from 'junior/components/markdown-to-html';
import * as markdownConverter from 'junior/utils/markdown-converter';

Expand All @@ -22,7 +22,7 @@ export default class Bubble extends Component {
return className;
}
get getDelayedClass() {
if (typeof this.args.shouldDisplayIn === 'number') {
if (typeof this.args.shouldDisplayIn === 'number' || this.args.withTransition) {
return 'bubble-container__delayed';
}
return '';
Expand Down
10 changes: 9 additions & 1 deletion junior/app/components/challenge/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@status="success"
@oralization={{@oralization}}
aria-live="polite"
@withTransition={{true}}
/>
{{/if}}
{{#if (eq this.answer.result "ko")}}
Expand All @@ -22,10 +23,17 @@
@oralization={{@oralization}}
@status="error"
aria-live="polite"
@withTransition={{true}}
/>
{{/if}}
{{#if this.displayValidationWarning}}
<Bubble @message={{this.validationWarning}} @status="warning" aria-live="polite" @oralization={{@oralization}} />
<Bubble
@message={{this.validationWarning}}
@status="warning"
aria-live="polite"
@oralization={{@oralization}}
@withTransition={{true}}
/>
{{/if}}
</RobotDialog>
<Challenge::Item
Expand Down
2 changes: 1 addition & 1 deletion junior/app/styles/components/bubble.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

&__delayed {
transition: all 1s;
transition: all 2s;
}
}

Expand Down

0 comments on commit 2fb40dc

Please sign in to comment.