Skip to content

Commit

Permalink
Merge branch 'client_lines' into fixing-lines
Browse files Browse the repository at this point in the history
  • Loading branch information
kristenliuu committed Dec 1, 2024
2 parents b497430 + 4f10fff commit 861421c
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 26 deletions.
2 changes: 1 addition & 1 deletion client/src/components/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SideBarNav from '../main/sideBarNav';
import Header from '../header';

/**
* Main component represents the layout of the main page, including a sidebar and the main content area.
* Main component represents the layout of the main page, including a sidebar and main content area.
*/
const Layout = () => (
<>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/main/commentSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import useUserContext from '../../../hooks/useUserContext';
* Interface representing the props for the Comment Section component.
*
* - comments - list of the comment components
* - handleAddComment - a function that handles adding a new comment, taking a Comment object as an
* argument
* - handleAddComment - a function that handles adding a new comment, taking a Comment object
* as an argument
*/
interface CommentSectionProps {
comments: Comment[];
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/main/profile/community/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

.community-pills-container {
display: flex;
flex-wrap: wrap; /* Ensures pills wrap if they overflow */
gap: 10px; /* Adds space between pills */
justify-content: center; /* Centers the pills in the container */
align-items: center; /* Aligns pills vertically */
margin: 20px 0; /* Adds spacing around the container */
flex-wrap: wrap;
gap: 10px;
justify-content: center;
align-items: center;
margin: 20px 0;
}

.community-pill {
Expand Down
1 change: 0 additions & 1 deletion client/src/components/main/profile/header/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* Assuming you have a specific CSS file for ProfileHeader */
.profile-header {
display: flex;
justify-content: center;
Expand Down
1 change: 0 additions & 1 deletion client/src/components/main/profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const ProfilePage = () => {
<div className='home-container'>
<SideBarHome />
<div className='profile-content'>
{/* <ProfileHeader className='title-text' titleText={titleText} /> */}
<Outlet />
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion client/src/components/main/profile/tags/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
width: 100%;
align-items: center;
justify-content: center;
/* background-color: #f5f5f5; */
box-sizing: border-box;
margin-top: -50px;
height: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface OrderButtonProps {
*
* @param orderType - The label for the button and the value passed to setQuestionOrder function.
* @param setQuestionOrder - Callback function to set the order of questions based on the input
* message.
* message.
*/
const OrderButton = ({ orderType, setQuestionOrder }: OrderButtonProps) => (
<button
Expand Down
5 changes: 2 additions & 3 deletions client/src/components/main/questionPage/question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ interface QuestionProps {
}

/**
* Question component renders the details of a question including its title, tags, author, answers,
* and views.
* Clicking on the component triggers the handleAnswer function,
* Question component renders the details of a question including its title, tags, author,
* answers, and views. Clicking on the component triggers the handleAnswer function,
* and clicking on a tag triggers the clickTag function.
*
* @param q - The question object containing question details.
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/main/sideBarNav/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}

.menu_selected {
color: #895159; /* Ensure text color remains black */
color: #895159;
text-decoration: underline 895159 2px;
}

Expand Down
8 changes: 3 additions & 5 deletions client/src/hooks/useAnswerPage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import { useNavigate, useParams } from 'react-router-dom';
import { useEffect, useState } from 'react';
import { Comment, Answer, Question, VoteData, NewQuestionData } from '../types';
Expand All @@ -10,8 +11,8 @@ import { getQuestionById } from '../services/questionService';
*
* @returns questionID - The current question ID retrieved from the URL parameters.
* @returns question - The current question object with its answers, comments, and votes.
* @returns handleNewComment - Function to handle the submission of a new comment to a question or
* answer.
* @returns handleNewComment - Function to handle the submission of a new comment to a question
* or answer.
* @returns handleNewAnswer - Function to navigate to the "New Answer" page
*/
const useAnswerPage = () => {
Expand Down Expand Up @@ -57,7 +58,6 @@ const useAnswerPage = () => {

await addComment(targetId, targetType, comment);
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error adding comment:', error);
}
};
Expand All @@ -71,12 +71,10 @@ const useAnswerPage = () => {
const res = await getQuestionById(questionID, user.username);
setQuestion(res || null);
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error fetching question:', error);
}
};

// eslint-disable-next-line no-console
fetchData().catch(e => console.log(e));
}, [questionID, user.username]);

Expand Down
3 changes: 1 addition & 2 deletions client/src/hooks/useCommunityNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const useCommunityNames = () => {
try {
const res = await getCommunityNames();
if (Array.isArray(res)) {
// Assuming `name` is a property of the community object.
setCommunityNames(res.map(community => community.name));
} else {
setCommunityNames([]);
Expand All @@ -36,7 +35,7 @@ const useCommunityNames = () => {
};

fetchCommunityNames();
}, []); // Run the fetch only once on mount
}, []);

return { communityNames, loading, error };
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/useRelevantCommunities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getRelevantCommunities } from '../services/communityService';
*
* @returns relevantCommunities - The current list of relevant communities.
* @returns setRelevantCommunities - Setter to manually update the relevant communities state if
* needed.
* needed.
* @returns loading - The current loading state.
* @returns error - The current error message.
*/
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/useTagPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TagData } from '../types';
*
* @returns tlist - An array of tag data retrieved from the server
* @returns clickTag - Function to navigate to the home page with the selected tag as a URL
* parameter.
* parameter.
*/
const useTagPage = () => {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/useVoteStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const useVoteStatus = ({ question }: { question: Question }) => {
* Function to get the current vote value for the user.
*
* @returns The current vote value for the user in the question, 1 for upvote, -1 for downvote,
* 0 for no vote.
* 0 for no vote.
*/
const getVoteValue = () => {
if (user.username && question?.upVotes?.includes(user.username)) {
Expand Down

0 comments on commit 861421c

Please sign in to comment.