Skip to content
Open
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
12 changes: 8 additions & 4 deletions src/components/content-detail/QuestionFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const QuestionFooterStyle = styled.div`
display: flex;
line-height: 24px;
gap: 20px;
margin-top: 30px;

.likes {
display: flex;
cursor: pointer;
Expand Down Expand Up @@ -125,28 +127,30 @@ const QuestionFooterStyle = styled.div`
.solvedWrap {
width: 100%;
border-radius: 20px;
margin-top: 30px;

.solvedStatus {
padding: 2.5rem 3.5rem;
display: flex;
justify-content: space-between;
font-size: 1.3rem;
font-size: 15px;

.left {
display: flex;
flex-direction: column;
gap: 20px;

.solvedTitle {
font-size: 2rem;
font-size: 25px;
}
}
.right {
display: flex;
align-items: center;
.solveButton {
cursor: pointer;
border: 1px solid #e6e6e6;
font-size: 1.5rem;
border: 1px solid #c9ffcf;
font-size: 15px;
height: fit-content;
padding: 1rem 1.5rem;
border-radius: 50px;
Expand Down
1 change: 1 addition & 0 deletions src/components/content-detail/QuestionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const QuestionHeaderStyle = styled.div`

.title {
font-size: 30px;
margin-bottom: 10px;
}
.panel {
display: flex;
Expand Down
21 changes: 18 additions & 3 deletions src/components/main-page/QuestionBox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// src/components/QuestionBox.tsx

import { useEffect, useState } from 'react';
import styled from 'styled-components';
import { Link } from 'react-router'; // Link import 추가
import QuestionBody from '../ui/molecules/mainpage-molecule/QuestionBody';
import QuestionHeader from '../ui/molecules/mainpage-molecule/QuestionHeader';
import QuestionTag from '../ui/atoms/mainpage-atom/QuesitonTag';
Expand All @@ -11,11 +14,23 @@ const QuestionBoxContainer = styled.div`
display: flex;
flex-direction: column;
margin-top: 30px;
gap: 30px;
gap: 10px;
`;

const QuestionItem = styled.div`
// Link를 기반으로 한 styled component로 변경
const QuestionItem = styled(Link)`
margin: 10px;
text-decoration: none;
color: inherit;
display: block;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
transition: box-shadow 0.3s;

&:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
`;

function QuestionBox() {
Expand Down Expand Up @@ -44,7 +59,7 @@ function QuestionBox() {
return (
<QuestionBoxContainer>
{posts.map((post) => (
<QuestionItem key={post.id}>
<QuestionItem key={post.id} to={`/posts/${post.id}`}>
<QuestionHeader solved={post.solved} title={post.title} />
<QuestionBody content={post.content} />
{post.tags && <QuestionTag tags={post.tags.split(',')} />}
Expand Down