Skip to content

Commit fca52d6

Browse files
committed
Tanned yank button depending on background
1 parent 9cb1160 commit fca52d6

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

app/components/yank-button.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{#if @version.yanked}}
22
<button
33
type="button"
4-
local-class="button"
4+
local-class="{{this.localClass}}"
55
...attributes
66
data-test-version-unyank-button={{@version.num}}
77
disabled={{@version.unyankTask.isRunning}}
@@ -16,7 +16,7 @@
1616
{{else}}
1717
<button
1818
type="button"
19-
local-class="button"
19+
local-class="{{this.localClass}}"
2020
...attributes
2121
data-test-version-yank-button={{@version.num}}
2222
disabled={{@version.yankTask.isRunning}}

app/components/yank-button.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
import Component from '@ember/component';
1+
import Component from '@glimmer/component';
22

3-
export default Component.extend({
4-
tagName: '',
5-
});
3+
export default class YankButton extends Component {
4+
get tagName() {
5+
return '';
6+
}
7+
8+
get localClass() {
9+
if (this.args.tan) {
10+
return 'tan-button';
11+
}
12+
13+
return 'yellow-button';
14+
}
15+
}

app/components/yank-button.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
.button {
1+
.yellow-button {
22
composes: yellow-button small from '../styles/shared/buttons.module.css';
3+
}
4+
5+
.tan-button {
6+
composes: tan-button small from '../styles/shared/buttons.module.css';
37
}

app/templates/crate/version.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h1 data-test-crate-name>{{ this.crate.name }}</h1>
88
<h2 data-test-crate-version>{{ this.currentVersion.num }}</h2>
99
{{#if this.isOwner }}
10-
<YankButton @version={{this.currentVersion}} />
10+
<YankButton @version={{this.currentVersion}} @tan={{true}} />
1111
{{/if}}
1212
</div>
1313

0 commit comments

Comments
 (0)