diff --git a/components/Icon.tsx b/components/Icon.tsx index 9694df1..6d4fcf2 100644 --- a/components/Icon.tsx +++ b/components/Icon.tsx @@ -1,6 +1,6 @@ -import Link from "next/link"; -import toast from "react-hot-toast"; -import copy from "copy-to-clipboard"; +import Link from 'next/link'; +import toast from 'react-hot-toast'; +import copy from 'copy-to-clipboard'; type Icon = { children: any; @@ -10,24 +10,23 @@ type Icon = { const notify = () => { toast.remove(), - toast.success("Copied to clipboard", { + toast.success('Copied to clipboard', { style: { - background: "#0f1012", - color: "#fff", - fontSize: "1em", + background: '#0f1012', + color: '#fff', + fontSize: '1em', }, }); }; -export const Icon = ({ children, reference, copyValue }: Icon) => { +export const Icon = ({children, reference, copyValue}: Icon) => { if (copyValue) { return ( { notify(), copy(reference); - }} - > + }}> {children} ); @@ -35,7 +34,7 @@ export const Icon = ({ children, reference, copyValue }: Icon) => { return ( - + {children} diff --git a/components/data/socials.ts b/components/data/socials.ts index f85d26c..90ee0e3 100644 --- a/components/data/socials.ts +++ b/components/data/socials.ts @@ -1,11 +1,11 @@ -import { IconType } from "react-icons/lib"; +import {IconType} from 'react-icons/lib'; import { FaDiscord, FaEnvelope, FaGithub, FaInstagram, FaSteam, -} from "react-icons/fa"; +} from 'react-icons/fa'; type Socials = { id: number; @@ -17,28 +17,28 @@ type Socials = { export const socials: Array = [ { id: 1, - ref: "https://github.com/skidoodle", + ref: 'https://github.com/skidoodle', icon: FaGithub, }, { id: 2, - ref: "https://steamcommunity.com/id/_albert", + ref: 'https://steamcommunity.com/id/_albert', icon: FaSteam, }, { id: 3, - ref: "contact@albert.lol", + ref: 'contact@albert.lol', icon: FaEnvelope, copyValue: true, }, { id: 4, - ref: "https://www.instagram.com/albertadam_/", + ref: 'https://www.instagram.com/albertadam_/', icon: FaInstagram, }, { id: 5, - ref: "albert#8838", + ref: 'albert#8838', icon: FaDiscord, copyValue: true, }, diff --git a/next.config.js b/next.config.js index cc05d08..4f4712b 100644 --- a/next.config.js +++ b/next.config.js @@ -1,39 +1,3 @@ -const nextSafe = require("next-safe"); - -module.exports = { - async headers() { - return [ - { - source: "/:path*", - headers: nextSafe({ - contentTypeOptions: "nosniff", - contentSecurityPolicy: { - "base-uri": "'none'", - "child-src": "'none'", - "connect-src": "'self'", - "default-src": "'self'", - "font-src": "'self'", - "frame-src": "'none'", - "img-src": "'self'", - "frame-ancestors": "'none'", - "manifest-src": "'self'", - "media-src": "'self'", - "object-src": "'none'", - "prefetch-src": "'self'", - "script-src": "'self'", - "style-src": "'self'", - "worker-src": "'self'", - "form-action": "'self'", - reportOnly: false, - }, - referrerPolicy: "same-origin", - xssProtection: "1; mode=block", - }), - }, - ]; - }, -}; - /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, diff --git a/package.json b/package.json index bc15dd2..dd8e29a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "aws-sdk": "^2.1237.0", "axios": "^1.1.3", "next": "12.3.1", - "next-safe": "^3.2.1", "react": "18.2.0", "react-dom": "18.2.0", "react-fade-in": "^2.0.1", diff --git a/pages/_app.tsx b/pages/_app.tsx index 1300379..63b3a2b 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,9 +1,9 @@ -import "styles/globals.scss"; -import Head from "next/head"; +import 'styles/globals.scss'; +import Head from 'next/head'; -import { AppProps } from "next/app"; +import {AppProps} from 'next/app'; -export default function ({ Component, pageProps }: AppProps) { +export default function ({Component, pageProps}: AppProps) { return ( <> diff --git a/pages/_document.tsx b/pages/_document.tsx index 774e697..efcde3d 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,17 +1,17 @@ -import Document, { Html, Head, Main, NextScript } from "next/document"; +import Document, {Html, Head, Main, NextScript} from 'next/document'; class AppDocument extends Document { render() { return ( - + - - - - - - - + + + + + + +
diff --git a/pages/api/s3.ts b/pages/api/s3.ts index f17817b..030f123 100644 --- a/pages/api/s3.ts +++ b/pages/api/s3.ts @@ -1,5 +1,4 @@ import { NextApiRequest, NextApiResponse } from "next"; - import aws from "aws-sdk"; const { BUCKET, ACCESS_KEY, SECRET_KEY, ENDPOINT, REGION } = process.env; @@ -40,7 +39,7 @@ export default async function (req: NextApiRequest, res: NextApiResponse) { } } res.setHeader( - "Cache-Control", + 'Cache-Control', "public, s-maxage=10, stale-while-revalidate=59" ); res.json({ object: objects, size: Number(size.toFixed(2)) }); diff --git a/pages/index.tsx b/pages/index.tsx index ca7436d..ee78611 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,74 +1,73 @@ -import Image from "next/image"; -import Link from "next/link"; -import React from "react"; -import useSWR from "swr"; -import FadeIn from "react-fade-in"; +import Image from 'next/image'; +import Link from 'next/link'; +import React from 'react'; +import useSWR from 'swr'; +import FadeIn from 'react-fade-in'; -import { socials } from "components/data/socials"; -import { Icon } from "components/Icon"; -import { Toaster } from "react-hot-toast"; -import { FaSpotify } from "react-icons/fa"; +import {socials} from 'components/data/socials'; +import {Icon} from 'components/Icon'; +import {Toaster} from 'react-hot-toast'; +import {FaSpotify} from 'react-icons/fa'; -import profilePic from "public/profile.webp"; +import profilePic from 'public/profile.webp'; export const fetcher = (url: RequestInfo) => fetch(url).then((r) => r.json()); export default function () { - var { data: spotify } = useSWR("/api/spotify", fetcher, { + var {data: spotify} = useSWR('/api/spotify', fetcher, { refreshInterval: 3000, - fallbackData: "loading", + fallbackData: 'loading', }); return ( -
-
+
+
Profile Picture -

albert

+

albert

-

+

{Math.floor( - (new Date().getTime() - new Date("2004-07-22").getTime()) / + (new Date().getTime() - new Date('2004-07-22').getTime()) / (1000 * 60 * 60 * 24 * 365.25) )} - yrs old system administrator and + yrs old system administrator and student from Hungary

-
+
-
- -

+

+ +

Listening to {spotify.song ? ( - - {" "} + + {' '} {spotify.song.title} ) : ( - nothing + nothing )}

-
+
{socials.map((social) => ( + copyValue={social.copyValue}> {React.createElement(social.icon)} ))} diff --git a/tailwind.config.js b/tailwind.config.js index 4842997..fe5a7c3 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,8 +1,8 @@ /** @type {import('tailwindcss').Config} */ module.exports = { content: [ - "./pages/**/*.{js,ts,jsx,tsx}", - "./components/**/*.{js,ts,jsx,tsx}", + './pages/**/*.{js,ts,jsx,tsx}', + './components/**/*.{js,ts,jsx,tsx}', ], theme: { extend: {}, diff --git a/yarn.lock b/yarn.lock index d7a095a..5127dee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -765,11 +765,6 @@ nanoid@^3.3.4: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== -next-safe@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/next-safe/-/next-safe-3.2.1.tgz#76bb6deb2b11a39318e5b962a6da4e57584bf77f" - integrity sha512-2BBbnendVIlbUjrvV/N6cotuba71i2IIczo0dqmpZu9oSl2PlN6hYML22fidcqXZILwghyXULIy4lxyAgPz+Xg== - next@12.3.1: version "12.3.1" resolved "https://registry.yarnpkg.com/next/-/next-12.3.1.tgz#127b825ad2207faf869b33393ec8c75fe61e50f1"