Skip to content

Commit

Permalink
💄 교과목 정보 width 조정 (#115)
Browse files Browse the repository at this point in the history
* 교과목 정보 width 조정

* 선택형 useSearchParams 사용

* 연구센터 쿼리 받아오도록 수정
  • Loading branch information
Limchansol authored Oct 16, 2023
1 parent 81ef904 commit 1383324
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/academics/CoursePageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function CoursePageContent({ courses }: CoursePageContentProps) {
};

return (
<div className="w-[664px]">
<div className={selectedOption.view === '카드형' ? 'w-[840px]' : 'w-[664px]'}>
<h4 className="my-8 font-bold">교과목 정보</h4>
<CourseToolbar
viewOption={selectedOption.view}
Expand Down
4 changes: 3 additions & 1 deletion components/research/centers/ResearchCentersPageContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { useSearchParams } from 'next/navigation';
import { useState } from 'react';

import SelectionList from '@/components/common/selection/SelectionList';
Expand All @@ -16,7 +17,8 @@ import ResearchCenterDetails from './ResearchCenterDetails';
const researchCentersPath = getPath(researchCenters);

export default function ResearchCentersPageContent({ centers }: { centers: ResearchCenter[] }) {
const [selected, setSelected] = useState<string>('');
const searchParams = useSearchParams();
const [selected, setSelected] = useState<string>(searchParams.get('selected') ?? '');
const selectedCenter = findSelectedItem<ResearchCenter>(
centers,
decodeURI(selected ?? ''),
Expand Down
4 changes: 3 additions & 1 deletion components/research/groups/ResearchGroupsPageContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { useSearchParams } from 'next/navigation';
import { useState } from 'react';

import SelectionList from '@/components/common/selection/SelectionList';
Expand All @@ -24,7 +25,8 @@ export default function ResearchGroupsPageContent({
groups,
description,
}: ResearchGroupsPageContentProps) {
const [selected, setSelected] = useState<string>('');
const searchParams = useSearchParams();
const [selected, setSelected] = useState<string>(searchParams.get('selected') ?? '');
const selectedGroup = findSelectedItem<ResearchGroup>(
groups,
decodeURI(selected ?? ''),
Expand Down

0 comments on commit 1383324

Please sign in to comment.