Skip to content

Commit

Permalink
update with eslint-plugin-perfectionist
Browse files Browse the repository at this point in the history
  • Loading branch information
firehawk89 committed Jan 24, 2024
1 parent de13982 commit 588bed3
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 50 deletions.
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
tailwindcss: {},
},
}
4 changes: 2 additions & 2 deletions src/app/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Raleway } from 'next/font/google'

export const raleway = Raleway({
subsets: ['latin'],
display: 'swap',
weight: ['400', '500', '600', '700'],
subsets: ['latin'],
variable: '--font-text',
weight: ['400', '500', '600', '700'],
})
7 changes: 4 additions & 3 deletions src/components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FC } from 'react'
import { classnames } from '@/utils'
import Menu from '@/components/header/menu/menu'
import MenuItem from './menu/menu-item'
import { classnames } from '@/utils'
import { FC } from 'react'

import MenuIcon from './menu/menu-icon/menu-icon'
import MenuItem from './menu/menu-item'

type HeaderProps = {
className?: string
Expand Down
3 changes: 2 additions & 1 deletion src/components/header/menu/menu-icon/menu-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client'

import { FC, useContext } from 'react'
import HeaderContext from '@/store/header-context'
import { classnames } from '@/utils'
import { FC, useContext } from 'react'

import MenuIconBar from './menu-icon-bar'

type MenuIconProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/menu/menu-item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, ReactNode } from 'react'
import Link from 'next/link'
import { FC, ReactNode } from 'react'

type MenuItemProps = {
children: ReactNode
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/menu/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import { FC, ReactNode, useContext } from 'react'
import HeaderContext from '@/store/header-context'
import { classnames } from '@/utils'
import { FC, ReactNode, useContext } from 'react'

type MenuProps = {
children: ReactNode
Expand Down
9 changes: 5 additions & 4 deletions src/components/pages/hero.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { FC } from 'react'
import { classnames } from '@/utils'
import Content from '@/components/ui/content'
import styles from './hero.module.css'
import Button from '@/components/ui/button'
import Content from '@/components/ui/content'
import Socials from '@/components/ui/socials/socials'
import { classnames } from '@/utils'
import { FC } from 'react'

import styles from './hero.module.css'

const Hero: FC = () => {
return (
Expand Down
16 changes: 8 additions & 8 deletions src/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { FC, ReactNode } from 'react'
import { classnames } from '@/utils'
import Link from 'next/link'
import { FC, ReactNode } from 'react'

type ButtonVariant = 'solid' | 'outline'
type ButtonVariant = 'outline' | 'solid'

type ButtonProps = {
children: ReactNode
className?: string
type?: 'button' | 'submit' | 'reset'
disabled?: boolean
variant?: ButtonVariant
href?: string
onClick?: () => void
type?: 'button' | 'reset' | 'submit'
variant?: ButtonVariant
}

const buttonStyles: Record<ButtonVariant, string> = {
solid: 'text-light bg-accent md:hover:bg-opacity-80',
outline: 'text-accent bg-transparent md:hover:text-light md:hover:bg-accent',
solid: 'text-light bg-accent md:hover:bg-opacity-80',
}

const Button: FC<ButtonProps> = ({
children,
className,
type = 'button',
disabled,
variant = 'solid',
href,
onClick,
type = 'button',
variant = 'solid',
}) => {
return (
<>
Expand All @@ -48,9 +48,9 @@ const Button: FC<ButtonProps> = ({
buttonStyles[variant],
className
)}
type={type}
disabled={disabled}
onClick={onClick}
type={type}
>
{children}
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/socials/socials-item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FC, ReactNode } from 'react'
import Link from 'next/link'
import { FC, ReactNode } from 'react'

type SocialsItemProps = {
children: ReactNode
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/socials/socials.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC } from 'react'
import SocialsItem from '@/components/ui/socials/socials-item'
import { classnames } from '@/utils'
import { FC } from 'react'
import { FaGithub, FaLinkedin } from 'react-icons/fa'
import SocialsItem from '@/components/ui/socials/socials-item'

type SocialsProps = {
className?: string
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-media-query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { useState, useCallback, useEffect } from 'react'
import { useCallback, useEffect, useState } from 'react'

interface MatchMediaChangeEvent extends Event {
matches: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/store/providers/header-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'

import { FC, ReactNode, useCallback, useEffect, useState } from 'react'
import useMediaQuery from '@/hooks/use-media-query'
import HeaderContext from '@/store/header-context'
import { MOBILE_BREAKPOINT } from '@/utils'
import { FC, ReactNode, useCallback, useEffect, useState } from 'react'

type HeaderProviderProps = {
children: ReactNode
Expand Down
1 change: 1 addition & 0 deletions src/store/providers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FC, ReactNode } from 'react'

import HeaderProvider from './header-provider'

type ProvidersProps = { children: ReactNode }
Expand Down
2 changes: 1 addition & 1 deletion src/utils/misc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const classnames = (
...names: (string | boolean | null | number | undefined)[]
...names: (boolean | null | number | string | undefined)[]
): string => {
const validNames = names.filter((n): n is string => typeof n === 'string')
return validNames.join(' ')
Expand Down
46 changes: 23 additions & 23 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,28 @@ const config: Config = {
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
],
plugins: [],
theme: {
extend: {
fontFamily: {
text: 'var(--font-text)',
},
colors: {
light: '#fff',
dark: '#1a1a1a',
ghost: '#f7f7ff',
accent: '#ff5100',
},
boxShadow: { blur: '0 4px 30px rgba(0, 0, 0, 0.1);' },
animation: {
'top-down': 'top-down 0.5s ease forwards',
'top-up': 'top-up 0.5s ease forwards',
'bottom-down': 'bottom-down 0.5s ease forwards',
'bottom-up': 'bottom-up 0.5s ease forwards',
scaled: 'scaled 0.5s ease forwards',
'scaled-none': 'scaled-none 0.5s ease forwards',
'top-down': 'top-down 0.5s ease forwards',
'top-up': 'top-up 0.5s ease forwards',
},
boxShadow: { blur: '0 4px 30px rgba(0, 0, 0, 0.1);' },
colors: {
accent: '#ff5100',
dark: '#1a1a1a',
ghost: '#f7f7ff',
light: '#fff',
},
fontFamily: {
text: 'var(--font-text)',
},
keyframes: {
'top-down': {
'0%': { top: '0', transform: 'rotate(0)' },
'50%': { top: '10px', transform: 'rotate(0)' },
'100%': { top: '10px', transform: 'rotate(45deg)' },
},
'top-up': {
'0%': { top: '10px', transform: 'rotate(45deg)' },
'50%': { top: '10px', transform: 'rotate(0)' },
'100%': { top: '0', transform: 'rotate(0)' },
},
'bottom-down': {
'0%': { bottom: '10px', transform: 'rotate(135deg)' },
'50%': { bottom: '10px', transform: 'rotate(0)' },
Expand All @@ -56,10 +47,19 @@ const config: Config = {
'50%': { transform: 'scale(0)' },
'100%': { transform: 'scale(0)' },
},
'top-down': {
'0%': { top: '0', transform: 'rotate(0)' },
'50%': { top: '10px', transform: 'rotate(0)' },
'100%': { top: '10px', transform: 'rotate(45deg)' },
},
'top-up': {
'0%': { top: '10px', transform: 'rotate(45deg)' },
'50%': { top: '10px', transform: 'rotate(0)' },
'100%': { top: '0', transform: 'rotate(0)' },
},
},
},
},
plugins: [],
}

export default config

0 comments on commit 588bed3

Please sign in to comment.