Skip to content

Commit

Permalink
PackageDetail: add info link about npm-config
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Nov 26, 2018
1 parent 5b3497c commit fe31270
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/components/ExternalLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
:href="href"
:target="newTab === false ? '' : '_blank'"
:title="title"
:class="text === false ? 'icon-only' : ''"
>
<img :src="img" v-if="img">
<v-icon v-else>{{icon || $vuetify.icons.externalLink}}</v-icon>
{{text || href}}</a>
<span class="label" v-if="text !== false">{{text || href}}</span>
</a>
</template>

<script lang="ts">
Expand All @@ -29,6 +31,16 @@ export default class ExternalLink extends Vue {
.v-icon {
font-size: inherit;
line-height: inherit;
display: inline;
margin-right: 4px;
.icon-only & {
margin-right: 0;
}
}
.label {
display: inline;
}
img {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const icons = {
created: 'fas fa-bolt',
updated: 'far fa-clock',
info: 'fas fa-info-circle',
howto: 'far fa-question-circle',
question: 'far fa-question-circle',
clear: 'fas fa-times',
bug: 'fas fa-bug',
contact: 'far fa-comments',
Expand Down Expand Up @@ -123,6 +123,7 @@ icons.yaml = icons.yml;
icons.hbs = icons.html;
icons.nunj = icons.html;
icons.ftl = icons.html;
icons.howto = icons.question;

Vue.use(Vuetify, {
iconfont: 'fa', // 'md' || 'mdi' || 'fa' || 'fa4'
Expand Down
12 changes: 12 additions & 0 deletions src/views/PackageDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@
<v-layout row wrap>
<PackageDetailItem title="install" :bigContent="false" v-if="data.config && data.config.artifactory" :icon="$vuetify.icons.install" :full="true">
<CodeBlock title="Put this in a .npmrc file in your project folder:" :code="getInstallCode().npmrc" language="properties"></CodeBlock>
<div class="config-info">
<ExternalLink href="https://docs.npmjs.com/misc/config#npmrc-files" :icon="$vuetify.icons.question" :text="false" title="More info about npm-config"></ExternalLink>
</div>
<CodeBlock :code="getInstallCode().install" language="bash"></CodeBlock>
<v-btn
color="success"
Expand Down Expand Up @@ -770,6 +773,15 @@ export default class PackageDetail extends Vue {
}
}
.config-info {
transform: translateY(-1em);
text-align: right;
a {
margin-right: 0 !important;
}
}
.v-btn--standalone {
.v-card & {
margin-left: 0;
Expand Down

0 comments on commit fe31270

Please sign in to comment.