Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ 2.0.1 ๋ฆฌํŒฉํ† ๋ง ๋ฉ”์ธ ๋ธŒ๋žœ์น˜ ๋ฐ˜์˜ #291

Merged
merged 43 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0767db8
๐Ÿ”ง Update: chore eslint-config
ws-071211 Aug 24, 2024
43cbc03
Merge pull request #3 from Team-Ampersand/chore/eslint-config
ws-071211 Aug 28, 2024
14d7fc9
Merge branch 'Team-Ampersand:develop' into develop
mini-aron Aug 31, 2024
43ec891
โ™ป๏ธRefactor:component modularization
Ethen1264 Aug 31, 2024
1de2673
โ™ป๏ธRefactor: change notice modal recoil to useState
Ethen1264 Aug 31, 2024
7b8f082
๐ŸŽจChore: setting prettier
Ethen1264 Aug 31, 2024
e81d81d
๐Ÿ”ง Update: chore eslint-config
ws-071211 Aug 24, 2024
fd24552
โ™ป๏ธ Refactor: Remove unnecessary state management
mini-aron Aug 27, 2024
8566ad0
โ™ป๏ธ Refactor: Remove token insertion logic
mini-aron Sep 1, 2024
9db7c67
๐Ÿ”จDelete getServerSideProps
Ethen1264 Sep 2, 2024
206b07c
โ™ป๏ธTefactorimproved import order
Ethen1264 Sep 2, 2024
0f7a187
๐Ÿ›Fix: response notice modal
Ethen1264 Sep 2, 2024
08f941c
โ™ป๏ธ Refactor: Improve code readability and structure for maintainability
mini-aron Sep 2, 2024
a49e438
โ™ป๏ธ Refactor: move regUrl regex variable outside the component
Ethen1264 Sep 3, 2024
4ff37ad
โ™ป๏ธ Refactor: Improved code structure
mini-aron Sep 4, 2024
982e1af
โ™ป๏ธ Refactor: Edit selfStudyList Type
mini-aron Sep 4, 2024
453a551
๐ŸššUpdate: change song cumponents name
Ethen1264 Sep 6, 2024
1d17f31
โ™ป๏ธ Refactor: SongListProps from type to interface
Ethen1264 Sep 6, 2024
fd2ed09
๐Ÿ‘Œchore: Rename variable i to item for better clarity
Ethen1264 Sep 6, 2024
99d3fa9
๐ŸŽจ Fix: import order to comply with ESLint rules
Ethen1264 Sep 6, 2024
b088ab2
๐ŸŽจUpdate: Align parameter names
Ethen1264 Sep 7, 2024
1826a1a
๐Ÿ› ๏ธ Update: Change CalendarBoxProps from type to interface
Ethen1264 Sep 7, 2024
43fe52c
๐Ÿ”งDelete: redundant type=button from styled-components button
Ethen1264 Sep 7, 2024
3a92d12
๐Ÿ”„ Revert: Restore type=button for styled-components button
Ethen1264 Sep 7, 2024
2d68ce5
๐ŸŽจ Update: width from em to px for NoticeModalBtn
Ethen1264 Sep 7, 2024
ded43e3
๐ŸŽจUpdate: Use template literals for improved readability in MusicItemTโ€ฆ
Ethen1264 Sep 7, 2024
463707a
โ™ป๏ธ Refactor: Simplifying ranking image code
mini-aron Sep 7, 2024
8e30cf6
๐ŸŽจUpdate: improve font styling
Ethen1264 Sep 8, 2024
0ad4c1e
๐Ÿ”จRefactor: SongItemProps from type to interface
Ethen1264 Sep 8, 2024
1e293a5
๐Ÿ”จDelete: React.FC and explicitly define Prop types
Ethen1264 Sep 8, 2024
2c68fd9
Merge pull request #4 from Team-Ampersand/refactor/song
Ethen1264 Sep 8, 2024
996943c
โ™ป๏ธ Refactor:component modularization
ws-071211 Sep 11, 2024
b7d4871
๐ŸŽจ Fix:import order to comply
ws-071211 Sep 11, 2024
48b68a4
๐ŸŽจ Chore/setting prettier
ws-071211 Sep 11, 2024
aec51c4
โ™ป๏ธ Refactor: Simplify style code
mini-aron Sep 12, 2024
10a7b40
โ™ป๏ธ Refactor: Change variable name
mini-aron Sep 12, 2024
0e510f6
๐Ÿ”ฅ Remove: delete ssr
mini-aron Sep 12, 2024
6a19059
โ™ป๏ธ Refactor: Apply code conventions
mini-aron Sep 12, 2024
aa34eb7
โ™ป๏ธ Refactor: Change to presentational component
mini-aron Sep 13, 2024
e57ab08
Merge pull request #5 from Team-Ampersand/refactor/stuinfo
ws-071211 Sep 13, 2024
42731ac
Merge pull request #6 from Team-Ampersand/refactor/self-study
mini-aron Sep 13, 2024
41328d6
๐Ÿ›Fix: button duplicate submission issue
Ethen1264 Sep 13, 2024
b5967bc
Merge pull request #8 from Team-Ampersand/fix/notice-button-click
Ethen1264 Sep 14, 2024
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
71 changes: 69 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
{
"extends": "next/core-web-vitals"
}
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["node_modules/**", "**/dist/**"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "import"],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"@typescript-eslint/no-empty-interface": "off",
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"react/react-in-jsx-scope": "off",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
]
}
],// ์ผ๋‹จ style์˜ ๊ฒฝ์šฐ {}๊ฐ™์€ ํ˜•์‹์œผ๋กœ ๋ถˆ๋Ÿฌ์˜ค๋Š” hook๋˜๋Š” ํ•จ์ˆ˜ ์‚ฌ์ด์— ์žˆ์–ด import์—์„œ ๊ฑธ๋ฆผ -> import๋ฅผ ์•„๋ž˜์ชฝ์œผ๋กœ ๋‚ด๋ ค ํ•ด๊ฒฐ
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],// ์‚ฌ์šฉํ•˜์ง€์•Š๋Š” ๊ธฐ๋Šฅ์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๊ฒฝ์šฐ -> ์‚ญ์ œ
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
],
// ์ˆ˜์ •ํ•ด์•ผํ•  ๋ถ€๋ถ„๋“ค
"no-empty": "off",// ๋Œ€๋ถ€๋ถ„ catch๋ผ์„œ off..
"react/prop-types": "off",// ์•„์ง ํŒŒ์•…์„ ์ œ๋Œ€๋กœ ํ•˜์ง€ ๋ชป ํ•จ
"prefer-const": "warn", //const๋กœ ๋ฐ”๊ฟ”๋„ ๋ฌธ์ œ๊ฐ€ ์—†๋Š” let
"no-extra-boolean-cast":"warn", // ๋ถˆํ•„์š”ํ•œ !!์‚ฌ์šฉ ํ•„์š”ํ•œ ๊ฒฝ์šฐ Boolean()์œผ๋กœ ๋ฐ”๊พธ๋Š”๊ฒŒ ๋” ์ข‹์„ ์ˆ˜๋„ ์žˆ์Œ
"no-constant-condition": "warn",// ํ•ญ์ƒ ๊ฒฐ๊ณผ๊ฐ€ ์ฐธ ๋˜๋Š” ๊ฑฐ์ง“์ž„
"@typescript-eslint/no-inferrable-types": "warn",//์ถ”๋ก  ๊ฐ€๋Šฅ ํƒ€์ž…
"@typescript-eslint/ban-types": "warn"// Object -> NonNullable<object>
}
}
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:dev": "env-cmd -f .env.development next build",
"start": "next start",
"lint": "next lint",
"analyze": "ANALYZE=true next build"
"analyze": "ANALYZE=true next build",
"prettier": "prettier --write **/*.{ts,tsx}"
},
"dependencies": {
"@emotion/css": "^11.10.5",
Expand All @@ -25,8 +26,6 @@
"axios": "^1.2.3",
"caniuse-lite": "^1.0.30001559",
"env-cmd": "^10.1.0",
"eslint": "8.32.0",
"eslint-config-next": "13.1.2",
"jwt-decode": "^3.1.2",
"lottie-react": "^2.4.0",
"msw": "^1.2.1",
Expand All @@ -47,6 +46,12 @@
"workerDirectory": "public"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.2.3"
"@next/bundle-analyzer": "^14.2.3",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"eslint": "8.32.0",
"eslint-config-next": "^14.2.6",
"eslint-config-prettier": "^9.1.0",
"prettier": "^3.3.3"
}
}
1 change: 1 addition & 0 deletions src/assets/svg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ export { default as NewPageIcon } from './NewPageIcon';
export { default as TrashcanIcon } from './TrashcanIcon';
export { default as SettingIcon } from './SettingIcon';
export { default as CircleDefaultProfile } from './CircleDefaultProfile';
export { default as BookBenIcon } from './BookBenIcon';
23 changes: 15 additions & 8 deletions src/components/Common/atoms/Calendar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { XtextIcon } from 'assets/svg';
import UseToggleTheme from 'hooks/useToggleTheme';
import Calendar from 'react-calendar';
import { useRecoilState } from 'recoil';
import { selectedDate } from 'recoilAtoms/recoilAtomContainer';
import UseToggleTheme from 'hooks/useToggleTheme';
import { XtextIcon } from 'assets/svg';
import * as S from './style';

