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

[FEAT] 로그인박스 추가 #27

Merged
merged 7 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/images/S-TopLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/kakaoLoginButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/naverLoginButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/components/common/LoginBox/LoginBox.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.loginBox {
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 8px 8px 12px;
gap: 8px;
position: relative;
width: 727px;
height: 570px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인박스의 width와 height를 고정해두지 말고

  1. flexbox로 그대로 둬서 이 컴포넌트를 사용하는 그릇이 맞추게 하거나
  2. LoginBox props로 width와 height를 받아와서 style={{width: width, height: height}}와 같이 하면 어떨까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최대한 맞춰서 변경해보았습니다

background: #FFFFFF;
border: 1px solid #EFEFF0;
border-radius: 12px;
}

.logo {
margin-bottom: 0px;
width: 256px;
height: 256px;
}

.button {
margin: 10px 0;
cursor: pointer;
width: 600px;
height: 90px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인박스와 마찬가지로 width: 100%처럼 크기를 유동적으로 설정할 수 있게 하면 좋을 것 같습니다.

border-radius: 12px;
}
18 changes: 18 additions & 0 deletions src/components/common/LoginBox/LoginBox.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Meta, StoryObj } from '@storybook/react';
import { LoginBox } from './LoginBox';

const meta = {
title: 'Components/LoginBox',
component: LoginBox,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {},
args: {},
} satisfies Meta<typeof LoginBox>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {};
13 changes: 13 additions & 0 deletions src/components/common/LoginBox/LoginBox.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { render, screen } from '@/utils/test-utils';
import { LoginBox } from './LoginBox';
import '@testing-library/jest-dom';

describe('LoginBox component', () => {
it('renders correctly', () => {
render(<LoginBox />);
expect(screen.getByAltText('Logo')).toBeInTheDocument();
expect(screen.getByAltText('카카오 로그인')).toBeInTheDocument();
expect(screen.getByAltText('네이버 로그인')).toBeInTheDocument();
});
});
12 changes: 12 additions & 0 deletions src/components/common/LoginBox/LoginBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import classes from './LoginBox.module.css';

export function LoginBox() {
return (
<div className={classes.loginBox}>
<img src="/images/S-TopLogo.png" alt="Logo" className={classes.logo} />
<img src="/images/kakaoLoginButton.png" alt="카카오 로그인" className={classes.button} />
<img src="/images/naverLoginButton.png" alt="네이버 로그인" className={classes.button} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인 버튼을 이미지 대신 크기가 유동적일 수 있게 Mantine Button을 사용해서 만들면 어떨까요?
leftsection에 아이콘(또는 이미지)를 넣고 스타일로 width를 설정하면 좋을 것 같다는 생각입니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mantine button으로 수정하였습ㄴㅣ다

</div>
);
}
Loading