[add]: design
This commit is contained in:
+19
-12
@@ -4,19 +4,19 @@ import { latestBlogs } from "../utils/workflows"
|
|||||||
import links from "../constants/page-links"
|
import links from "../constants/page-links"
|
||||||
import { isMediumUsernameValid } from "../utils/validation"
|
import { isMediumUsernameValid } from "../utils/validation"
|
||||||
|
|
||||||
const AddonsItem = ({inputId, inputChecked, onInputChange, ...props}) => {
|
const AddonsItem = ({ inputId, inputChecked, onInputChange, ...props }) => {
|
||||||
return (
|
return (
|
||||||
<div className="py-2 flex justify-start items-center text-sm sm:text-lg">
|
<div className="py-2 flex justify-start items-center text-sm sm:text-lg">
|
||||||
<label htmlFor={inputId} className="cursor-pointer flex items-center">
|
<label htmlFor={inputId} className="cursor-pointer flex items-center">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={inputId}
|
id={inputId}
|
||||||
checked={inputChecked}
|
checked={inputChecked}
|
||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
<span className="pl-4">{props.children}</span>
|
<span className="pl-4">{props.children}</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +60,13 @@ const Addons = props => {
|
|||||||
>
|
>
|
||||||
display visitors count badge
|
display visitors count badge
|
||||||
</AddonsItem>
|
</AddonsItem>
|
||||||
|
<AddonsItem
|
||||||
|
inputId="github-profile-trophy"
|
||||||
|
inputChecked={props.data.githubProfileTrophy}
|
||||||
|
onInputChange={() => props.handleCheckChange("githubProfileTrophy")}
|
||||||
|
>
|
||||||
|
display github trophy
|
||||||
|
</AddonsItem>
|
||||||
<AddonsItem
|
<AddonsItem
|
||||||
inputId="github-stats"
|
inputId="github-stats"
|
||||||
inputChecked={props.data.githubStats}
|
inputChecked={props.data.githubStats}
|
||||||
|
|||||||
@@ -92,6 +92,20 @@ const Markdown = props => {
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
const GithubProfileTrophy = props => {
|
||||||
|
let link =
|
||||||
|
"https://github-profile-trophy.vercel.app/?username=" + props.github
|
||||||
|
if (props.show) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{`<p align="left"> <a href="https://github.com/ryo-ma/github-profile-trophy"><img src="${link}" alt="${props.github}" /></a> </p>`}
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
const GitHubStats = props => {
|
const GitHubStats = props => {
|
||||||
let link =
|
let link =
|
||||||
"https://github-readme-stats.vercel.app/api?username=" +
|
"https://github-readme-stats.vercel.app/api?username=" +
|
||||||
@@ -211,6 +225,12 @@ const Markdown = props => {
|
|||||||
github={props.social.github}
|
github={props.social.github}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
<>
|
||||||
|
<GithubProfileTrophy
|
||||||
|
show={props.data.githubProfileTrophy}
|
||||||
|
github={props.social.github}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
<>
|
<>
|
||||||
<DisplayWork
|
<DisplayWork
|
||||||
prefix={props.prefix.currentWork}
|
prefix={props.prefix.currentWork}
|
||||||
@@ -424,7 +444,15 @@ const Markdown = props => {
|
|||||||
username={props.social.rssurl}
|
username={props.social.rssurl}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
{isSocial(props.social) ? <>{`</p>`}<br/><br/></> : ""}
|
{isSocial(props.social) ? (
|
||||||
|
<>
|
||||||
|
{`</p>`}
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
<>
|
<>
|
||||||
<DisplaySkills skills={props.skills} />
|
<DisplaySkills skills={props.skills} />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -233,6 +233,21 @@ const MarkdownPreview = props => {
|
|||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
const GithubProfileTrophyPreview = props => {
|
||||||
|
let link =
|
||||||
|
"https://github-profile-trophy.vercel.app/?username=" + props.github
|
||||||
|
if (props.show) {
|
||||||
|
return (
|
||||||
|
<div className="text-left my-2">
|
||||||
|
{" "}
|
||||||
|
<a href="https://github.com/ryo-ma/github-profile-trophy">
|
||||||
|
<img src={link} alt={props.github} />
|
||||||
|
</a>{" "}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
const GitHubStatsPreview = props => {
|
const GitHubStatsPreview = props => {
|
||||||
let link =
|
let link =
|
||||||
"https://github-readme-stats.vercel.app/api?username=" +
|
"https://github-readme-stats.vercel.app/api?username=" +
|
||||||
@@ -294,6 +309,10 @@ const MarkdownPreview = props => {
|
|||||||
show={props.data.visitorsBadge}
|
show={props.data.visitorsBadge}
|
||||||
github={props.social.github}
|
github={props.social.github}
|
||||||
/>
|
/>
|
||||||
|
<GithubProfileTrophyPreview
|
||||||
|
show={props.data.githubProfileTrophy}
|
||||||
|
github={props.social.github}
|
||||||
|
/>
|
||||||
<WorkPreview work={props} />
|
<WorkPreview work={props} />
|
||||||
<SocialPreview social={props.social} />
|
<SocialPreview social={props.social} />
|
||||||
<SkillsPreview skills={props.skills} />
|
<SkillsPreview skills={props.skills} />
|
||||||
|
|||||||
+10
-2
@@ -172,6 +172,11 @@ const categorizedSkills = {
|
|||||||
skills: ["gatsby", "gridsome", "hugo", "jekyll", "nextjs", "nuxtjs"],
|
skills: ["gatsby", "gridsome", "hugo", "jekyll", "nextjs", "nuxtjs"],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
game_engines:{
|
||||||
|
title: "Game Engines",
|
||||||
|
skills: ["unity"],
|
||||||
|
},
|
||||||
|
|
||||||
other: {
|
other: {
|
||||||
title: "Other",
|
title: "Other",
|
||||||
skills: ["linux", "git"],
|
skills: ["linux", "git"],
|
||||||
@@ -370,7 +375,9 @@ const icons = {
|
|||||||
elasticsearch:
|
elasticsearch:
|
||||||
"https://www.vectorlogo.zone/logos/elastic/elastic-icon.svg",
|
"https://www.vectorlogo.zone/logos/elastic/elastic-icon.svg",
|
||||||
circleci:
|
circleci:
|
||||||
"https://www.vectorlogo.zone/logos/circleci/circleci-icon.svg"
|
"https://www.vectorlogo.zone/logos/circleci/circleci-icon.svg",
|
||||||
|
unity:
|
||||||
|
"https://www.vectorlogo.zone/logos/unity3d/unity3d-icon.svg"
|
||||||
}
|
}
|
||||||
|
|
||||||
const skillWebsites = {
|
const skillWebsites = {
|
||||||
@@ -492,7 +499,8 @@ const skillWebsites = {
|
|||||||
kibana: "https://www.elastic.co/kibana",
|
kibana: "https://www.elastic.co/kibana",
|
||||||
grafana: "https://grafana.com",
|
grafana: "https://grafana.com",
|
||||||
elasticsearch: "https://www.elastic.co",
|
elasticsearch: "https://www.elastic.co",
|
||||||
circleci: "https://circleci.com"
|
circleci: "https://circleci.com",
|
||||||
|
unity: "https://unity.com/"
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialSkillState = {}
|
const initialSkillState = {}
|
||||||
|
|||||||
+11
-2
@@ -54,6 +54,7 @@ const DEFAULT_DATA = {
|
|||||||
contact: "",
|
contact: "",
|
||||||
funFact: "",
|
funFact: "",
|
||||||
visitorsBadge: false,
|
visitorsBadge: false,
|
||||||
|
githubProfileTrophy: false,
|
||||||
githubStats: false,
|
githubStats: false,
|
||||||
topLanguages: false,
|
topLanguages: false,
|
||||||
devDynamicBlogs: false,
|
devDynamicBlogs: false,
|
||||||
@@ -221,7 +222,12 @@ const IndexPage = () => {
|
|||||||
trimDataValues(social, setSocial)
|
trimDataValues(social, setSocial)
|
||||||
trimDataValues(link, setLink)
|
trimDataValues(link, setLink)
|
||||||
resetCopyMarkdownButton()
|
resetCopyMarkdownButton()
|
||||||
if (data.visitorsBadge || data.githubStats || data.topLanguages) {
|
if (
|
||||||
|
data.visitorsBadge ||
|
||||||
|
data.githubProfileTrophy ||
|
||||||
|
data.githubStats ||
|
||||||
|
data.topLanguages
|
||||||
|
) {
|
||||||
if (social.github && isGitHubUsernameValid(social.github)) {
|
if (social.github && isGitHubUsernameValid(social.github)) {
|
||||||
generate()
|
generate()
|
||||||
}
|
}
|
||||||
@@ -466,7 +472,10 @@ const IndexPage = () => {
|
|||||||
handleCheckChange={handleCheckChange}
|
handleCheckChange={handleCheckChange}
|
||||||
/>
|
/>
|
||||||
<div className="section">
|
<div className="section">
|
||||||
{(data.visitorsBadge || data.githubStats || data.topLanguages) &&
|
{(data.visitorsBadge ||
|
||||||
|
data.githubProfileTrophy ||
|
||||||
|
data.githubStats ||
|
||||||
|
data.topLanguages) &&
|
||||||
!social.github ? (
|
!social.github ? (
|
||||||
<div className="warning">
|
<div className="warning">
|
||||||
* Please add github username to use these add-ons
|
* Please add github username to use these add-ons
|
||||||
|
|||||||
Reference in New Issue
Block a user