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

나의 다짐 페이지 구현완료 #142

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions client/src/components/MotivationForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MotivaionFormBox } from '../style/Motivation'

const SERVER_URL = import.meta.env.VITE_SERVER_URL;

const MotivationForm = ({isPost, setIsPost}, setFormattedTime) => {
const MotivationForm = ({isPost, setIsPost , setFormattedTime}) => {
const [memo, setMemo] = useState('');

const userInfo = useSelector((state) => state.user);
Expand Down Expand Up @@ -40,8 +40,8 @@ const MotivationForm = ({isPost, setIsPost}, setFormattedTime) => {
}
);

// const savedMemo = response.data;
// setMemo([...memo, savedMemo]);
const savedMemo = response.data;
setMemo([...memo, savedMemo]);

setMemo('');
setIsPost(!isPost);
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/MotivationList.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect , useState} from 'react';
import axios from 'axios';
import { useSelector } from 'react-redux';
import {MotivationListSection} from '../style/Motivation'

const SERVER_URL = import.meta.env.VITE_SERVER_URL;

Expand Down Expand Up @@ -32,7 +33,7 @@ const MemoList = ( {isPost, formattedTime} ) => {
};

return (
<div>
<MotivationListSection>
<h2>Motivation List</h2>
<ul>
{memos.map((memo) => (
Expand All @@ -42,7 +43,7 @@ const MemoList = ( {isPost, formattedTime} ) => {
</li>
))}
</ul>
</div>
</MotivationListSection>
);
};

Expand Down
32 changes: 32 additions & 0 deletions client/src/style/Motivation.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,36 @@ export const MotivationPages = styled.div`
background-color: #09305E;
}
}
`

export const MotivationListSection = styled.div`
height: calc(100% - 10rem);
overflow: auto;

ul{
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 1.875rem;
padding: 0 1.25rem;
}
li{
display: flex;
flex-direction: column;
gap: 1.875rem;
width: 50%;
border: 1px solid var(--navy);
padding: 2.5rem 1.25rem;
border-radius: 30px;
}
li > p{
font-size: 2rem;
font-family: var(--nanum);
}
li > span{
align-self: flex-end;
font-size: .875rem;
color: #414141;

}
`