Skip to content

Commit

Permalink
Merge pull request #30 from Gosrock/dev
Browse files Browse the repository at this point in the history
최종 배포
  • Loading branch information
ImNM authored Feb 21, 2022
2 parents 3bb6ac6 + c1eb5e6 commit 0a03af8
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 68 deletions.
Binary file modified public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>고스락 티켓 - 어드민</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
34 changes: 26 additions & 8 deletions src/components/AuthPage/LoginPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import { initializeForm, login } from '../../state/actions-creators';
Expand All @@ -10,7 +10,8 @@ function LoginPage(props) {
const dispatch = useDispatch();

const { errorMessage, pending } = useSelector(state => state.auth);

const [error, setError] = useState(null);
const [form] = Form.useForm();
const onSubmitHandler = values => {
// event.preventDefault();
let body = {
Expand All @@ -24,11 +25,15 @@ function LoginPage(props) {
};

useEffect(() => {
console.log(errorMessage);
/*if (errorMessage && !pending) {
alert('로그인실패');
}*/
}, [errorMessage, pending]);
if (errorMessage) {
console.log(errorMessage);
if (errorMessage === '아이디비밀번호오류') {
setError('아이디/비밀번호 오류');
form.resetFields(['Id', 'password']);
return;
}
}
}, [form, errorMessage, setError]);

useEffect(() => {
dispatch(initializeForm());
Expand All @@ -46,6 +51,7 @@ function LoginPage(props) {
}}
>
<Form
form={form}
name="normal_login"
className="login-form"
initialValues={{
Expand Down Expand Up @@ -83,7 +89,19 @@ function LoginPage(props) {
placeholder="Password"
/>
</Form.Item>

{
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'column',
color: 'red'
}}
>
{error}
</div>
}
<Form.Item>
<Button
style={{ float: 'right' }}
Expand Down
64 changes: 7 additions & 57 deletions src/components/EnterCheckPage/EnterList.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { List, message, Avatar } from 'antd';
import VirtualList from 'rc-virtual-list';
import { ReactComponent as GosrockLogo } from './GosrockLogo.svg';
import { ReactComponent as GosrockLogo2 } from './GosrockLogo2.svg';
const ContainerHeight = 550;

export const EnterList = ({ data }) => {
Expand All @@ -19,60 +19,6 @@ export const EnterList = ({ data }) => {
}
};

const testData = [
{
enterState: false,
ticketInfo: {
_id: '6205365ba7a02cb6c69dbfe7',
status: 'enter',
phoneNumber: '01044442323',
ticketNumber: 18,
adminTicket: false,
accountName: '노재탁',
studentID: 'C235142',
smallGroup: false,
createdAt: '2022-02-10T15:59:23.454Z',
updatedAt: '2022-02-11T12:33:10.981Z',
__v: 0,
manager: '62037bc22736fe7ca0a99074'
}
},
{
enterState: true,
ticketInfo: {
_id: '6205365ba7a02cb2269dbfe7',
status: 'enter',
phoneNumber: '01042142323',
ticketNumber: 15,
adminTicket: false,
accountName: '김주안',
studentID: 'C232223',
smallGroup: false,
createdAt: '2022-02-10T15:59:23.454Z',
updatedAt: '2022-02-11T12:33:10.981Z',
__v: 0,
manager: '62037bc22736fe7ca0a99074'
}
},
{
enterState: false,
ticketInfo: {
_id: '6205365ba7a02cbdd69dbfe7',
status: 'enter',
phoneNumber: '01046542323',
ticketNumber: 12,
adminTicket: false,
accountName: '이찬진',
studentID: 'C236623',
smallGroup: false,
createdAt: '2022-02-10T15:59:23.454Z',
updatedAt: '2022-02-11T12:33:10.981Z',
__v: 0,
manager: '62037bc22736fe7ca0a99074'
}
}
];

return (
<List>
<VirtualList
Expand All @@ -85,9 +31,13 @@ export const EnterList = ({ data }) => {
{item => (
<List.Item key={item.ticketInfo._id}>
<List.Item.Meta
avatar={<GosrockLogo />}
avatar={<GosrockLogo2 />}
title={
<a href={`https://gosrock.link/tickets/${item.ticketInfo._id}`}>
<a
rel="noreferrer"
target="_blank"
href={`https://gosrock.link/tickets/${item.ticketInfo._id}`}
>
{item.ticketInfo.accountName}
</a>
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/EnterCheckPage/GosrockLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0a03af8

Please sign in to comment.