Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

プルプルプル by #232

47 changes: 47 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"next": "13.4.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-modal": "^3.16.1",
"socket.io-client": "^4.6.1",
"typescript": "5.0.4"
},
Expand All @@ -46,6 +47,7 @@
"@storybook/react": "^7.0.9",
"@storybook/test-runner": "^0.10.0",
"@storybook/testing-library": "^0.0.14-next.2",
"@types/react-modal": "^3.16.0",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"concurrently": "^8.0.1",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 24 additions & 5 deletions frontend/src/features/user/components/User.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
import { ReactNode } from 'react';
import { ReactNode, useState } from 'react';
import { useAtom } from 'jotai';

import { Container } from '@/components/Layout/Container';
import { userInfoAtom } from '@/App';

import { LoginForm } from './LoginForm';
import { SignUpForm } from './SignUpForm';
import { UserDetailsModal } from './UserDetailsModal';

export const User = ({ children }: { children: ReactNode }) => {
const [userInfo, setUserInfo] = useAtom(userInfoAtom);

const [modalIsOpen, setModalIsOpen] = useState(false);
const closeModal = () => {
console.log('closeModal');
setModalIsOpen(false);
};
const UserInputArea = () => {
if (userInfo) {
return (
<p>
id : {userInfo?.id}, name : {userInfo?.nickname}
</p>
<div>
<button
onClick={() => {
setModalIsOpen(true);
}}
>
botton
</button>
<p>
id : {userInfo?.id}, name : {userInfo?.nickname}
</p>
<UserDetailsModal
userInfo={userInfo}
modalIsOpen={modalIsOpen}
closeModal={closeModal}
/>
</div>
);
} else {
return (
Expand Down
Empty file.
23 changes: 23 additions & 0 deletions frontend/src/features/user/components/UserDetailsModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';
import Modal from 'react-modal';

import { UserInfo } from '../types/UserDto';

Modal.setAppElement('body');
export const UserDetailsModal = ({
userInfo,
modalIsOpen,
closeModal,
}: {
userInfo: UserInfo;
modalIsOpen: boolean;
closeModal: () => void;
}) => {
return (
<Modal isOpen={modalIsOpen} onRequestClose={closeModal}>
<p>
id : {userInfo?.id}, name : {userInfo?.nickname}
</p>
</Modal>
);
};