Skip to content

Commit

Permalink
refactor: Update licenseBadge and constants.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin committed Dec 18, 2020
1 parent 16da3cf commit 17b42df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/core/Repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
GITHUB_GREEN,
GITHUB_IO,
GREEN,
LICENSE_LABEL,
LICENSE,
SHIELDS_GH,
// eslint-disable-next-line prettier/prettier
STYLES
Expand Down Expand Up @@ -117,13 +117,14 @@ export class Repo {
if (!licenseType || !this._isValid()) {
return "";
}
const label = LICENSE_LABEL,
message = licenseType,
color = DEFAULT_COLOR,
isLarge = false;
const target = this._licenseTarget(localLicense);

return genericBadge(label, message, color, isLarge, target);
return genericBadge(
LICENSE.LABEL,
licenseType,
LICENSE.COLOR,
LICENSE.IS_LARGE,
this._licenseTarget(localLicense)
);
}

gh() {
Expand Down
6 changes: 5 additions & 1 deletion src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export const GITHUB_DOMAIN = "https://github.com",
GITHUB_GREEN = "2ea44f",
DEFAULT_BRANCH = "master";

export const LICENSE_LABEL = "License";
export const LICENSE = {
LABEL: "License",
COLOR: DEFAULT_COLOR,
IS_LARGE: false,
};

// TODO handle as map to make it easy to add multiple params.
export const STYLES = {
Expand Down

0 comments on commit 17b42df

Please sign in to comment.