Skip to content

Commit

Permalink
Merge pull request #15 from jinseok1006/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jinseok1006 committed Nov 19, 2023
2 parents 4af019d + 893f9c7 commit c5d4124
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 17 deletions.
6 changes: 1 addition & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>전북대 전과 경쟁률 현황</title>
<title>전북대 전학/전과 경쟁률 현황</title>
<link
rel="stylesheet"
as="style"
crossorigin
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css"
/>
<meta
name="keywords"
content="전북대학교, 전북대, JBNU, 전학, 전과, 복수전공, 부전공, 경쟁률, 커트라인"
/>
<meta
name="description"
content="전북대 전학/전과 경쟁률 현황 - 전북대학교의 전과 경쟁률을 모바일 환경으로 제공합니다."
Expand Down
25 changes: 22 additions & 3 deletions src/collegeIndex.ts → src/assets/collegeIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,24 @@ export const COLLEGE_INDEX = [
},
{
college: '사회과학대학',
divisions: ['사회복지학과', '사회학과', '신문방송학과', '심리학과', '정치외교학과', '행정학과'],
divisions: [
'사회복지학과',
'사회학과',
'신문방송학과',
'심리학과',
'정치외교학과',
'행정학과',
],
},
{
college: '상과대학',
divisions: ['경영학과', '경제학부', '무역학과', '회계학과', '경제학부(경제학)'],
divisions: [
'경영학과',
'경제학부',
'무역학과',
'회계학과',
'경제학부(경제학)',
],
},
{
college: '생활과학대학',
Expand All @@ -124,7 +137,13 @@ export const COLLEGE_INDEX = [
},
{
college: '예술대학',
divisions: ['무용학과', '미술학과', '산업디자인학과', '음악과', '한국음악학과'],
divisions: [
'무용학과',
'미술학과',
'산업디자인학과',
'음악과',
'한국음악학과',
],
},
{
college: '인문대학',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@chakra-ui/react';

import { useFilterStore, useFilterStateStore } from '../store/filter';
import { COLLEGES } from '../collegeIndex';
import { COLLEGES } from '../assets/collegeIndex';

const GRADES = [0, 1, 2] as const;

Expand Down
6 changes: 3 additions & 3 deletions src/components/SidebarLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function SidebarLinks({ onClose }: SidebarLinksProps) {
);
}

interface SidebarButtonProps {
interface SidebarLinkProps {
name: string;
to: string;
onClose: () => void;
Expand All @@ -60,9 +60,9 @@ function SidebarLink({
onClose,
icon,
disabled = false,
}: SidebarButtonProps) {
}: SidebarLinkProps) {
const { pathname } = useLocation();
const pattern = new RegExp(`^${to}\/?.*`);
const pattern = new RegExp(`^${to}(\/.*)?$`);
const actived = to === '/' ? pathname === '/' : pathname.match(pattern);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/StatsCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Td,
Text,
} from '@chakra-ui/react';
import { COLLEGE_INDEX } from '../collegeIndex';
import { COLLEGE_INDEX } from '../assets/collegeIndex';

import { useFilterStateStore } from '../store/filter';
import { useTransferStore } from '../store/transfer';
Expand Down
9 changes: 6 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { ChakraProvider, extendTheme } from '@chakra-ui/react';
import { HelmetProvider } from 'react-helmet-async';
import { BrowserRouter } from 'react-router-dom';

// TODO: 운영체제별 폰트 어떻게 처리할 것인지 확인
const fontFactory = (font: string) =>
`'${font}','Apple SD Gothic Neo', '애플 SD 산돌고딕 Neo', 'Malgun Gothic', '맑은 고딕', sans-serif`;
const globalFontFamily = fontFactory('pretendard');

const theme = extendTheme({
styles: {
global: {
Expand All @@ -15,8 +18,8 @@ const theme = extendTheme({
},
},
fonts: {
heading: 'pretendard',
body: 'pretendard',
heading: globalFontFamily,
body: globalFontFamily,
},
});

Expand Down
2 changes: 2 additions & 0 deletions src/pages/TransferViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Stack, Box } from '@chakra-ui/react';
import Filter from '../components/Filter';
import StatsCardsContainer from '../components/StatsCards';
import { useTransferStore } from '../store/transfer';
import Head from '../components/Head';

export default function TransferViewer() {
const transferData = useTransferStore((state) => state.data);
Expand All @@ -16,6 +17,7 @@ export default function TransferViewer() {

return (
<>
<Head title="전북대 전학/전과 경쟁률 현황" />
<Stack mt={2} direction="column" spacing={4} minH="800px">
<Filter />
<StatsCardsContainer />
Expand Down
2 changes: 1 addition & 1 deletion src/store/transfer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useAsync } from '../hooks/useAsync';
import transferData from '../assets/transfer.json';
import transferData from '../assets/transferData.json';

export interface TransferStat {
division: string;
Expand Down

0 comments on commit c5d4124

Please sign in to comment.