Skip to content

Commit

Permalink
adding custom color by platform
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasheartcliff committed Feb 24, 2024
1 parent 9e75732 commit 13aa677
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
25 changes: 0 additions & 25 deletions public/assets/jsons/profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,6 @@
"title": "IT Techinical Education - IEPB",
"startDate": "2015-01-01T00:00:00.000Z",
"endDate": "2016-12-31T00:00:00.000Z"
},
{
"title": "High School - IEPB",
"startDate": "2015-01-01T00:00:00.000Z",
"endDate": "2016-12-31T00:00:00.000Z"
},
{
"title": "High School - COCA",
"startDate": "2014-01-01T00:00:00.000Z",
"endDate": "2014-12-31T00:00:00.000Z"
},
{
"title": "Primary School - CEVN",
"startDate": "2012-07-01T00:00:00.000Z",
"endDate": "2013-12-31T00:00:00.000Z"
},
{
"title": "Primary School - Pestalozzi",
"startDate": "2008-01-01T00:00:00.000Z",
"endDate": "2012-07-31T00:00:00.000Z"
},
{
"title": "Primary School - Soberano",
"startDate": "2005-01-01T00:00:00.000Z",
"endDate": "2007-12-31T00:00:00.000Z"
}
],
"certification": [
Expand Down
5 changes: 4 additions & 1 deletion src/components/CertificateCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import ExportOutlined from '@ant-design/icons/ExportOutlined';
import Tooltip from 'antd/lib/tooltip';
import React from 'react';

import { getPlatformColor } from '@/utils';

import Link from '../Link';

interface Props {
Expand All @@ -20,7 +22,8 @@ export default function CertificateCard({ name, platform, url }: Props) {
</Tooltip>
</div>
<div
className={`inline-flex items-center rounded-md bg-blue-100 px-2 py-1 text-xs font-semibold capitalize text-blue-700 ring-1 ring-inset ring-blue-700/10`}
style={{ backgroundColor: getPlatformColor(platform) }}
className={`inline-flex items-center rounded-md px-2 py-1 text-xs font-semibold capitalize text-white `}
>
{platform}
</div>
Expand Down
12 changes: 12 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ export const getLanguageColor = (lang: string) =>
export const isProgrammingLanguage = (lang: string) => {
return lang ? lang.toUpperCase() in languageColors : false;
};

const platformsColor: { [k: string]: string } = {
ALURA: '#5ea3d0',
UDEMY: '#A435F0',
CISCO: '#049fd9',
OTHERS: '#049fd9',
};

export const getPlatformColor = (platform: string) => {
const p = platform.toUpperCase();
return p in platformsColor ? platformsColor[p] : platformsColor.OTHERS;
};

0 comments on commit 13aa677

Please sign in to comment.