Skip to content

Commit

Permalink
[#123] bugfix: darkmode diary button
Browse files Browse the repository at this point in the history
  • Loading branch information
rosieyeon committed Feb 18, 2022
1 parent d640e19 commit eb25cab
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
34 changes: 23 additions & 11 deletions src/components/Schedule/diaryText.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import React, { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import axios from 'axios';
import React, { useEffect, useState } from "react";
import { useSelector } from "react-redux";
import axios from "axios";

// 삭제 버튼
function DiaryText({ wantEdit, setWantEdit, content, setContent, createDiary, updateDiary, diarySeq }) {
const token = localStorage.getItem('accessToken');
function DiaryText({
wantEdit,
setWantEdit,
content,
setContent,
createDiary,
updateDiary,
diarySeq,
}) {
const token = localStorage.getItem("accessToken");

const onEdit = () => {
setWantEdit(() => true);
Expand All @@ -27,16 +35,20 @@ function DiaryText({ wantEdit, setWantEdit, content, setContent, createDiary, up
defaultValue={content}
onChange={(e) => setContent(() => e.target.value)}
/>
<button className="diary-box__contents-btn" onClick={offEdit}>
저장
</button>
<div className="diary-box__text-btn">
<button className="diary-box__contents-btn" onClick={offEdit}>
저장
</button>
</div>
</div>
) : (
<div className="diary-box__contents-text">
<div>{content}</div>
<button className="diary-box__contents-btn" onClick={onEdit}>
수정
</button>
<div className="diary-box__text-btn">
<button className="diary-box__contents-btn" onClick={onEdit}>
수정
</button>
</div>
</div>
)}
</>
Expand Down
4 changes: 4 additions & 0 deletions src/statics/css/diary.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/statics/css/diary.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/statics/scss/diary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@
.diary-image__text {
padding-top: 8px;
}
.diary-box__text-btn {
text-align: right;
}

0 comments on commit eb25cab

Please sign in to comment.