Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the KLogo component #460

Merged
merged 21 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/KImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div>
<img
:src="src"
:src="logo"
:alt="alternateText"
:style="styleObject"
>
Expand All @@ -14,6 +14,8 @@

<script>

import kolibriLogo from '../docs/common/DocsPageTemplate/SideNav/kolibri-logo.svg';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should be linking to an SVG in the docs directory here. Perhaps it'd be worth copy-pasting it directly into the same directory as this file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely would be good to copy it to KImg/KLogo directory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt that someone re-organizing docs code and pages would get an idea to check whether it broke something in library. So good to have strict separation.


export default {
name: 'KImg',
props: {
Expand Down Expand Up @@ -80,6 +82,13 @@
type: [Number, String],
default: undefined,
},
/**
* Renders the kolibri icon for the component
*/
kolibriFly: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -115,6 +124,9 @@
imgMinWidth() {
return this.validateAndFormatUnits(this.minWidth);
},
logo() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the item being shown won't always be a "logo" maybe we can call this something like imgSrc

return this.kolibriFly ? kolibriLogo : this.src;
},
},
created() {
if (!this.isDecorative && !this.altText) {
Expand Down