Skip to content

Commit 9af4dd3

Browse files
committed
fixed, stuff
1 parent 0cd32d4 commit 9af4dd3

File tree

13 files changed

+166
-205
lines changed

13 files changed

+166
-205
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ yarn-error.log*
4444
.vercel
4545

4646
sw.js.map
47+
48+
.vercel

next.config.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
/** @type {import('next').NextConfig} */
2-
31
const withPWA = require("next-pwa");
42
const HoneybadgerSourceMapPlugin = require("@honeybadger-io/webpack");
5-
const { execSync } = require("child_process");
63

74
const {
85
HONEYBADGER_API_KEY,
96
NODE_ENV,
107
} = process.env;
118

12-
const nextConfig = withPWA({
13-
experimental: { images: { allowFutureImage: true } },
14-
env: {
15-
HONEYBADGER_API_KEY
16-
},
9+
module.exports = withPWA({
10+
dest: "public",
11+
register: true,
12+
skipWaiting: true,
13+
disable: process.env.NODE_ENV === "development",
1714
webpack: (config, options) => {
1815
// When all the Honeybadger configuration env variables are
1916
// available/configured The Honeybadger webpack plugin gets pushed to the
@@ -40,6 +37,4 @@ const nextConfig = withPWA({
4037

4138
return config;
4239
},
43-
});
44-
45-
module.exports = nextConfig;
40+
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"private": false,
55
"scripts": {
66
"dev": "next dev",
7-
"build": "prisma generate --data-proxy && next build",
7+
"build": "prisma generate && next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"postinstall": "prisma generate --data-proxy"
10+
"postinstall": "prisma generate"
1111
},
1212
"dependencies": {
1313
"@emotion/react": "^11.9.3",

src/components/Create/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ function Create({ publish }: { publish: (image: File) => void }) {
851851
</svg>
852852
</div>
853853
)}
854-
{googleSearchResults.map((result) => (
854+
{googleSearchResults?.map((result) => (
855855
<button
856856
key={result}
857857
className={`card p-1 border ${
@@ -897,7 +897,7 @@ function Create({ publish }: { publish: (image: File) => void }) {
897897
</div>
898898
</div>
899899

900-
{tPlates.map((template, index) => {
900+
{tPlates?.map((template, index) => {
901901
return (
902902
<button
903903
key={index}
@@ -997,7 +997,7 @@ function Create({ publish }: { publish: (image: File) => void }) {
997997
</div>
998998
</div>
999999

1000-
{shapes.map((shape, index) => {
1000+
{shapes?.map((shape, index) => {
10011001
return (
10021002
<button
10031003
key={index}

src/components/Leaderboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function Leaderboard({ rank }: { rank: number }) {
9797
</span>
9898
</span>
9999
<div className="flex flex-col h-48 py-2 overflow-y-scroll scrollbar-thin xl:h-72 2xl:h-96 ">
100-
{data.map((user, index) => (
100+
{data?.map((user, index) => (
101101
<LeaderboardIcon
102102
key={index}
103103
rank={index + 1}

src/components/Notification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const Notifications = () => {
7474
{unseens > 0 && <div className="absolute top-0 -left-2 h-2 w-2 rounded-full bg-red-600" />}
7575

7676
<div className='flex mt-2 flex-col gap-2'>
77-
{notifications.map((notif, index) => {
77+
{notifications?.map((notif, index) => {
7878

7979
if (notif.cta.data.url) {
8080

src/components/Tabs.tsx

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
import React from 'react';
2-
3-
interface Props {
4-
items: Array<{
5-
name: string;
6-
component: React.ReactNode;
7-
disabled?: boolean;
8-
}>;
9-
activeTab?: (arg0: number) => void;
10-
extendTailwind?: {
11-
tabButtons?: {
12-
list?: string;
13-
each?: string;
14-
active?: string;
15-
};
16-
tabContent?: string;
17-
parent?: string;
18-
};
19-
}
20-
21-
const Tabs = ({ items, activeTab, extendTailwind }: Props) => {
22-
23-
const [active, setActive] = React.useState<number>(0);
24-
activeTab?.(active);
25-
26-
return (
27-
<div className={`${extendTailwind?.parent}`}>
28-
<div className={`flex gap-1 w-full ${extendTailwind?.tabButtons?.list}`}>
29-
{items.map((item, index) => {
30-
if (item.disabled) {
31-
return (
32-
<button key={index} disabled={item.disabled} data-tip="You need to login to upload to twitter" onClick={() => {
33-
setActive(index);
34-
}} className={`disabled:text-gray-600 disabled:hover:bg-transparent ${extendTailwind?.tabButtons?.each} ${index === active && extendTailwind?.tabButtons?.active} text-white px-5 rounded py-3 ${index === active ? 'bg-blue-500' : 'text-gray-400 hover:bg-blue-500 hover:text-white transition'}`}>
35-
{item.name}
36-
</button>
37-
);
38-
}
39-
return (
40-
<button key={index} disabled={item.disabled} onClick={() => {
41-
setActive(index);
42-
}} className={`disabled:text-gray-600 disabled:hover:bg-transparent ${extendTailwind?.tabButtons?.each} ${index === active && extendTailwind?.tabButtons?.active} text-white px-5 rounded py-3 ${index === active ? 'bg-blue-500' : 'text-gray-400 hover:bg-blue-500 hover:text-white transition'}`}>
43-
{item.name}
44-
</button>
45-
);
46-
})}
47-
</div>
48-
<div className={`${extendTailwind?.tabContent}`}>
49-
{items[active]?.component}
50-
</div>
51-
</div>
52-
)
53-
}
54-
55-
export default Tabs;
1+
import React from 'react';
2+
3+
interface Props {
4+
items: Array<{
5+
name: string;
6+
component: React.ReactNode;
7+
disabled?: boolean;
8+
}>;
9+
activeTab?: (arg0: number) => void;
10+
extendTailwind?: {
11+
tabButtons?: {
12+
list?: string;
13+
each?: string;
14+
active?: string;
15+
};
16+
tabContent?: string;
17+
parent?: string;
18+
};
19+
}
20+
21+
const Tabs = ({ items, activeTab, extendTailwind }: Props) => {
22+
23+
const [active, setActive] = React.useState<number>(0);
24+
activeTab?.(active);
25+
26+
return (
27+
<div className={`${extendTailwind?.parent}`}>
28+
<div className={`flex gap-1 w-full ${extendTailwind?.tabButtons?.list}`}>
29+
{items?.map((item, index) => {
30+
if (item.disabled) {
31+
return (
32+
<button key={index} disabled={item.disabled} data-tip="You need to login to upload to twitter" onClick={() => {
33+
setActive(index);
34+
}} className={`disabled:text-gray-600 disabled:hover:bg-transparent ${extendTailwind?.tabButtons?.each} ${index === active && extendTailwind?.tabButtons?.active} text-white px-5 rounded py-3 ${index === active ? 'bg-blue-500' : 'text-gray-400 hover:bg-blue-500 hover:text-white transition'}`}>
35+
{item.name}
36+
</button>
37+
);
38+
}
39+
return (
40+
<button key={index} disabled={item.disabled} onClick={() => {
41+
setActive(index);
42+
}} className={`disabled:text-gray-600 disabled:hover:bg-transparent ${extendTailwind?.tabButtons?.each} ${index === active && extendTailwind?.tabButtons?.active} text-white px-5 rounded py-3 ${index === active ? 'bg-blue-500' : 'text-gray-400 hover:bg-blue-500 hover:text-white transition'}`}>
43+
{item.name}
44+
</button>
45+
);
46+
})}
47+
</div>
48+
<div className={`${extendTailwind?.tabContent}`}>
49+
{items[active]?.component}
50+
</div>
51+
</div>
52+
)
53+
}
54+
55+
export default Tabs;

src/components/TopBar.tsx

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
1-
import darkModeAtom from "~/atoms/darkmode";
2-
import Image from "next/image";
3-
import { useAtom } from "jotai";
4-
import logo_white from "~/../public/logo-white.png";
5-
import logo_black from "~/../public/logo-black.png";
6-
import { useRouter } from "next/router";
7-
import { BellIcon } from "@heroicons/react/outline";
8-
import { useNotifs } from '~/contexts/NotifyContext';
9-
import { useSession } from "next-auth/react";
10-
11-
function TopBar() {
12-
13-
const [darkMode, setDarkMode] = useAtom(darkModeAtom);
14-
const router = useRouter();
15-
const { unseens } = useNotifs();
16-
17-
const { data: session } = useSession();
18-
19-
return (
20-
<div className="z-auto bg-white border-b-2 dark:bg-[#242424] dark:shadow-md dark:border-none">
21-
<div className="flex items-center justify-between h-20 mx-5 md:h-16">
22-
<button onClick={(e) => router.push("/")}>
23-
<div className="flex w-full">
24-
<div className="flex text-lg justify-center items-center font-bold cursor-pointer md:text-2xl font-trispace text-slate-800 dark:text-white">
25-
<Image
26-
alt="Logo of LMFAO.tech"
27-
src={darkMode ? logo_white : logo_black}
28-
width={36}
29-
height={36}
30-
/>
31-
<div className="mx-2">
32-
LMFAO
33-
<span className="text-sm font-semibold text-slate-600 dark:text-slate-300">
34-
.tech
35-
</span>
36-
</div>
37-
</div>
38-
</div>
39-
</button>
40-
41-
{session && (
42-
<button onClick={() => router.push("/notifications")} className="relative ml-auto w-9 h-9 bg-slate-200 dark:text-white dark:bg-slate-700 p-2 rounded-md">
43-
{unseens > 0 && <div className="text-[10px] rounded-full bg-rose-400 absolute -top-1 flex justify-center items-center -right-1 w-4 h-4">{unseens > 9 ? "9+" : unseens}</div>}
44-
<BellIcon className="w-5 h-5" />
45-
</button>
46-
)}
47-
48-
<button
49-
className="flex items-center p-2 m-3 rounded-md cursor-pointer bg-slate-200 dark:text-white dark:bg-slate-700 "
50-
onClick={(e) => setDarkMode(!darkMode)}
51-
>
52-
{!darkMode ? (
53-
<svg
54-
xmlns="http://www.w3.org/2000/svg"
55-
className="w-5 h-5"
56-
fill="none"
57-
viewBox="0 0 24 24"
58-
stroke="currentColor"
59-
strokeWidth={2}
60-
>
61-
<path
62-
strokeLinecap="round"
63-
strokeLinejoin="round"
64-
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"
65-
/>
66-
</svg>
67-
) : (
68-
<svg
69-
xmlns="http://www.w3.org/2000/svg"
70-
className="w-5 h-5"
71-
fill="none"
72-
viewBox="0 0 24 24"
73-
stroke="currentColor"
74-
strokeWidth={2}
75-
>
76-
<path
77-
strokeLinecap="round"
78-
strokeLinejoin="round"
79-
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"
80-
/>
81-
</svg>
82-
)}
83-
</button>
84-
</div>
85-
</div>
86-
);
87-
}
88-
89-
export default TopBar;
1+
import darkModeAtom from "~/atoms/darkmode";
2+
import Image from "next/image";
3+
import { useAtom } from "jotai";
4+
import logo_white from "~/../public/logo-white.png";
5+
import logo_black from "~/../public/logo-black.png";
6+
import { useRouter } from "next/router";
7+
import { BellIcon } from "@heroicons/react/outline";
8+
import { useNotifs } from '~/contexts/NotifyContext';
9+
import { useSession } from "next-auth/react";
10+
11+
function TopBar() {
12+
13+
const [darkMode, setDarkMode] = useAtom(darkModeAtom);
14+
const router = useRouter();
15+
const { unseens } = useNotifs();
16+
17+
const { data: session } = useSession();
18+
19+
return (
20+
<div className="z-auto bg-white border-b-2 dark:bg-[#242424] dark:shadow-md dark:border-none">
21+
<div className="flex items-center justify-between h-20 mx-5 md:h-16">
22+
<button onClick={(e) => router.push("/")}>
23+
<div className="flex w-full">
24+
<div className="flex text-lg justify-center items-center font-bold cursor-pointer md:text-2xl font-trispace text-slate-800 dark:text-white">
25+
<Image
26+
alt="Logo of LMFAO.tech"
27+
src={darkMode ? logo_white : logo_black}
28+
width={36}
29+
height={36}
30+
/>
31+
<div className="mx-2">
32+
LMFAO
33+
<span className="text-sm font-semibold text-slate-600 dark:text-slate-300">
34+
.tech
35+
</span>
36+
</div>
37+
</div>
38+
</div>
39+
</button>
40+
41+
{/* {session && (
42+
<button onClick={() => router.push("/notifications")} className="relative ml-auto w-9 h-9 bg-slate-200 dark:text-white dark:bg-slate-700 p-2 rounded-md">
43+
{unseens > 0 && <div className="text-[10px] rounded-full bg-rose-400 absolute -top-1 flex justify-center items-center -right-1 w-4 h-4">{unseens > 9 ? "9+" : unseens}</div>}
44+
<BellIcon className="w-5 h-5" />
45+
</button>
46+
)} */}
47+
48+
<button
49+
className="flex items-center p-2 m-3 rounded-md cursor-pointer bg-slate-200 dark:text-white dark:bg-slate-700 "
50+
onClick={(e) => setDarkMode(!darkMode)}
51+
>
52+
{!darkMode ? (
53+
<svg
54+
xmlns="http://www.w3.org/2000/svg"
55+
className="w-5 h-5"
56+
fill="none"
57+
viewBox="0 0 24 24"
58+
stroke="currentColor"
59+
strokeWidth={2}
60+
>
61+
<path
62+
strokeLinecap="round"
63+
strokeLinejoin="round"
64+
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"
65+
/>
66+
</svg>
67+
) : (
68+
<svg
69+
xmlns="http://www.w3.org/2000/svg"
70+
className="w-5 h-5"
71+
fill="none"
72+
viewBox="0 0 24 24"
73+
stroke="currentColor"
74+
strokeWidth={2}
75+
>
76+
<path
77+
strokeLinecap="round"
78+
strokeLinejoin="round"
79+
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"
80+
/>
81+
</svg>
82+
)}
83+
</button>
84+
</div>
85+
</div>
86+
);
87+
}
88+
89+
export default TopBar;

0 commit comments

Comments
 (0)