Skip to content
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
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ jobs:
- name: Build and push Docker image
working-directory: backend
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/piroin-backend:latest .
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/piroin-backend:latest \
-t ${{ secrets.DOCKERHUB_USERNAME }}/piroin-backend:${{ github.sha }} .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/piroin-backend:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/piroin-backend:${{ github.sha }}

- name: Deploy to EC2
uses: appleboy/ssh-action@v1.0.0
Expand All @@ -59,7 +61,7 @@ jobs:
--restart unless-stopped \
-p 8080:8080 \
-v piroin-uploads:/app/uploads \
--health-cmd="curl -f http://localhost:8080/actuator/health || exit 1" \
--health-cmd="wget -q -O /dev/null http://localhost:8080/actuator/health || exit 1" \
--health-interval=30s \
--health-timeout=10s \
--health-retries=3 \
Expand All @@ -70,3 +72,4 @@ jobs:
-e JWT_SECRET="${{ secrets.JWT_SECRET }}" \
-e JWT_EXPIRATION="${{ secrets.JWT_EXPIRATION }}" \
${{ secrets.DOCKERHUB_USERNAME }}/piroin-backend:latest
docker image prune -a -f
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
align-items: center;
background: var(--gray600);
border-radius: 10px;
overflow: hidden;
width: 480px;
max-width: calc(100vw - 56px);
margin-bottom: 30px;
Expand All @@ -31,6 +30,7 @@

.searchInput {
flex: 1;
min-width: 0;
background: transparent;
border: none;
outline: none;
Expand Down
19 changes: 16 additions & 3 deletions frontend/src/pages/qna/QnADetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function QnADetailPage() {
const [selectedImages, setSelectedImages] = useState([]); // 여러 장
const [imagePreviews, setImagePreviews] = useState([]); // 여러 장 미리보기
const fileInputRef = useRef(null);
const commentTextareaRef = useRef(null);

// ── 댓글 수정 상태 ───────────────────────────────
const [commentMenuId, setCommentMenuId] = useState(null);
Expand Down Expand Up @@ -420,6 +421,7 @@ function QnADetailPage() {
setImagePreviews([]);
// 로컬 상태에 blob URL을 직접 넣으면 새로고침 시 이미지가 깨지므로
// 등록 직후 fetchQuestion으로 서버의 정식 URL을 받아온다.
if (commentTextareaRef.current) commentTextareaRef.current.style.height = 'auto';
await fetchQuestion();
}
} catch (err) {
Expand Down Expand Up @@ -709,14 +711,25 @@ function QnADetailPage() {
style={{ display: 'none' }}
onChange={handleImageSelect}
/>
<input
<textarea
id="commentInput"
ref={commentTextareaRef}
className={styles.commentInput}
placeholder="댓글을 입력해주세요..."
value={commentText}
onChange={e => setCommentText(e.target.value)}
onKeyDown={e => { if (e.key === 'Enter' && !e.nativeEvent.isComposing) handleCommentSubmit(); }}
onChange={e => {
setCommentText(e.target.value);
e.target.style.height = 'auto';
e.target.style.height = `${Math.min(e.target.scrollHeight, 150)}px`;
}}
onKeyDown={e => {
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault();
handleCommentSubmit();
}
}}
onPaste={handlePaste}
rows={1}
disabled={isSubmitting}
/>
<button
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/pages/qna/QnADetailPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@

.commentInputRow {
display: flex;
align-items: center;
align-items: flex-end;
width: 100%;
gap: 8px;
}
Expand All @@ -547,17 +547,24 @@
justify-content: center;
flex-shrink: 0;
color: var(--gray600);
margin-bottom: 2px;
}

.commentInput {
flex: 1;
min-width: 0;
resize: none;
border: none;
background: none;
font-family: var(--font-main);
font-size: 16px;
color: var(--black);
outline: none;
height: 100%;
line-height: 1.4;
padding: 7px 0;
box-sizing: border-box;
max-height: 150px;
overflow-y: auto;
}

.commentInput::placeholder {
Expand All @@ -577,6 +584,7 @@
flex-shrink: 0;
padding: 0;
transition: opacity 0.15s;
margin-bottom: 2px;
}

.submitBtn:disabled {
Expand Down
Loading
Loading