Skip to content

Commit

Permalink
feat: apply resume link at blog kbar
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesungoh committed Apr 18, 2022
1 parent 0493d32 commit 8d5c430
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/blog/_config/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"blogName": "Cometin'",
"blogDescription": "I like to share my knowledge.",
"blogRepo": "hyesungoh/comet-land",
"blogUrl": "https://comet-land-blog.vercel.app"
"blogUrl": "https://comet-land-blog.vercel.app",
"resumeUrl": "https://comet-land-resume.vercel.app"
}
1 change: 1 addition & 0 deletions apps/blog/_config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export const blogName = jsonData.blogName;
export const blogDescription = jsonData.blogDescription;
export const blogRepo = jsonData.blogRepo;
export const blogUrl = jsonData.blogUrl;
export const resumeUrl = jsonData.resumeUrl;
20 changes: 19 additions & 1 deletion apps/blog/src/constants/KbarActions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NextRouter } from 'next/router';
import { IconActionType, socialActions } from 'core/constants';
import { openExternalLink } from 'core/utils';

import { resumeUrl } from '../../../_config';
import categoryActions from './categories';
import postActions from './posts';

Expand Down Expand Up @@ -35,7 +36,24 @@ function generateKbarAction(router: NextRouter) {
perform: () => openExternalLink('/rss.xml'),
};

const kbarActions: IconActionType[] = [...routePostActions, ...routeCategoryActions, rssFeedAction, ...socialActions];
const resumeAction = {
id: 'resume',
name: 'Resume',
subtitle: resumeUrl,
section: 'Social',
shortcut: [],
keywords: 'contact, hire, job',
icon: 'Info',
perform: () => openExternalLink(resumeUrl),
};

const kbarActions: IconActionType[] = [
...routePostActions,
...routeCategoryActions,
rssFeedAction,
...socialActions,
resumeAction,
];

return kbarActions;
}
Expand Down
11 changes: 11 additions & 0 deletions packages/core/components/Icon/svg/Info.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

import { IconProps } from '../type';

export function Info({ width = '24px', ...props }: IconProps) {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width={width} {...props}>
<path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z" />
</svg>
);
}
2 changes: 2 additions & 0 deletions packages/core/components/Icon/svg/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Email } from './Email';
import { Facebook } from './Facebook';
import { Github } from './Github';
import { GithubLine } from './GithubLine';
import { Info } from './Info';
import { Instagram } from './Instagram';
import { Link } from './Link';
import { Linkedin } from './Linkedin';
Expand All @@ -19,6 +20,7 @@ export const svg = {
Facebook,
Github,
GithubLine,
Info,
Instagram,
Link,
Linkedin,
Expand Down

0 comments on commit 8d5c430

Please sign in to comment.