const CalendarBox = ({ setModal }: { setModal?: (state: boolean) => void }) => {
const [date, setDate] = useRecoilState(selectedDate);
interface CalendarBoxProps {
selectedDate?: Date;
setSelectedDate?: React.Dispatch<React.SetStateAction<Date>>;
setModal?: (state: boolean) => void;
}

const CalendarBox = ({
selectedDate,
setSelectedDate,
setModal,
}: CalendarBoxProps) => {
const [theme] = UseToggleTheme();

return (
Expand All @@ -17,10 +24,10 @@ const CalendarBox = ({ setModal }: { setModal?: (state: boolean) => void }) => {
</S.XIcon>
)}
<Calendar
value={date}
value={selectedDate}
onChange={(value) => {
if (!(value instanceof Date)) return;
setDate(value);
setSelectedDate?.(value);
}}
locale="ko"
formatDay={(_locale, date) =>
Expand Down
7 changes: 1 addition & 6 deletions src/components/Common/atoms/Items/FilterItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { SearchFilterProps } from 'types';

const FilterItem = ({
name,
item,
value,
onClick,
}: SearchFilterProps) => {
const FilterItem = ({ name, item, value, onClick }: SearchFilterProps) => {
return (
<>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,24 @@ export const ModalOverayWrapper = styled.div`
visibility: ${(props: ModalStyleProps) =>
props.isClick ? 'visible' : 'hidden'};
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
inset: 0;
z-index: 2;
display: flex;
justify-content: center;
align-items: center;
background: hsla(235, 77%, 10%, 0.45);

@media (max-width: 950px) {
background: hsla(235, 77%, 10%, 0.70);
}
background: hsla(235, 77%, 10%, 0.7);
}
`;

export const ResponseOverayWrapper = styled.div`
@media (max-width: 950px) {
visibility: ${(props: ModalStyleProps) =>
props.isClick ? 'visible' : 'hidden'};
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
inset: 0;
z-index: 2;
display: flex;
justify-content: center;
Expand Down
40 changes: 13 additions & 27 deletions src/components/Common/molecules/ApplicationItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as S from './style';
import { DefaultProfile, FemaleIcon, MaleIcon, StampIcon } from 'assets/svg';
import SelfstudyCheck from 'components/SelfStudy/atoms/SelfstudyCheck/SelfstudyCheck';
import { ProfileImage } from 'components/Home/organisms/Profile/style';
import { ApplicationItemProps } from 'types';
import { useRecoilValue } from 'recoil';
import { selfStudyLookup } from 'recoilAtoms/recoilAtomContainer';
import { getRole } from 'utils/Libs/getRole';
import Image from 'next/image';
import Goldmedal from 'assets/png/GoldMedalIcon.png';
import Silvermedal from 'assets/png/SilverMedalIcon.png';
import GoldMedal from 'assets/png/GoldMedalIcon.png';
import SilverMedal from 'assets/png/SilverMedalIcon.png';
import BronzeMedal from 'assets/png/BronzeMedalIcon.png';
import { ProfileImage } from 'components/Home/organisms/Profile/style';
import * as S from './style';

const ApplicationItem = ({
id,
Expand All @@ -24,36 +24,18 @@ const ApplicationItem = ({
}: ApplicationItemProps) => {
const role = getRole();
const lookUp = useRecoilValue(selfStudyLookup);

const rankImages = [GoldMedal, SilverMedal, BronzeMedal];
return (
<S.ApplicationItemWrapper>
<S.Number>{rank}</S.Number>
{listType === 'selfstudy' && (
<>
{!lookUp && (
<S.Medal>
{rank === 1 && (
<Image
src={Goldmedal}
alt="goldmedal"
priority
width={44}
height={64}
/>
)}
{rank === 2 && (
<Image
src={Silvermedal}
alt="Silvermedal"
priority
width={44}
height={64}
/>
)}
{rank === 3 && (
{rank && rank <= 3 && (
<Image
src={BronzeMedal}
alt="BronzeMedal"
src={rankImages[rank - 1]}
alt="RankImage"
priority
width={44}
height={64}
Expand All @@ -74,7 +56,11 @@ const ApplicationItem = ({
</>
)}
<S.Profile>
{profileImage ? <ProfileImage image={profileImage} /> : <DefaultProfile />}
{profileImage ? (
<ProfileImage image={profileImage} />
) : (
<DefaultProfile />
)}
</S.Profile>
<S.StuInfo>
<S.Name>
Expand Down
26 changes: 10 additions & 16 deletions src/components/Common/molecules/NullApplicationItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
import * as S from './style';
import { CapIcon, CupIcon } from 'assets/svg';
import { NullApplicationItemProps } from 'types';

const NullApplicstionItem = ({ type }: NullApplicationItemProps) => {
interface Props {
message: string;
subMessage: string;
Icon: () => JSX.Element;
}

const NullApplicstionItem = ({ Icon, message, subMessage }: Props) => {
return (
<S.NullApplicstionWrapper>
{type === 'selfstudy' ? (
<>
<CapIcon />
<span>์ž์Šต ์‹ ์ฒญํ•œ ์ธ์›์ด ์—†์Šต๋‹ˆ๋‹ค..</span>
<p>ํ™ˆ์—์„œ ์ž์Šต ์‹ ์ฒญ์„ ํ•ด๋ณด์„ธ์š”!</p>
</>
) : (
<>
<CupIcon />
<span>์•ˆ๋งˆ์˜์ž๋ฅผ ์‹ ์ฒญํ•œ ์ธ์›์ด ์—†์Šต๋‹ˆ๋‹ค..</span>
<p>ํ™ˆ์—์„œ ์•ˆ๋งˆ์˜์ž ์‹ ์ฒญ์„ ํ•ด๋ณด์„ธ์š”!</p>
</>
)}
<Icon />
<span>{message}</span>
<p>{subMessage}</p>
</S.NullApplicstionWrapper>
);
};
Expand Down
46 changes: 26 additions & 20 deletions src/components/Common/molecules/SearchFilter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import { FilterMenuData } from 'assets/data/FilterMenuData';
import AuthInput from 'components/Common/atoms/Inputs/AuthInput';
import FilterItem from 'components/Common/atoms/Items/FilterItem';
import { ResponseOverayWrapper } from 'components/Common/atoms/Wrappers/ModalOverayWrapper/style';
import { useDidMountEffect } from 'hooks/useDidMountEffect';
import UseToggleTheme from 'hooks/useToggleTheme';
import { useState } from 'react';
import { useForm } from 'react-hook-form';
import AuthInput from 'components/Common/atoms/Inputs/AuthInput';
import FilterItem from 'components/Common/atoms/Items/FilterItem';
import { ResponseOverayWrapper } from 'components/Common/atoms/Wrappers/ModalOverayWrapper/style';
import { useRecoilState, useSetRecoilState } from 'recoil';
import { filterModal, selfStudyLookup } from 'recoilAtoms/recoilAtomContainer';
import { SearchFilterTypeProps, SignupForm } from 'types';
import { useDidMountEffect } from 'hooks/useDidMountEffect';
import { SearchFilterTypeProps } from 'types';
import { FilterMenuData } from 'assets/data/FilterMenuData';
import { isNotNull } from 'utils/isNotNull';
import * as S from './style';

const SearchFilter = ({ filterType, onSubmit }: SearchFilterTypeProps) => {
const [theme] = UseToggleTheme();
const [filterState, setFilterState] = useState<(string | undefined)[]>(
Array.from({ length: 5 }, () => undefined)
Array.from({ length: 5 }, () => undefined),
);
const [modalState, setModalState] = useRecoilState(filterModal);
const setLookUp = useSetRecoilState(selfStudyLookup);
const { register, setValue, watch, resetField } = useForm<SignupForm>({
defaultValues: { name: '' },

const { register, setValue, watch, resetField } = useForm({
defaultValues: {
name: '',
},
});

const handelResetClick = () => {
Expand All @@ -41,8 +44,8 @@ const SearchFilter = ({ filterType, onSubmit }: SearchFilterTypeProps) => {
value === '๋‚จ์ž'
? (value = 'MAN')
: value === '์—ฌ์ž'
? (value = 'WOMAN')
: '';
? (value = 'WOMAN')
: '';
const copy = [...filterState];
copy[idx] = filterState[idx] === value ? undefined : value;
setFilterState(copy);
Expand Down Expand Up @@ -72,17 +75,20 @@ const SearchFilter = ({ filterType, onSubmit }: SearchFilterTypeProps) => {
/>
</S.SearchBox>
<S.SelectWrapper>
{FilterMenuData.map((i, idx) => (
<S.Select key={idx} isShow={i.show.includes(filterType)}>
<span>{i.filterTitle}</span>
{FilterMenuData.map((filterItem, idx) => (
<S.Select
key={filterItem.filterTitle}
isShow={filterItem.show.includes(filterType)}
>
<span>{filterItem.filterTitle}</span>
<S.SelectBox darkmode={theme}>
{i.filterList.map((j, ind) => (
{filterItem.filterList.map((list) => (
<FilterItem
key={ind}
name={i.filterTitle}
item={j}
key={list}
item={list}
name={filterItem.filterTitle}
value={filterState[idx]}
onClick={() => filterChange(idx, j)}
onClick={() => filterChange(idx, list)}
/>
))}
</S.SelectBox>
Expand All @@ -93,7 +99,7 @@ const SearchFilter = ({ filterType, onSubmit }: SearchFilterTypeProps) => {
onClick={() => setModalState(false)}
modalState={modalState}
>
<span>๋‹ซ๊ธฐ</span>
๋‹ซ๊ธฐ
</S.ApplyBtn>
</S.FilterWrapper>
<ResponseOverayWrapper
Expand Down
Loading
Loading