Skip to content

Commit

Permalink
🚀 feat: 입장 알림, 리스트 순서 뒤집기
Browse files Browse the repository at this point in the history
  • Loading branch information
kongnayeon committed Aug 10, 2022
1 parent deb934b commit 0169773
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/components/Tickets/EnterPage/EnterList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ContainerHeight = 800;

function EnterList() {
const { ticketList } = useSelector(state => state.enterPage);
const reverse = [...ticketList].reverse();

const onScroll = e => {
if (
Expand All @@ -31,7 +32,7 @@ function EnterList() {
<Col span={16}>
<List>
<VirtualList
data={ticketList}
data={reverse}
height={ContainerHeight}
itemHeight={47}
itemKey="email"
Expand Down
20 changes: 11 additions & 9 deletions src/components/Tickets/EnterPage/RecentEnter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ import {
CloseCircleOutlined,
LoadingOutlined
} from '@ant-design/icons';
import { Card, Tag, Space } from 'antd';
import { Card, Tag, Space, message } from 'antd';
import moment from 'moment';
import React from 'react';
import React, { useEffect, useRef } from 'react';
import { useSelector } from 'react-redux';
import styled from 'styled-components';

styled(Card)`
display: flex;
height: 100%;
justify-content: center;
position: relative;
`;

function RecentEnter() {
const { enterData } = useSelector(state => state.enterPage);
const isMounted = useRef(false);

useEffect(() => {
if (!isMounted.current) {
isMounted.current = true;
} else {
message.info(`입장 알림`);
}
}, [enterData]);

return (
<>
Expand Down

0 comments on commit 0169773

Please sign in to comment.