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

πŸ”€ Deploy #294

Merged
merged 54 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 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
6900e8e
πŸ’„ FIx:stuinfo page layout style
ws-071211 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
1d5df5c
πŸ’„Add: styles for publishing
Ethen1264 Sep 15, 2024
4f4f0f7
Merge pull request #291 from Team-Ampersand/develop
mini-aron Sep 15, 2024
0482265
Merge pull request #7 from Team-Ampersand/fix/stuinfo
ws-071211 Sep 22, 2024
55cb942
Merge branch 'develop' of https://github.com/Team-Ampersand/Dotori-cl…
Ethen1264 Sep 26, 2024
596464c
✨Add: like functionality
Ethen1264 Sep 26, 2024
70ad334
πŸ”§Refactor: Separate UI state from API layer
Ethen1264 Sep 27, 2024
273dd10
♻️Refactor: Apply RORO pattern to likeMusic function
Ethen1264 Sep 27, 2024
d602a14
🎨Update: Refine SVG styling for TrashcanIcon in MusicListButton
Ethen1264 Sep 27, 2024
849774f
Merge pull request #9 from Team-Ampersand/feature/song-like
Ethen1264 Sep 28, 2024
6978063
Merge pull request #293 from Team-Ampersand/develop
Ethen1264 Sep 29, 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"
}
}
30 changes: 30 additions & 0 deletions src/api/music.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,33 @@ export const deleteMusic = async (role: string, musicId: number) => {
return false;
}
};

export const likeMusic = async ({
role,
musicId,
}: {
role: string;
musicId: number;
}) => {
const response = await apiClient.patch(
SongController.likeMusic(role, musicId),
);
return response.data;
};

export const getLikeMusic = async ({
role,
date,
}: {
role: string;
date: string;
}) => {
try {
const { data } = await apiClient.get(SongController.getlikeMusic(role), {
params: {
date: date,
},
});
return data;
} catch (e: any) {}
};
21 changes: 21 additions & 0 deletions src/assets/svg/ArrowDown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const ArrowDown = () => {
return (
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M3.33301 5.6665L7.99967 10.3332L12.6663 5.6665"
stroke="#656B80"
strokeWidth="1.33333"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
};

export default ArrowDown;
31 changes: 31 additions & 0 deletions src/assets/svg/HeartIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Palette } from 'styles/globals';

interface HeartIconProps {
heartState: boolean;
}

const HeartIcon = ({ heartState }: HeartIconProps) => {
const fillColor = heartState ? `${Palette.PRIMARY_P10}` : 'none';
const strokeColor = heartState ? `${Palette.PRIMARY_P10}` : '#656B80';

return (
<svg
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M21.667 8.25C21.667 5.765 19.568 3.75 16.979 3.75C15.044 3.75 13.382 4.876 12.667 6.483C11.952 4.876 10.29 3.75 8.35399 3.75C5.76699 3.75 3.66699 5.765 3.66699 8.25C3.66699 15.47 12.667 20.25 12.667 20.25C12.667 20.25 21.667 15.47 21.667 8.25Z"
stroke={strokeColor}
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
fill={fillColor}
/>
</svg>
);
};

export default HeartIcon;
32 changes: 0 additions & 32 deletions src/assets/svg/NewPageIcon.tsx

This file was deleted.

4 changes: 3 additions & 1 deletion src/assets/svg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export { default as EyeIcon } from './EyeIcon';
export { default as EyeSelectedIcon } from './EyeSelectedIcon';
export { default as MusicalNoteIcon } from './MusicNoteIcon';
export { default as EllipsisVerticalIcon } from './EllipsisVerticalIcon';
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';
export { default as HeartIcon } from './HeartIcon';
export { default as ArrowDown } from './ArrowDown';
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
Loading
Loading