Update index with twitterBadge in data

Added basic validation during before readme generation
This commit is contained in:
Sunit Shirke
2020-10-01 14:20:50 +05:30
committed by GitHub
parent b1c813540f
commit 33d18f4c8f
+12
View File
@@ -53,6 +53,7 @@ const DEFAULT_DATA = {
ama: "",
contact: "",
funFact: "",
twitterBadge: false,
visitorsBadge: false,
githubStats: false,
topLanguages: false,
@@ -225,6 +226,10 @@ const IndexPage = () => {
if (social.github && isGitHubUsernameValid(social.github)) {
generate()
}
} else if (data.twitterBadge) {
if (social.twitter)) {
generate()
}
} else if (social.github) {
if (isGitHubUsernameValid(social.github)) {
generate()
@@ -511,6 +516,13 @@ const IndexPage = () => {
) : (
""
)}
{(data.twitterBadge && !social.twitter ? (
<div className="warning">
* Please add twitter username to use these add-ons
</div>
) : (
""
)}
</div>
<div className="flex items-center justify-center w-full">
<div