Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
comments and jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Shou committed Jul 11, 2017
1 parent f1d5fad commit e53958f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pages/success-banner/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
import React from 'react';
import Head from 'next/head';

/**
* @summary Make and return an event method for a given event description string
*/
const eventLog = (eventDesc) => {
const data = 'Banner ' + eventDesc;

return () => {
const url = new URL(location.href);

// Use the 'new' API version for more recent versions of Etcher utilizing
// the Robot object format.
if (url.searchParams.get('api-version') === '1') {
console.log(JSON.stringify({
command: 'log',
data
}));

// Fallback to the old pure-string format.
} else {
console.log(data);
}
}
}
};
};

class Link extends React.PureComponent {
constructor() {
Expand Down

0 comments on commit e53958f

Please sign in to comment.