Skip to content

Commit

Permalink
Merge pull request #2 from indirectlylit/shared-icons
Browse files Browse the repository at this point in the history
making a shared component and shared icon, reusable across the learn app
  • Loading branch information
66eli77 authored Jul 11, 2016
2 parents e7a431c + c720088 commit c759229
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 159 deletions.
11 changes: 4 additions & 7 deletions kolibri/plugins/learn/assets/src/vue/content-card/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>

<a v-link="link">
<img class="content-icon" v-if="kind" :src="icon">
<content-icon class="content-icon" v-if="kind" :kind="kind" :progress="progress"></content-icon>
<img :src="thumbnail" class="thumbnail" v-if="showThumbnail">
<div class="thumbnail" v-else>&nbsp;</div>
<h3>
Expand All @@ -18,6 +18,9 @@
const PageNames = require('../../state/constants').PageNames;
module.exports = {
components: {
'content-icon': require('../content-icon'),
},
props: {
id: {
type: String,
Expand Down Expand Up @@ -61,12 +64,6 @@
},
},
computed: {
icon() {
// Note: dynamic requires should be used carefully because
// they greedily add items to the webpack bundle.
// See https://webpack.github.io/docs/context.html
return require(`./content-icons/${this.progress}-${this.kind}.svg`);
},
link() {
return {
name: PageNames.EXPLORE_CONTENT,
Expand Down
34 changes: 34 additions & 0 deletions kolibri/plugins/learn/assets/src/vue/content-icon/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>

<img :src="src">

</template>


<script>
module.exports = {
props: {
progress: {
type: String,
default: 'unstarted',
},
kind: {
type: String,
required: true,
},
},
computed: {
src() {
// Note: dynamic requires should be used carefully because
// they greedily add items to the webpack bundle.
// See https://webpack.github.io/docs/context.html
return require(`./content-icons/${this.progress}-${this.kind}.svg`);
},
},
};
</script>


<style lang="stylus" scoped></style>
158 changes: 7 additions & 151 deletions kolibri/plugins/learn/assets/src/vue/search-widget/search-card.vue

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kolibri/plugins/learn/assets/src/vue/topic-card/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>

<a v-link="link">
<img src="./folder.svg">
<img src="../folder.svg">
<h3 class="title">
{{ title }}
</h3>
Expand Down

0 comments on commit c759229

Please sign in to comment.