Skip to content

Commit 5d04d55

Browse files
committed
Added @modal slot
1 parent 61c83ff commit 5d04d55

35 files changed

Lines changed: 330 additions & 337 deletions

‎public/svg/vercel.svg‎

Lines changed: 1 addition & 1 deletion
Loading

‎src/app/@modal/about/page.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function ModalPage() {
2+
return null;
3+
}

‎src/app/@modal/copy/page.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function ModalPage() {
2+
return null;
3+
}

‎src/app/@modal/default.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function DefaultModal() {
2+
return null;
3+
}

‎src/app/@modal/help/page.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function ModalPage() {
2+
return null;
3+
}

‎src/app/@modal/page.tsx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use client";
2+
3+
export default function ModalPage() {
4+
// return (
5+
// <div className="root-container">
6+
// <BackgroundView />
7+
// <Clock />
8+
// <Menu />
9+
// {children}
10+
// </div>
11+
// );
12+
return null;
13+
}

‎src/app/@modal/secrets/page.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function ModalPage() {
2+
return null;
3+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
"use client";
2+
13
import React, { useEffect, useRef } from "react";
24
import useMobileDetect from "@hooks/useMobileDetect";
35
import { AchievementId, useSecret } from "@context/SecretContext";
6+
import { ModalHeader, ModalClose } from "@components/modal/modal";
47

58
function isMultiLine(text: string | undefined) {
69
if (text === undefined) return false;
@@ -104,3 +107,16 @@ export const AboutView = () => {
104107
</div>
105108
);
106109
};
110+
111+
export default function AboutPage() {
112+
113+
return (
114+
<>
115+
<ModalHeader title="About" />
116+
<div className=" w-full h-[70%]">
117+
<AboutView />
118+
</div>
119+
<ModalClose />
120+
</>
121+
);
122+
}

‎src/app/boot/page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import React, { useEffect } from "react";
44
import { useRouter } from "next/navigation";
55
//import Background from '@components/background/background';
6-
import WebGlBackground from '@components/background/webGlBackground';
7-
import BackgroundView from "@components/background/BackgroundView";
6+
import WebGlBackground from '@src/components/background/webgl-background';
7+
import BackgroundView from "@src/components/background/background-view";
88
import { useBoot } from '@context/BootContext';
99

1010
export default function BootPage() {
Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
"use client";
22

3-
import React from "react";
3+
import React, { useEffect } from "react";
44
import { faCheckCircle, faCopy, faQuestionCircle } from "@fortawesome/free-solid-svg-icons";
55
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
66
import { useState } from "react";
77
import { useSnackbar } from "@context/SnackbarContext";
8-
import "./copy.css";
8+
import { Modal } from "@components/modal/modal";
9+
import { useRouter, useSearchParams } from "next/navigation";
910

1011
export interface CopyViewProps
1112
{
12-
title: string;
13+
name: string;
1314
description?: string;
1415
value: string;
1516
}
1617

17-
export const CopyView = ({ title, description, value }: CopyViewProps) => {
18+
export const CopyView = ({ name, description, value }: CopyViewProps) => {
1819

1920
const [copied, setCopied] = useState(false);
2021
const [hover, setHover] = useState(false);
@@ -27,7 +28,7 @@ export const CopyView = ({ title, description, value }: CopyViewProps) => {
2728
<div className="relative my-auto">
2829
<div className="flex mb-2 ">
2930
<label className="text-lg sm:text-xl my-auto opacity-50 text-white grow align-bottom mb-1">
30-
{title}
31+
{name}
3132
</label>
3233
{description && (
3334
<FontAwesomeIcon icon={faQuestionCircle} className="w-5 h-5 mb-1 opacity-25 hover:opacity-100 align-self-end justify-self-end text-white justify-right"
@@ -73,4 +74,39 @@ export const CopyView = ({ title, description, value }: CopyViewProps) => {
7374
</div>
7475
</>
7576
);
76-
};
77+
};
78+
79+
export default function CopyPage() {
80+
81+
const searchParams = useSearchParams();
82+
const router = useRouter();
83+
const title = searchParams.get("title");
84+
const name = searchParams.get("name");
85+
const description = searchParams.get("description");
86+
const value = searchParams.get("value");
87+
88+
if (!title || !name || !value) {
89+
let message = `Copy modal dialog is missing one or more required paramters.\n`;
90+
message += `\ntitle: ${title}\nname: ${name}\ndescription: ${description}\nvalue: ${value}`;
91+
console.error(message);
92+
router.push('/');
93+
94+
return;
95+
}
96+
97+
useEffect(() => {
98+
99+
router.replace('/copy', { });
100+
101+
}, []);
102+
103+
return (
104+
<>
105+
<Modal title={title}>
106+
<div className=" w-full h-[70%]">
107+
<CopyView name={name} description={description || ''} value={value} />
108+
</div>
109+
</Modal>
110+
</>
111+
);
112+
}

0 commit comments

Comments
 (0)