Skip to content

Commit 9f09d9e

Browse files
futa-ikedaadlius
andauthored
Refactor node and draft reg cards for better CSS (#1353)
Co-authored-by: Yuhuai Liu <yuhuai@cos.io>
1 parent 64e68a9 commit 9f09d9e

File tree

4 files changed

+22
-25
lines changed

4 files changed

+22
-25
lines changed

lib/osf-components/addon/components/draft-registration-card/styles.scss

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,16 @@
3838
}
3939
}
4040

41-
// stylelint-disable selector-no-qualifying-type
42-
a.DraftRegistrationCard__review {
43-
margin-right: 10px;
41+
.DraftRegistrationCard__review {
42+
composes: Button from '../button/styles.scss';
43+
composes: SecondaryButton from '../button/styles.scss';
44+
composes: MediumButton from '../button/styles.scss';
4445

4546
&:hover {
46-
text-decoration: none;
47+
text-decoration: none !important; /* override OsfLink hover style */
4748
}
4849
}
4950

50-
// stylelint-enable selector-no-qualifying-type
51-
.DraftRegistrationCard__edit {
52-
vertical-align: bottom;
53-
}
54-
5551
.DraftRegistrationCard__delete {
5652
button {
5753
padding: 6px 12px;

lib/osf-components/addon/components/draft-registration-card/template.hbs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,17 @@
7878
@route='registries.drafts.draft.review'
7979
@models={{array this.draftRegistration.id}}
8080
>
81-
<Button>
82-
{{t 'osf-components.draft-registration-card.review'}}
83-
</Button>
81+
{{t 'osf-components.draft-registration-card.review'}}
8482
</OsfLink>
8583
{{#unless this.draftRegistration.currentUserIsReadOnly}}
8684
<OsfLink
8785
data-test-draft-card-edit
86+
local-class='DraftRegistrationCard__review'
8887
data-analytics-name='Edit'
8988
@route='registries.drafts.draft'
9089
@models={{array this.draftRegistration.id}}
9190
>
92-
<Button local-class='DraftRegistrationCard__edit'>
93-
{{t 'general.edit'}}
94-
</Button>
91+
{{t 'general.edit'}}
9592
</OsfLink>
9693
{{/unless}}
9794
</div>

lib/osf-components/addon/components/node-card/styles.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,13 @@
8787
overflow: hidden;
8888
white-space: nowrap;
8989
}
90+
91+
.NodeCard__link {
92+
composes: Button from '../button/styles.scss';
93+
composes: SecondaryButton from '../button/styles.scss';
94+
composes: MediumButton from '../button/styles.scss';
95+
96+
&:hover {
97+
text-decoration: none !important; /* override OsfLink hover style */
98+
}
99+
}

lib/osf-components/addon/components/node-card/template.hbs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,30 +172,24 @@
172172
</dl>
173173
<div local-class='MyRegistrationsButtons'>
174174
<OsfLink
175+
local-class='NodeCard__link'
175176
data-analytics-name='View registration'
176177
data-test-view-button='{{@node.id}}'
177178
@route='resolve-guid'
178179
@models={{array @node.id}}
179180
>
180-
<Button
181-
local-class='RegistrationCard_view'
182-
>
183-
{{t 'node_card.view_button'}}
184-
</Button>
181+
{{t 'node_card.view_button'}}
185182
</OsfLink>
186183
{{#if this.latestSchemaResponse}}
187184
{{#if this.shouldShowViewChangesButton}}
188185
<OsfLink
186+
local-class='NodeCard__link'
189187
data-analytics-name='View changes'
190188
data-test-view-changes-button={{@node.id}}
191189
@route='registries.edit-revision.review'
192190
@models={{array this.latestSchemaResponse.id}}
193191
>
194-
<Button
195-
{{!-- local-class='RegistrationCard_update' --}}
196-
>
197-
{{t 'node_card.view_changes_button'}}
198-
</Button>
192+
{{t 'node_card.view_changes_button'}}
199193
</OsfLink>
200194
{{/if}}
201195
{{/if}}

0 commit comments

Comments
 (0)