Skip to content

Commit

Permalink
Merge pull request #38 from keepgoingLikelion/develop
Browse files Browse the repository at this point in the history
main merge
  • Loading branch information
flareseek authored Feb 16, 2024
2 parents 947240b + 3804e2a commit 78aaf30
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 65 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
Expand Down
88 changes: 88 additions & 0 deletions dist/assets/index-C4OwTf7q.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/assets/index-Dp3BWuEh.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions dist/assets/login-button-DjNwLZBs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="ko">
<head>
<style>
html, body, #root {
height: 100%;
width: 100%;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
</style>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>머랭?!</title>
<script type="module" crossorigin src="/assets/index-C4OwTf7q.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Dp3BWuEh.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
4 changes: 2 additions & 2 deletions src/components/Calendar/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function CalBody() {
currentDate, weekCalendarList, postings,
} = useCalendarStore();

const handleDateClick = (clickedDate: Date, postId?: number) => {
const handleDateClick = (postId?: number) => {
if (postId) {
navigate(`/post/${postId}`);
}
Expand Down Expand Up @@ -62,7 +62,7 @@ function CalBody() {
type="button"
className={`${s.days}`}
style={day === 0 ? { visibility: 'hidden' } : {}}
onClick={() => handleDateClick(clickedDate, post?.postId)}
onClick={() => handleDateClick(post?.postId)}
key={dayIndex}
>
<div className="days">
Expand Down
10 changes: 0 additions & 10 deletions src/components/CheckBox/CheckBox.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions src/components/CheckBox/CheckBoxList.tsx

This file was deleted.

16 changes: 6 additions & 10 deletions src/components/EmotionList/EmotionList.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
// import { useState } from 'react';
import { QueryClient, QueryClientProvider } from 'react-query';
import { Link } from 'react-router-dom';
import { useEffect, useState } from 'react';
import s from './EmotionList.module.css';
import GetEmotionIcon from '../../utils/GetEmotionIcon.tsx';
import useLikedPosts from '../LikedPostsList/useLikedPosts';
import instance from '../../interface/instance.ts';
import { useEffect, useState } from 'react';

const queryClient = new QueryClient();

interface Props {
emotionType: number;
}
type LikedPostCounts = number[];

function EmotionList() {
const [countList, setCountList] = useState<LikedPostCounts| null>(null);
const [countList, setCountList] = useState<LikedPostCounts | null>(null);
const emotions = [1, 2, 3, 4, 5, 6];

useEffect(() => {
const fetchList = async () => {
try{
try {
const res: { data: LikedPostCounts } = await instance.get('/post/myLikeCountList');
setCountList(res.data);
} catch(error){
} catch (error) {
console.error('Error fetching: ', error);
}
};
Expand All @@ -36,10 +32,10 @@ function EmotionList() {
{emotions.map((emotionType) => (
<Link to={`/myLog/${emotionType}`} key={emotionType} className={s.button}>
<GetEmotionIcon type={emotionType} />
{countList && <span className={s.count} style={{fontSize: '12px', color: '#51372B', marginTop: '3px'}}>{countList[emotionType - 1]}</span>}
{countList && <span className={s.count} style={{ fontSize: '12px', color: '#51372B', marginTop: '3px' }}>{countList[emotionType - 1]}</span>}
</Link>
))}

</div>
</QueryClientProvider>
);
Expand Down
15 changes: 5 additions & 10 deletions src/components/UserTextCard/UserTextCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,11 @@ import { PostSDTO } from '../../interface/postInterface.ts';
import Happy from '../../assets/moodIcons/happy.svg';
import { getCategoryImg } from '../../functions/getCategory.ts';

const getDateToString = (date: Date) => {
const currentDate = new Date(date.toString());
const m = currentDate.getMonth() + 1;
const d = currentDate.getDate();
return `${currentDate.getFullYear()}.${m >= 10 ? m : `0${m}`}.${d >= 10 ? d : `0${d}`}`;
};

export default function UserTextCard({ data }: { data: PostSDTO }) {
const navigation = useNavigate();
const onClickCard = () => {
navigation(`/post/${data.postId}`)
}
navigation(`/post/${data.postId}`);
};
return (
<div className={styles.wrap} onClick={onClickCard}>
<div className={styles.profile}>
Expand All @@ -27,7 +20,9 @@ export default function UserTextCard({ data }: { data: PostSDTO }) {
</div>
</div>
<div className={styles.commentCount}>
<div style={{ color: 'red', display: 'inline' }}></div> {data.emojiCount}
<div style={{ color: 'red', display: 'inline' }}></div>
{' '}
{data.emojiCount}
</div>
</div>
<div className={styles.content}>
Expand Down

0 comments on commit 78aaf30

Please sign in to comment.