diff --git a/app/components/crate-header.hbs b/app/components/crate-header.hbs new file mode 100644 index 00000000000..031961595bd --- /dev/null +++ b/app/components/crate-header.hbs @@ -0,0 +1,33 @@ + +
+
+ {{svg-jar "crate" local-class="crate-icon"}} +

{{@crate.name}}

+ {{#if @version}} +

{{@version.num}}

+ {{/if}} +
+ + {{#if this.session.currentUser}} + + {{/if}} +
+ + +
\ No newline at end of file diff --git a/app/components/crate-header.js b/app/components/crate-header.js new file mode 100644 index 00000000000..c9b6e530489 --- /dev/null +++ b/app/components/crate-header.js @@ -0,0 +1,10 @@ +import { inject as service } from '@ember/service'; +import Component from '@glimmer/component'; + +export default class CrateHeader extends Component { + @service session; + + get documentationLink() { + return this.args.version?.documentationLink ?? this.args.crate.documentation; + } +} diff --git a/app/components/crate-header.module.css b/app/components/crate-header.module.css new file mode 100644 index 00000000000..e176b73eeb0 --- /dev/null +++ b/app/components/crate-header.module.css @@ -0,0 +1,52 @@ +.header { + padding-top: 30px; + padding-bottom: 30px; +} + +.header-row { + display: flex; + justify-content: space-between; + padding-bottom: 10px; +} + +.heading { + display: flex; + align-items: center; + + h1, h2 { + margin: 0; + padding: 0; + } + + h2 { + color: var(--main-color-light); + margin-left: 10px; + } +} + +.crate-icon { + flex-shrink: 0; + margin-right: 10px; + width: 32px; + height: 32px; +} + +.quick-links { + display: flex; + flex-direction: row; + flex-wrap: wrap; + + font-size: 80%; + list-style-type: none; + margin: 1em 0 0 0; + padding: 0; + + + li { + margin-right: 1em; + + &:last-child { + margin-right: 0; + } + } +} diff --git a/app/styles/crate/version.module.css b/app/styles/crate/version.module.css index 4f344e1ac05..ce3e022ff78 100644 --- a/app/styles/crate/version.module.css +++ b/app/styles/crate/version.module.css @@ -1,56 +1,3 @@ -div.header { - padding-top: 30px; - padding-bottom: 30px; -} - -.header-row { - display: flex; - justify-content: space-between; - padding-bottom: 10px; -} - -.heading { - display: flex; - align-items: center; - - h1, h2 { - margin: 0; - padding: 0; - } - - h2 { - color: var(--main-color-light); - margin-left: 10px; - } -} - -.crate-icon { - flex-shrink: 0; - margin-right: 10px; - width: 32px; - height: 32px; -} - -.quick-links { - display: flex; - flex-direction: row; - flex-wrap: wrap; - - font-size: 80%; - list-style-type: none; - margin: 1em 0 0 0; - padding: 0; - - - li { - margin-right: 1em; - - &:last-child { - margin-right: 0; - } - } -} - .crate-info { display: flex; flex-direction: column; diff --git a/app/templates/crate/reverse-dependencies.hbs b/app/templates/crate/reverse-dependencies.hbs index 4566ccc639f..9fb77dfcd29 100644 --- a/app/templates/crate/reverse-dependencies.hbs +++ b/app/templates/crate/reverse-dependencies.hbs @@ -1,3 +1,5 @@ + +
⬅ Back to {{ this.crate.name }}
diff --git a/app/templates/crate/version.hbs b/app/templates/crate/version.hbs index be2b7625550..66d058b9fbf 100644 --- a/app/templates/crate/version.hbs +++ b/app/templates/crate/version.hbs @@ -1,39 +1,6 @@ {{page-title this.crate.name}} - -
-
- {{svg-jar "crate" local-class='crate-icon'}} -

{{ this.crate.name }}

-

{{ this.currentVersion.num }}

- {{#if this.isOwner }} - {{!-- --}} - {{/if}} -
- - {{#if this.session.currentUser}} - - {{/if}} -
- - -
+
diff --git a/app/templates/crate/versions.hbs b/app/templates/crate/versions.hbs index d404d932d79..c0964e7df50 100644 --- a/app/templates/crate/versions.hbs +++ b/app/templates/crate/versions.hbs @@ -1,3 +1,5 @@ + + ⬅ Back to Main Page