Update index with twitterBadge in data
Added basic validation during before readme generation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user