Remove folders and files

This commit is contained in:
Ariful Alam
2022-03-18 23:30:10 +06:00
parent 6a9496aa51
commit 7b7502a118
38 changed files with 0 additions and 41846 deletions

View File

@@ -1,71 +0,0 @@
import { fallbackImage, skeleton } from "../helpers/utils";
import LazyImage from "./LazyImage";
import PropTypes from 'prop-types';
import { useContext } from "react";
import { LoadingContext } from "../contexts/LoadingContext";
const AvatarCard = (props) => {
const [loading] = useContext(LoadingContext);
return (
<div className="card shadow-lg compact bg-base-100">
<div className="grid place-items-center py-8">
{
(loading || !props.profile) ? (
<div className="avatar opacity-90">
<div className="mb-8 rounded-full w-32 h-32">
{
skeleton({
width: 'w-full',
height: 'h-full',
shape: '',
})
}
</div>
</div>
) : (
<div className="avatar opacity-90">
<div className="mb-8 rounded-full w-32 h-32 ring ring-primary ring-offset-base-100 ring-offset-2">
{
<LazyImage
src={props.profile.avatar ? props.profile.avatar : fallbackImage}
alt={props.profile.name}
placeholder={
skeleton({
width: 'w-full',
height: 'h-full',
shape: '',
})
}
/>
}
</div>
</div>
)
}
<div className="text-center mx-auto px-8">
<h5 className="font-bold text-2xl">
{
(loading || !props.profile) ? (
skeleton({ width: 'w-48', height: 'h-8' })
) : <span className="opacity-70">{props.profile.name}</span>
}
</h5>
<div className="mt-3 text-base-content text-opacity-60">
{
(loading || !props.profile) ? (
skeleton({ width: 'w-48', height: 'h-5' })
) : props.profile.bio
}
</div>
</div>
</div>
</div>
)
}
AvatarCard.propTypes = {
profile: PropTypes.object
}
export default AvatarCard;

View File

@@ -1,197 +0,0 @@
import { getDevtoArticle, getMediumArticle } from "article-api";
import moment from "moment";
import { Fragment, useContext, useEffect, useState } from "react";
import { CgHashtag } from 'react-icons/cg';
import config from "../config";
import { LoadingContext } from "../contexts/LoadingContext";
import { ga, skeleton } from "../helpers/utils";
import LazyImage from "./LazyImage";
const displaySection = () => {
if (
typeof config.blog !== 'undefined' &&
typeof config.blog.source !== 'undefined' &&
typeof config.blog.username !== 'undefined' &&
config.blog.source &&
config.blog.username
) {
return true;
} else {
return false;
}
}
const Blog = () => {
const [articles, setArticles] = useState(null);
const [loading] = useContext(LoadingContext);
useEffect(() => {
if (displaySection()) {
if (config.blog.source === 'medium') {
getMediumArticle({
user: config.blog.username
})
.then(res => {
setArticles(res);
});
} else if (config.blog.source === 'dev.to') {
getDevtoArticle({
user: config.blog.username
})
.then(res => {
setArticles(res);
});
}
}
}, [])
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < config.blog.limit; index++) {
array.push((
<div className="card shadow-lg compact bg-base-100" key={index}>
<div className="p-8 h-full w-full">
<div className="flex items-center flex-col md:flex-row">
<div className="avatar mb-5 md:mb-0">
<div className="w-24 h-24 mask mask-squircle">
{
skeleton({
width: 'w-full',
height: 'h-full',
shape: '',
})
}
</div>
</div>
<div className="w-full">
<div className="flex items-start px-4">
<div className="w-full">
<h2>
{skeleton({ width: 'w-full', height: 'h-8', className: 'mb-2 mx-auto md:mx-0' })}
</h2>
{skeleton({ width: 'w-24', height: 'h-3', className: 'mx-auto md:mx-0' })}
<div className="mt-3">
{skeleton({ width: 'w-full', height: 'h-4', className: 'mx-auto md:mx-0' })}
</div>
<div className="mt-4 flex items-center flex-wrap justify-center md:justify-start">
{skeleton({ width: 'w-32', height: 'h-4', className: "md:mr-2 mx-auto md:mx-0" })}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
))
}
return array;
}
const renderArticles = () => {
return articles && articles.slice(0, config.blog.limit).map((article, index) => (
<div
className="card shadow-lg compact bg-base-100 cursor-pointer"
key={index}
onClick={() => {
try {
if (config.googleAnalytics?.id) {
ga.event({
action: "Click Blog Post",
params: {
post: article.title
}
});
}
} catch (error) {
console.error(error);
}
window.open(article.link, '_blank')
}}
>
<div className="p-8 h-full w-full">
<div className="flex items-center flex-col md:flex-row">
<div className="avatar mb-5 md:mb-0 opacity-90">
<div className="w-24 h-24 mask mask-squircle">
<LazyImage
src={article.thumbnail}
alt={'thumbnail'}
placeholder={
skeleton({
width: 'w-full',
height: 'h-full',
shape: '',
})
}
/>
</div>
</div>
<div className="w-full">
<div className="flex items-start px-4">
<div className="text-center md:text-left w-full">
<h2 className="font-semibold text-base-content opacity-60">{article.title}</h2>
<p className="opacity-50 text-xs">
{moment(article.publishedAt).fromNow()}
</p>
<p className="mt-3 text-base-content text-opacity-60 text-sm">
{article.description}
</p>
<div className="mt-4 flex items-center flex-wrap justify-center md:justify-start">
{
article.categories.map((category, index2) => (
<div key={index2} className="flex text-sm mr-3 items-center opacity-50 font-bold font-mono">
<span><CgHashtag /></span>
<span>{category}</span>
</div>
))
}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
))
}
return (
<Fragment>
{
displaySection() && (
<div className="col-span-1 lg:col-span-2">
<div className="grid grid-cols-2 gap-6">
<div className="col-span-2">
<div className="card compact bg-base-100 shadow-sm">
<div className="card-body">
<ul className="menu row-span-3 bg-base-100 text-base-content">
<li>
<div className="pb-0-important mx-4 flex items-center justify-between">
<h5 className="card-title">
{
(loading || !articles) ? skeleton({ width: 'w-28', height: 'h-8' }) : (
<span className="opacity-70">Recent Posts</span>
)
}
</h5>
</div>
</li>
</ul>
</div>
</div>
</div>
<div className="col-span-2">
<div className="grid grid-cols-1 gap-6">
{(loading || !articles) ? renderSkeleton() : renderArticles()}
</div>
</div>
</div>
</div>
)
}
</Fragment>
)
}
export default Blog;

