Skip to content

Commit

Permalink
fix(pencil): chinese letter loading
Browse files Browse the repository at this point in the history
  • Loading branch information
yjb94 committed Jan 22, 2020
1 parent b836f53 commit b446528
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ const ReactStoreBadges = ({
width = 135,
height = 40,
}) => {
const shortLocale = locale.split(/[_-]/)[0];
const expeptionLocale = ["zh-cn", "zh-tw"];
let shortCode = locale;
if (expeptionLocale.indexOf(shortCode) === -1) {
shortCode = shortCode.split(/[_-]/)[0];
}

const image = {
ios:`https://linkmaker.itunes.apple.com/images/badges/${locale}/badge_appstore-lrg.svg`,
android: `https://raw.github.com/yjb94/google-play-badge-svg/master/img/${shortLocale}_get.svg?sanitize=true`
android: `https://raw.github.com/yjb94/google-play-badge-svg/master/img/${shortCode}_get.svg?sanitize=true`
}

return (
Expand Down

0 comments on commit b446528

Please sign in to comment.