Skip to content

Commit

Permalink
fix: add param
Browse files Browse the repository at this point in the history
  • Loading branch information
halfmoon-mind committed Dec 17, 2023
1 parent d8f5c89 commit b97b408
Show file tree
Hide file tree
Showing 38 changed files with 11 additions and 28 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ import * as styles from './AgreeInfo.style';
import NavigationBar from '@/components/common/Navbar/NavigationBar';
import { useRecoilValue } from 'recoil';
import { userNavAtom } from '@/states/userNavAtom';
import { useEffect, useState } from 'react';

const AgreeInfo = () => {
const activeNavType = useRecoilValue(userNavAtom).activeNavType;
// add state
const [url, setUrl] = useState<URL>();
const [param, setParam] = useState<String | null>('');

const url = new URL(window.location.href);
const paramValue = url.searchParams.get('param');
useEffect(() => {
const url = new URL(window.location.href);
setUrl(url);
setParam(url?.searchParams.get('param'));
}, []);

return (
<>
<div style={{ height: '46px' }}> 헤더자리</div>
<styles.FlexBox>
<styles.TopBox>
<div style={{ padding: '12px 15px' }}>{paramValue}</div>
<div style={{ padding: '12px 15px' }}>{param}</div>
</styles.TopBox>
<styles.MiddleBox />
<styles.InfoBox></styles.InfoBox>
Expand Down
10 changes: 0 additions & 10 deletions src/pages/my/agree/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import Head from 'next/head';
import { Inter } from 'next/font/google';
import Agree from '@/components/myPage/agree/Agree';

const inter = Inter({ subsets: ['latin'] });

export default function Home() {
return (
<>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
</Head>
<Agree />
</>
);
Expand Down
16 changes: 1 addition & 15 deletions src/pages/my/agree/info/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import Head from 'next/head';
import { Inter } from 'next/font/google';
import AgreeInfo from '@/components/myPage/agree/info/AgreeInfo';

const inter = Inter({ subsets: ['latin'] });

export default function Home() {
return (
<>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
</Head>
<AgreeInfo />
</>
);
return <AgreeInfo />;
}

0 comments on commit b97b408

Please sign in to comment.