View File

@@ -1,307 +0,0 @@
import { MdLocationOn, MdMail } from 'react-icons/md';
import { AiFillGithub, AiFillMediumSquare } from 'react-icons/ai';
import { SiTwitter } from 'react-icons/si';
import { GrLinkedinOption } from 'react-icons/gr';
import { CgDribbble } from 'react-icons/cg';
import { RiPhoneFill } from 'react-icons/ri';
import { FaBehanceSquare, FaBuilding, FaDev, FaFacebook, FaGlobe } from 'react-icons/fa';
import config from '../config';
import { skeleton } from '../helpers/utils';
import PropTypes from 'prop-types';
import { useContext } from 'react';
import { LoadingContext } from '../contexts/LoadingContext';
const Details = (props) => {
const [loading] = useContext(LoadingContext);
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < 4; index++) {
array.push((
<li key={index}>
<span>
{skeleton({ width: 'w-6', height: 'h-4', className: 'mr-2' })}
{skeleton({ width: 'w-32', height: 'h-4' })}
</span>
</li>
))
}
return array;
}
return (
<div className="card shadow-lg compact bg-base-100">
<div className="card-body">
<ul className="menu row-span-3 bg-base-100 text-base-content text-opacity-60">
{
(loading || !props.profile) ? renderSkeleton() : (
<>
{
props.profile.location && (
<li>
<span>
<div>
<MdLocationOn className="mr-2"/>
</div>
<div>
{props.profile.location}
</div>
</span>
</li>
)
}
{
props.profile.company && (
<li>
<span>
<div>
<FaBuilding className="mr-2"/>
</div>
<div>
{props.profile.company}
</div>
</span>
</li>
)
}
<li>
<span>
<div>
<AiFillGithub className="mr-2"/>
</div>
<div>
<a
href={`https://github.com/${config.github.username}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.github.username}
</a>
</div>
</span>
</li>
{
typeof config.social.linkedin !== 'undefined' && config.social.linkedin && (
<li>
<span>
<div>
<GrLinkedinOption className="mr-2"/>
</div>
<div>
<a
href={`https://www.linkedin.com/in/${config.social.linkedin}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.linkedin}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.twitter !== 'undefined' && config.social.twitter && (
<li>
<span>
<div>
<SiTwitter className="mr-2"/>
</div>
<div>
<a
href={`https://twitter.com/${config.social.twitter}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.twitter}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.dribbble !== 'undefined' && config.social.dribbble && (
<li>
<span>
<div>
<CgDribbble className="mr-2"/>
</div>
<div>
<a
href={`https://dribbble.com/${config.social.dribbble}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.dribbble}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.behance !== 'undefined' && config.social.behance && (
<li>
<span>
<div>
<FaBehanceSquare className="mr-2"/>
</div>
<div>
<a
href={`https://www.behance.net/${config.social.behance}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.behance}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.facebook !== 'undefined' && config.social.facebook && (
<li>
<span>
<div>
<FaFacebook className="mr-2"/>
</div>
<div>
<a
href={`https://www.facebook.com/${config.social.facebook}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.facebook}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.medium !== 'undefined' && config.social.medium && (
<li>
<span>
<div>
<AiFillMediumSquare className="mr-2"/>
</div>
<div>
<a
href={`https://medium.com/@${config.social.medium}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.medium}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.devto !== 'undefined' && config.social.devto && (
<li>
<span>
<div>
<FaDev className="mr-2"/>
</div>
<div>
<a
href={`https://dev.to/${config.social.devto}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.devto}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.website !== 'undefined' && config.social.website && (
<li>
<span>
<div>
<FaGlobe className="mr-2"/>
</div>
<div>
<a
href={`${config.social.website}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.website}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.phone !== 'undefined' && config.social.phone && (
<li>
<span>
<div>
<RiPhoneFill className="mr-2"/>
</div>
<div>
<a
href={`tel:${config.social.phone}`}
rel="noreferrer"
className="text-base-content-important"
>
{config.social.phone}
</a>
</div>
</span>
</li>
)
}
{
typeof config.social.email !== 'undefined' && config.social.email && (
<li>
<span>
<div>
<MdMail className="mr-2"/>
</div>
<div>
<a
href={`mailto:${config.social.email}`}
target="_blank"
rel="noreferrer"
className="text-base-content-important"
>
{config.social.email}
</a>
</div>
</span>
</li>
)
}
</>
)
}
</ul>
</div>
</div>
)
}
Details.propTypes = {
profile: PropTypes.object
}
export default Details;

View File

@@ -1,91 +0,0 @@
import config from "../config";
import { GoPrimitiveDot } from 'react-icons/go';
import { skeleton } from "../helpers/utils";
import { useContext } from "react";
import { LoadingContext } from "../contexts/LoadingContext";
const Education = () => {
const [loading] = useContext(LoadingContext);
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < 2; index++) {
array.push((
<li key={index}>
<span>
{skeleton({ width: 'w-2', height: 'h-2', className: "mr-2" })}
<div className="w-full">
<div className="block justify-between">
<div>
{skeleton({ width: 'w-9/12', height: 'h-4', className: "mb-2" })}
</div>
<div>
{skeleton({ width: 'w-6/12', height: 'h-4', className: "mb-2" })}
</div>
</div>
<div>
{skeleton({ width: 'w-6/12', height: 'h-3' })}
</div>
</div>
</span>
</li>
))
}
return array;
}
return (
<>
{
(typeof config.education !== 'undefined' && config.education.length !== 0) && (
<div className="card shadow-lg compact bg-base-100">
<div className="card-body">
<ul className="menu row-span-3 bg-base-100 text-base-content">
<li>
<div className="pb-0-important mx-3">
<h5 className="card-title">
{
loading ? skeleton({width: 'w-32', height: 'h-8'}) : (
<span className="opacity-70">Education</span>
)
}
</h5>
</div>
</li>
{
loading ? renderSkeleton() : (
config.education.map((item, index) => (
<li key={index}>
<span>
<div>
<GoPrimitiveDot className="mr-2 opacity-40"/>
</div>
<div>
<div className="block justify-between">
<div className="font-medium opacity-70">
{item.institution}
</div>
<div className="opacity-50">
{item.from} - {item.to}
</div>
</div>
<div className="opacity-70">
{item.degree}
</div>
</div>
</span>
</li>
))
)
}
</ul>
</div>
</div>
)
}
</>
)
}
export default Education;

View File

@@ -1,27 +0,0 @@
import PropTypes from 'prop-types';
const ErrorPage = (props) => {
return (
<div className="min-w-screen min-h-screen bg-base-200 flex items-center p-5 lg:p-20 overflow-hidden relative">
<div className="flex-1 min-h-full min-w-full rounded-3xl bg-base-100 shadow-xl p-10 lg:p-20 text-gray-800 relative md:flex items-center text-center md:text-left">
<div className="w-full">
<div className="mb-10 md:mb-20 mt-10 md:mt-20 text-gray-600 font-light">
<h1 className="font-black uppercase text-3xl lg:text-5xl text-primary mb-10">{props.status}</h1>
<p className="text-lg pb-2 text-base-content">{props.title}</p>
<p className="text-base-content text-opacity-60">{props.subTitle}</p>
</div>
</div>
</div>
<div className="w-64 md:w-96 h-96 md:h-full bg-accent bg-opacity-10 absolute -top-64 md:-top-96 right-20 md:right-32 rounded-full pointer-events-none -rotate-45 transform"></div>
<div className="w-96 h-full bg-secondary bg-opacity-10 absolute -bottom-96 right-64 rounded-full pointer-events-none -rotate-45 transform"></div>
</div>
)
}
ErrorPage.propTypes = {
status: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
subTitle: PropTypes.string.isRequired
}
export default ErrorPage;

View File

@@ -1,91 +0,0 @@
import config from "../config";
import { GoPrimitiveDot } from 'react-icons/go';
import { skeleton } from "../helpers/utils";
import { useContext } from "react";
import { LoadingContext } from "../contexts/LoadingContext";
const Experience = () => {
const [loading] = useContext(LoadingContext);
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < 2; index++) {
array.push((
<li key={index}>
<span>
{skeleton({ width: 'w-2', height: 'h-2', className: "mr-2" })}
<div className="w-full">
<div className="block justify-between">
<div>
{skeleton({ width: 'w-9/12', height: 'h-4', className: "mb-2" })}
</div>
<div>
{skeleton({ width: 'w-6/12', height: 'h-4', className: "mb-2" })}
</div>
</div>
<div>
{skeleton({ width: 'w-6/12', height: 'h-3' })}
</div>
</div>
</span>
</li>
))
}
return array;
}
return (
<>
{
(typeof config.experiences !== 'undefined' && config.experiences.length !== 0) && (
<div className="card shadow-lg compact bg-base-100">
<div className="card-body">
<ul className="menu row-span-3 bg-base-100 text-base-content">
<li>
<div className="pb-0-important mx-3">
<h5 className="card-title">
{
loading ? skeleton({width: 'w-32', height: 'h-8'}) : (
<span className="opacity-70">Experience</span>
)
}
</h5>
</div>
</li>
{
loading ? renderSkeleton() : (
config.experiences.map((experience, index) => (
<li key={index}>
<span>
<div>
<GoPrimitiveDot className="mr-2 opacity-40"/>
</div>
<div>
<div className="block justify-between">
<div className="font-medium opacity-70">
{experience.company}
</div>
<div className="opacity-50">
{experience.from} - {experience.to}
</div>
</div>
<div className="opacity-70">
{experience.position}
</div>
</div>
</span>
</li>
))
)
}
</ul>
</div>
</div>
)
}
</>
)
}
export default Experience;

View File

@@ -1,30 +0,0 @@
import { useState, Fragment, useEffect } from 'react';
const LazyImage = ({ placeholder, src, alt, ...rest }) => {
const [loading, setLoading] = useState(true);
useEffect(() => {
const imageToLoad = new Image();
imageToLoad.src = src;
imageToLoad.onload = () => {
setLoading(false);
}
}, [src])
return (
<Fragment>
{
loading ? placeholder : (
<img
src={src}
alt={alt}
{...rest}
/>
)
}
</Fragment>
)
}
export default LazyImage;

View File

@@ -1,66 +0,0 @@
import React, { Fragment, useContext } from 'react';
import { Helmet } from "react-helmet-async";
import config from '../config';
import { isThemeDarkish } from '../helpers/utils';
import PropTypes from 'prop-types';
import { ThemeContext } from '../contexts/ThemeContext';
const MetaTags = (props) => {
const [theme] = useContext(ThemeContext);
return (
<Fragment>
{
props.profile && (
<Helmet>
{
config.googleAnalytics?.id && (
<script async src={`https://www.googletagmanager.com/gtag/js?id=${config.googleAnalytics.id}`}></script>
)
}
{
config.googleAnalytics?.id && (
<script>
{
`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${config.googleAnalytics.id}');
`
}
</script>
)
}
<title>Portfolio of {props.profile.name}</title>
<meta name="theme-color" content={isThemeDarkish(theme) ? '#000000' : '#ffffff'}/>
<meta name="description" content={props.profile.bio} />
<meta itemprop="name" content={`Portfolio of ${props.profile.name}`} />
<meta itemprop="description" content={props.profile.bio} />
<meta itemprop="image" content={props.profile.avatar} />
<meta property="og:url" content={typeof config.social.website !== 'undefined' ? config.social.website : ''} />
<meta property="og:type" content="website" />
<meta property="og:title" content={`Portfolio of ${props.profile.name}`} />
<meta property="og:description" content={props.profile.bio} />
<meta property="og:image" content={props.profile.avatar} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={`Portfolio of ${props.profile.name}`} />
<meta name="twitter:description" content={props.profile.bio} />
<meta name="twitter:image" content={props.profile.avatar} />
</Helmet>
)
}
</Fragment>
)
}
MetaTags.propTypes = {
profile: PropTypes.object
}
export default MetaTags;

View File

@@ -1,162 +0,0 @@
import { Fragment, useContext } from "react";
import { ga, languageColor, skeleton } from "../helpers/utils";
import { AiOutlineStar, AiOutlineFork } from 'react-icons/ai';
import config from "../config";
import PropTypes from 'prop-types';
import { LoadingContext } from "../contexts/LoadingContext";
const Project = (props) => {
const [loading] = useContext(LoadingContext);
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < config.github.limit; index++) {
array.push((
<div className="card shadow-lg compact bg-base-100" key={index}>
<div className="flex justify-between flex-col p-8 h-full w-full">
<div>
<div className="flex items-center">
<span>
<h5 className="card-title text-lg">
{skeleton({ width: 'w-32', height: 'h-8' })}
</h5>
</span>
</div>
<div className="mb-5 mt-1">
{skeleton({ width: 'w-full', height: 'h-4', className: 'mb-2' })}
{skeleton({ width: 'w-full', height: 'h-4' })}
</div>
</div>
<div className="flex justify-between">
<div className="flex flex-grow">
<span className="mr-3 flex items-center">
{skeleton({ width: 'w-12', height: 'h-4' })}
</span>
<span className="flex items-center">
{skeleton({ width: 'w-12', height: 'h-4' })}
</span>
</div>
<div>
<span className="flex items-center">
{skeleton({ width: 'w-12', height: 'h-4' })}
</span>
</div>
</div>
</div>
</div>
))
}
return array;
}
const renderProjects = () => {
return props.repo.map((item, index) => (
<div
className="card shadow-lg compact bg-base-100 cursor-pointer"
key={index}
onClick={() => {
try {
if (config.googleAnalytics?.id) {
ga.event({
action: "Click project",
params: {
project: item.name
}
});
}
} catch (error) {
console.error(error);
}
window.open(item.html_url, '_blank')
}}
>
<div className="flex justify-between flex-col p-8 h-full w-full">
<div>
<div className="flex items-center opacity-60">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" className="inline-block w-5 h-5 mr-2 stroke-current"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg>
<span>
<h5 className="card-title text-lg">
{item.name}
</h5>
</span>
</div>
<p className="mb-5 mt-1 text-base-content text-opacity-60 text-sm">
{item.description}
</p>
</div>
<div className="flex justify-between text-sm text-base-content text-opacity-60">
<div className="flex flex-grow">
<span className="mr-3 flex items-center">
<AiOutlineStar className="mr-0.5" />
<span>{item.stargazers_count}</span>
</span>
<span className="flex items-center">
<AiOutlineFork className="mr-0.5" />
<span>{item.forks_count}</span>
</span>
</div>
<div>
<span className="flex items-center">
<div className="w-3 h-3 rounded-full mr-1 opacity-60" style={{ backgroundColor: languageColor(item.language) }} />
<span>{item.language}</span>
</span>
</div>
</div>
</div>
</div>
));
}
return (
<Fragment>
<div className="col-span-1 lg:col-span-2">
<div className="grid grid-cols-2 gap-6">
<div className="col-span-2">
<div className="card compact bg-base-100 shadow-sm">
<div className="card-body">
<ul className="menu row-span-3 bg-base-100 text-base-content">
<li>
<div className="pb-0-important mx-4 flex items-center justify-between">
<h5 className="card-title">
{
loading ? skeleton({ width: 'w-28', height: 'h-8' }) : (
<span className="opacity-70">My Projects</span>
)
}
</h5>
{
loading ? skeleton({ width: 'w-10', height: 'h-5' }) : (
<a
href={`https://github.com/${config.github.username}?tab=repositories`}
target="_blank"
rel="noreferrer"
className="opacity-50"
>
See All
</a>
)
}
</div>
</li>
</ul>
</div>
</div>
</div>
<div className="col-span-2">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
{(loading || !props.repo) ? renderSkeleton() : renderProjects()}
</div>
</div>
</div>
</div>
</Fragment>
)
}
Project.propTypes = {
repo: PropTypes.array
}
export default Project;

