Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Update check enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunmangukiya committed Sep 9, 2017
1 parent 449f1b7 commit 314d468
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
3 changes: 3 additions & 0 deletions apps/Logodrop/Contents/Sketch/common/Message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function showMessage (message, context) {
context.document.showMessage(message);
}
5 changes: 5 additions & 0 deletions apps/Logodrop/Contents/Sketch/main.cocoascript
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@import 'common/SelectedShape.js';
@import 'common/Storage.js';
@import 'common/Url.js';
@import 'common/Message.js';
@import 'common/Manifest.js';

function searchLogos(context) {
Expand Down Expand Up @@ -44,6 +45,10 @@ function searchLogos(context) {

log: function () {
log(data);
},

showMessage: function () {
showMessage(data.message, context);
}
};

Expand Down
1 change: 1 addition & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const checkPluginUpdate = () => {

if(versionCompare(liveVersion, currentVersion)) {
app.showMessage('New version of Plugin is available. Update Now!')
document.querySelector('.btn-update').style = 'display: block'
console.log("currentVersion is " + liveVersion + ". Plugin version is "+ currentVersion)
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/LogodropBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { Component } from 'react'
import ExternalLink from './ExternalLink'

const LogodropBanner = () => (
<div className="iconscout-banner">
Powered by <ExternalLink href="https://iconscout.com?utm_source=logodrop&utm_medium=sketch">Iconscout API</ExternalLink>
<div className="logodrop-banner">
Powered by <ExternalLink href="https://iconscout.com?utm_source=logodrop&utm_medium=sketch">Iconscout API</ExternalLink> <ExternalLink className="btn btn-success btn-xs btn-update" href="https://github.com/Iconscout/logodrop?utm_source=logodrop&utm_medium=sketch">Update Now</ExternalLink>
</div>
)

Expand Down
9 changes: 7 additions & 2 deletions src/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -5125,7 +5125,7 @@ header {
background-color: #EDF0F4;
border: 1px solid #e1e1e1; }

.iconscout-banner {
.logodrop-banner {
position: absolute;
bottom: 0;
text-align: center;
Expand All @@ -5134,5 +5134,10 @@ header {
height: 30px;
line-height: 30px;
font-size: 12px; }
.iconscout-banner b {
.logodrop-banner b {
font-weight: 600; }
.logodrop-banner .btn-update {
display: none;
position: absolute;
right: 4px;
top: 4px; }
9 changes: 8 additions & 1 deletion src/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ header {
border: 1px solid $gray-light;
}

.iconscout-banner {
.logodrop-banner {
position: absolute;
bottom: 0;
text-align: center;
Expand All @@ -37,4 +37,11 @@ header {
b {
font-weight: 600
}

.btn-update {
display: none;
position: absolute;
right: 4px;
top: 4px;
}
}

0 comments on commit 314d468

Please sign in to comment.