Skip to content

Commit

Permalink
Merge branch 'release/v2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gillyhuga committed Feb 23, 2023
2 parents 636aab8 + 880e4a3 commit c7d4e6c
Show file tree
Hide file tree
Showing 20 changed files with 7,102 additions and 2,153 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel
Expand Down
6 changes: 2 additions & 4 deletions components/common/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,18 @@ const Footer = () => {
<>
<footer className="flex w-screen max-w-7xl mx-auto px-4 sm:px-6 ">
<div className="py-6 px-4 md:flex md:items-center md:justify-between w-full text-base dark:text-white ">
<span className=" hidden sm:block">© 2022 Gilly Huga Anargya. All Rights Reserved.
<span className=" hidden sm:block">© 2023 Gilly Huga Anargya. All Rights Reserved.
</span>
<ul className='flex items-center justify-center'>
{
social.map((item) => {
const Icon = item.icon;
return (
<Link key={item.title} href={item.url}>
<a target="_blank" rel='noreferrer' className='mx-4 flex items-centert hover:text-gray-900'>
<Link key={item.title} href={item.url} target="_blank" rel='noreferrer' className='mx-4 flex items-centert hover:text-gray-900'>
<Icon className="h-6 w-6"/>
<span className='ml-2 hidden sm:block'>
{item.title}
</span>
</a>
</Link>
)
})
Expand Down
12 changes: 5 additions & 7 deletions components/common/NavigationBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@ const menu = [
},
]

const Navbar = ({ router }) => {
const Navbar = ({ router }: any) => {
return (
<Popover className="fixed inset-x-0 top-0 flex flex-row z-10 justify-between bg-clip-padding backdrop-filter bg-opacity-30 border-b dark:border-transparent backdrop-blur-md">
<Popover className="fixed inset-x-0 top-0 flex flex-row z-50 justify-between bg-clip-padding backdrop-filter bg-opacity-30 border-b dark:border-transparent backdrop-blur-md">
<div className="w-screen max-w-7xl mx-auto px-4 sm:px-6">
<div className="flex justify-between items-center py-3 md:justify-start md:space-x-10">
<div className="flex justify-start lg:w-0 lg:flex-1">
<Link href="/">
<a className="h-8 w-auto sm:h-10">
<Link href="/" className="h-8 w-auto sm:h-10">
<Image
src={logo}
alt="Gilly"
width={40}
height={40}
/>
</a>
</Link>
</div>
<div className="-mr-2 -my-2 md:hidden">
Expand All @@ -55,7 +53,7 @@ const Navbar = ({ router }) => {
</div>
<div className="hidden md:flex items-center justify-end md:flex-1 lg:w-0 space-x-4">
{menu.map((item) => (
<Link
<Link legacyBehavior
key={item.name}
href={item.href}
>
Expand Down Expand Up @@ -98,7 +96,7 @@ const Navbar = ({ router }) => {
<div className="mt-6">
<nav className="grid gap-y-2">
{menu.map((item) => (
<Link
<Link legacyBehavior
key={item.name}
href={item.href}
>
Expand Down
1 change: 0 additions & 1 deletion components/layout/BaseLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { MetaProps } from '@/types/layout';
import Head from '@/components/common/Head';
import NavigationBar from '@/components/common/NavigationBar';
import Footer from '@/components/common/Footer';

type LayoutProps = {
Expand Down
8 changes: 3 additions & 5 deletions components/pages/blog/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const BlogCard = ({ body, slug }: BlogType): JSX.Element => {
const { title, date, image, description } = body;

return (
<Link href={`/blog/` + slug}>
<Link legacyBehavior href={`/blog/` + slug}>
<a className="w-full transform duration-300 border-gray-200 dark:border-gray-200 shadow-md overflow-hidden rounded-2xl hover:-translate-y-1 active:translate-y-0 active:scale-95">
<div className="flex flex-col h-full p-4 dark:bg-sky-500/5 bg-grey/10">
<div className="flex rounded-lg overflow-hidden relative mb-3">
Expand All @@ -17,13 +17,11 @@ const BlogCard = ({ body, slug }: BlogType): JSX.Element => {
</p>
</div>
</div>
<div className="w-full">
<div className="w-full h-[200px]">
<Image
src={image ? image : "/images/no-thumbnail.png"}
alt={title}
width="712"
height="360"
layout="responsive"
fill
placeholder="blur"
blurDataURL={image ? image : "/images/no-thumbnail.png"}
priority
Expand Down
19 changes: 0 additions & 19 deletions components/pages/works/ProjectList/constants/index.ts

This file was deleted.

16 changes: 9 additions & 7 deletions components/pages/works/ProjectList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import React, { memo } from "react";
import { AiOutlineLink } from "react-icons/ai";
import { PROJECT as dataProjects } from "@/components/pages/works/ProjectList/constants";
import Image from "@/components/pages/works/Image";

type ProjectType = typeof dataProjects[0];

interface ProjectsProps {
offset?: number;
selectedTag?: string;
dataProjects?: any;
}

function Projects({ offset, selectedTag }: ProjectsProps) {
function Projects({ offset, selectedTag, dataProjects }: ProjectsProps) {
type ProjectType = typeof dataProjects[0];
const fileteredProjects = (): ProjectType[] => {
if (selectedTag) {
return dataProjects.filter(({ tags }) => tags?.includes(selectedTag)).slice(0, offset || dataProjects.length);
Expand All @@ -20,6 +19,7 @@ function Projects({ offset, selectedTag }: ProjectsProps) {
};

return (

<ul className="flex flex-col gap-8 sm:gap-10">
{fileteredProjects().map(({
id,
Expand All @@ -32,7 +32,7 @@ function Projects({ offset, selectedTag }: ProjectsProps) {
<li key={id} className="flex flex-col-reverse sm:flex-row justify-between gap-4 ">
<div className="w-full flex-1 max-w-[450px] sm:flex sm:flex-col sm:justify-between sm:items-start">
<div>
<a
<a
href={url}
className="text-2xl sm:text-3xl md:text-4xl font-display text-black-100 mb-4 inline-block underline hover:no-underline underline-offset-1"
title={`Open ${name} in new tab`}
Expand All @@ -56,11 +56,11 @@ function Projects({ offset, selectedTag }: ProjectsProps) {
</div>

<div id="tags" className="flex items-center flex-wrap gap-2">
{tags && tags.map((tag) => {
{tags && tags.map((tag, idx) => {
const isSelected = selectedTag && selectedTag.toLowerCase() === tag.toLowerCase();

return (
<span key={tag} className={`py-2 px-4 select-none rounded bg-primary/5 text-sm font-medium ${isSelected ? "active" : ""}`}>
<span key={idx} className={`py-2 px-4 select-none rounded bg-primary/5 text-sm font-medium ${isSelected ? "active" : ""}`}>
{tag}
</span>
);
Expand Down Expand Up @@ -89,6 +89,8 @@ function Projects({ offset, selectedTag }: ProjectsProps) {
</li>
))}
</ul>


);
}

Expand Down
65 changes: 65 additions & 0 deletions components/pages/works/SkeletonList/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React, { useState, useEffect } from "react";
import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'
import 'react-loading-skeleton/dist/skeleton.css'
import { useTheme } from 'next-themes'

interface SkeletonProps {
visible: boolean;
}

const SkeletonCard = ({ visible }: SkeletonProps): JSX.Element => {
return (
<Theme>
<ul className="flex flex-col gap-8 sm:gap-10">
{[...Array(2)].map((x) => (
<li key={x} className={`${visible ? "flex" : "hidden"} flex-col-reverse sm:flex-row justify-between gap-4 `}>
<div className="w-full flex-1 max-w-[450px] sm:flex sm:flex-col sm:justify-between sm:items-start ">
<div className="w-[350px]">
<Skeleton height={50} width={200} />
<div className="space-y-2" >
<Skeleton height={20} width={350} count={3} />
</div>
<Skeleton height={40} width={250} />
</div>
<div id="tags" className="flex items-center flex-wrap gap-2">
<Skeleton height={35} width={100} />
<Skeleton height={35} width={115} />
<Skeleton height={35} width={90} />
</div>
</div>
<div className="w-full flex-1 sm:max-w-[350px] mb-4 sm:mb-0 rounded overflow-hidden relative group">
<Skeleton className="w-full h-52 sm:w-[350px] sm:h-[350px] rounded-lg bg-white " />
</div>
</li>
))}
</ul>
</Theme>
);
};

const Theme = ({ children }) => {
const [mounted, setMounted] = useState(false)
const { theme } = useTheme()
useEffect(() => setMounted(true), [])

if (!mounted) return null

return (
<div>
{theme === "dark" ?
<div>
<SkeletonTheme baseColor='#202020' highlightColor="#444" >
{children}
</SkeletonTheme>
</div>
:
<div>
{children}
</div>
}
</div>
);
};

export default SkeletonCard;

17 changes: 17 additions & 0 deletions lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { PrismaClient } from '@prisma/client';

let prisma: PrismaClient;

declare global {
var prisma: PrismaClient | undefined;
}

if (process.env.NODE_ENV === 'production') {
prisma = new PrismaClient();
} else {
if (!global.prisma) {
global.prisma = new PrismaClient();
}
prisma = global.prisma;
}
export default prisma;
11 changes: 10 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async redirects() {
return [
{
source: '/cv',
destination: process.env.NEXT_PUBLIC_RESUME_URL || '/',
basePath: false,
permanent: false,
},
]
},
reactStrictMode: true,
swcMinify: true,
}
Expand Down
Loading

1 comment on commit c7d4e6c

@vercel
Copy link

@vercel vercel bot commented on c7d4e6c Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.