View File

@@ -1,58 +0,0 @@
import { useContext } from "react";
import config from "../config";
import { LoadingContext } from "../contexts/LoadingContext";
import { skeleton } from "../helpers/utils";
const Skill = () => {
const [loading] = useContext(LoadingContext);
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < 12; index++) {
array.push((
<div key={index}>
{skeleton({ width: 'w-16', height: 'h-4', className: 'm-1' })}
</div>
))
}
return array;
}
return (
<>
{
(typeof config.skills !== 'undefined' && config.skills.length !== 0) && (
<div className="card shadow-lg compact bg-base-100">
<div className="card-body">
<div className="mx-3">
<h5 className="card-title">
{
loading ? skeleton({width: 'w-32', height: 'h-8'}) : (
<span className="opacity-70">Tech Stack</span>
)
}
</h5>
</div>
<div className="p-3 flow-root">
<div className="-m-1 flex flex-wrap">
{
loading ? renderSkeleton() : (
config.skills.map((skill, index) => (
<div key={index} className="m-1 text-xs inline-flex items-center font-bold leading-sm uppercase px-3 py-1 badge-primary bg-opacity-75 rounded-full">
{skill}
</div>
))
)
}
</div>
</div>
</div>
</div>
)
}
</>
)
}
export default Skill;

View File

@@ -1,78 +0,0 @@
import config from '../config';
import { skeleton } from '../helpers/utils';
import { AiOutlineControl } from 'react-icons/ai';
import { useContext } from 'react';
import { ThemeContext } from '../contexts/ThemeContext';
import { LoadingContext } from '../contexts/LoadingContext';
const ThemeChanger = () => {
const [theme, setTheme] = useContext(ThemeContext);
const [loading] = useContext(LoadingContext);
const changeTheme = (e, selectedTheme) => {
e.preventDefault();
document.querySelector('html').setAttribute('data-theme', selectedTheme);
localStorage.setItem('ezprofile-theme', selectedTheme);
setTheme(selectedTheme);
}
return (
<div className="card overflow-visible shadow-lg compact bg-base-100">
<div className="flex-row items-center space-x-4 flex pl-6 pr-2 py-4">
<div className="flex-1">
<h5 className="card-title">
{
loading ? skeleton({ width: 'w-20', height: 'h-8' }) : (
<span className="opacity-70">Theme</span>
)
}
</h5>
<span className="text-base-content text-opacity-40 capitalize text-sm">
{
loading ? skeleton({ width: 'w-16', height: 'h-5' }) : (theme === config.themeConfig.default ? 'Default' : theme)
}
</span>
</div>
<div className="flex-0">
{
loading ? skeleton({ width: 'w-14 md:w-28', height: 'h-10', className: 'mr-6' }) : (
<div title="Change Theme" className="dropdown dropdown-end">
<div tabIndex={0} className="btn btn-ghost m-1 normal-case opacity-50">
<AiOutlineControl className="inline-block w-5 h-5 stroke-current md:mr-2"/>
<span className="hidden md:inline">
Change Theme
</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1792 1792" className="inline-block w-4 h-4 ml-1 fill-current">
<path d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z" />
</svg>
</div>
<div tabIndex={0} className="mt-16 overflow-y-auto shadow-2xl top-px dropdown-content h-96 w-52 rounded-b-box bg-base-200 text-base-content">
<ul className="p-4 menu compact">
{
[config.themeConfig.default, ...config.themeConfig.themes.filter(item => item !== config.themeConfig.default)].map((item, index) => (
<li key={index}>
{/* eslint-disable-next-line */}
<a
onClick={(e) => changeTheme(e, item)}
className={`${theme === item ? 'active' : ''}`}
>
<span className="opacity-60 capitalize">
{item === config.themeConfig.default ? 'Default' : item}
</span>
</a>
</li>
))
}
</ul>
</div>
</div>
)
}
</div>
</div>
</div>
)
}
export default ThemeChanger;