Skip to content

Commit

Permalink
refactor: eslint, prettier 재설정 (#51)
Browse files Browse the repository at this point in the history
* feat: tailwind pretendard 폰트 설정

* refactor: lint, prettier 설정
  • Loading branch information
daun-up authored Sep 18, 2024
1 parent b0bd55f commit 1d785e5
Show file tree
Hide file tree
Showing 48 changed files with 698 additions and 222 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["prettier"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off"
}
}
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 80,
"trailingComma": "all",
"singleQuote": true,
"tabWidth": 2,
"semi": true,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
Binary file added public/about-us/we/aboutus_0.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/about-us/we/aboutus_1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/about-us/we/image 24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/about-us/we/image 25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/api/domain/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export class Auth {
return this.request.post('/auth/register/code', data);
}

public async verifyCode(data: VerifyCodeRequestDto): Promise<VerifyCodeResponseDto> {
public async verifyCode(
data: VerifyCodeRequestDto,
): Promise<VerifyCodeResponseDto> {
return this.request.post('/auth/register/code/verify', data);
}

Expand Down
31 changes: 23 additions & 8 deletions src/api/domain/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ export class Member {
return this.request.put('/member/me/info', data);
}

public async updateMyPassword(data: UpdateMyPasswordRequestDto): Promise<void> {
public async updateMyPassword(
data: UpdateMyPasswordRequestDto,
): Promise<void> {
return this.request.patch('/member/me/password', data);
}

public async updateMyAvatar(avatar: File): Promise<UpdateMyAvatarResponseDto> {
public async updateMyAvatar(
avatar: File,
): Promise<UpdateMyAvatarResponseDto> {
const data = new FormData();
data.append('avatar', avatar);

Expand All @@ -34,11 +38,15 @@ export class MemberAdmin {
return this.request.get('/admin/member/waiting');
}

public async approveWaitingMember(data: ApproveWaitingMemberRequestDto): Promise<void> {
public async approveWaitingMember(
data: ApproveWaitingMemberRequestDto,
): Promise<void> {
return this.request.post('/admin/member/waiting/approve', data);
}

public async rejectWaitingMember(data: RejectWaitingMemberRequestDto): Promise<void> {
public async rejectWaitingMember(
data: RejectWaitingMemberRequestDto,
): Promise<void> {
return this.request.post('/admin/member/waiting/reject', data);
}

Expand All @@ -52,11 +60,15 @@ export class MemberAdmin {
return this.request.get('/admin/member?page=' + data.page);
}

public async searchMembers(data: SearchMembersRequestDto): Promise<SearchMembersResponseDto> {
public async searchMembers(
data: SearchMembersRequestDto,
): Promise<SearchMembersResponseDto> {
return this.request.get('/admin/member/search?query=' + data.query);
}

public async updateMemberRole(data: UpdateMemberRoleRequestDto): Promise<void> {
public async updateMemberRole(
data: UpdateMemberRoleRequestDto,
): Promise<void> {
return this.request.patch('/admin/member/role', data);
}

Expand Down Expand Up @@ -118,7 +130,8 @@ export interface EachGetMembersResponseDto {
role: RoleString;
}

export interface EachGetMembersForAdminResponseDto extends EachGetMembersResponseDto {
export interface EachGetMembersForAdminResponseDto
extends EachGetMembersResponseDto {
email: string;
studentId: string;
fee: boolean;
Expand Down Expand Up @@ -192,7 +205,9 @@ export const RoleKoreanMap: Record<RoleString, string> = {
export const RoleKorean = Object.values(RoleKoreanMap);

export const RoleKoreanToRole = (role: string): Role => {
const key = Object.keys(RoleKoreanMap).find((key) => RoleKoreanMap[key as RoleString] === role);
const key = Object.keys(RoleKoreanMap).find(
key => RoleKoreanMap[key as RoleString] === role,
);
return Role[key as RoleString];
};

Expand Down
20 changes: 15 additions & 5 deletions src/api/domain/activity/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,37 @@ import { MemberType, WinkApiRequest } from '@/api';
export class Project {
constructor(private readonly request: WinkApiRequest) {}

public async getProject(data: GetProjectRequestDto): Promise<GetProjectResponseDto> {
return this.request.get('/activity/project/detail?projectId=' + data.projectId);
public async getProject(
data: GetProjectRequestDto,
): Promise<GetProjectResponseDto> {
return this.request.get(
'/activity/project/detail?projectId=' + data.projectId,
);
}

public async getProjectsPage(): Promise<GetProjectsPageResponseDto> {
return this.request.get('/activity/project/max');
}

public async getProjects(data: GetProjectsRequestDto): Promise<GetProjectsResponseDto> {
public async getProjects(
data: GetProjectsRequestDto,
): Promise<GetProjectsResponseDto> {
return this.request.get('/activity/project?page=' + data.page);
}

public async searchProjects(data: SearchProjectsRequestDto): Promise<GetProjectsResponseDto> {
public async searchProjects(
data: SearchProjectsRequestDto,
): Promise<GetProjectsResponseDto> {
return this.request.get('/activity/project/search?query=' + data.query);
}
}

export class ProjectAdmin {
constructor(private readonly request: WinkApiRequest) {}

public async createProject(data: CreateProjectRequestDto): Promise<CreateProjectResponseDto> {
public async createProject(
data: CreateProjectRequestDto,
): Promise<CreateProjectResponseDto> {
return this.request.put('/admin/activity/project', data);
}

Expand Down
20 changes: 15 additions & 5 deletions src/api/domain/activity/Social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,37 @@ import { WinkApiRequest } from '@/api';
export class Social {
constructor(private readonly request: WinkApiRequest) {}

public async getSocial(data: GetSocialRequestDto): Promise<GetSocialResponseDto> {
return this.request.get('/activity/social/detail?socialId=' + data.socialId);
public async getSocial(
data: GetSocialRequestDto,
): Promise<GetSocialResponseDto> {
return this.request.get(
'/activity/social/detail?socialId=' + data.socialId,
);
}

public async getSocialsPage(): Promise<GetSocialsPageResponseDto> {
return this.request.get('/activity/social/max');
}

public async getSocials(data: GetSocialsRequestDto): Promise<GetSocialsResponseDto> {
public async getSocials(
data: GetSocialsRequestDto,
): Promise<GetSocialsResponseDto> {
return this.request.get('/activity/social?page=' + data.page);
}

public async searchSocials(data: SearchSocialsRequestDto): Promise<GetSocialsResponseDto> {
public async searchSocials(
data: SearchSocialsRequestDto,
): Promise<GetSocialsResponseDto> {
return this.request.get('/activity/social/search?query=' + data.query);
}
}

export class SocialAdmin {
constructor(private readonly request: WinkApiRequest) {}

public async createSocial(data: CreateSocialRequestDto): Promise<CreateSocialResponseDto> {
public async createSocial(
data: CreateSocialRequestDto,
): Promise<CreateSocialResponseDto> {
return this.request.put('/admin/activity/social', data);
}

Expand Down
16 changes: 12 additions & 4 deletions src/api/domain/activity/Study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@ export class Study {
return this.request.get('/activity/study/max');
}

public async getStudies(data: GetStudiesRequestDto): Promise<GetStudiesResponse> {
public async getStudies(
data: GetStudiesRequestDto,
): Promise<GetStudiesResponse> {
return this.request.get('/activity/study?page=' + data.page);
}

public async searchStudies(data: SearchStudiesRequestDto): Promise<GetStudiesResponse> {
public async searchStudies(
data: SearchStudiesRequestDto,
): Promise<GetStudiesResponse> {
return this.request.get('/activity/study/search?query=' + data.query);
}
}

export class StudyAdmin {
constructor(private readonly request: WinkApiRequest) {}

public async createCategory(data: CreateCategoryRequestDto): Promise<CreateCategoryResponseDto> {
public async createCategory(
data: CreateCategoryRequestDto,
): Promise<CreateCategoryResponseDto> {
return this.request.put('/admin/activity/study/category', data);
}

Expand All @@ -35,7 +41,9 @@ export class StudyAdmin {
return this.request.delete('/admin/activity/study/category', data);
}

public async createStudy(data: CreateStudyRequestDto): Promise<CreateStudyResponseDto> {
public async createStudy(
data: CreateStudyRequestDto,
): Promise<CreateStudyResponseDto> {
return this.request.put('/admin/activity/study', data);
}

Expand Down
9 changes: 6 additions & 3 deletions src/api/request/WinkApiRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ export class WinkApiRequest {

private async refresh(): Promise<boolean> {
try {
const { accessToken, refreshToken } = await this.post<RefreshResponseDto>('/auth/refresh', {
refreshToken: this.refreshToken,
});
const { accessToken, refreshToken } = await this.post<RefreshResponseDto>(
'/auth/refresh',
{
refreshToken: this.refreshToken,
},
);

this.setToken(accessToken, refreshToken);

Expand Down
26 changes: 26 additions & 0 deletions src/app/about-us/_components/ActivicyCard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// components/CardLayout.js
import Image from 'next/image';

const ActivityCard = ({ imageSrc, title, description, isImageRight }) => {
return (
<div
className={`flex ${isImageRight ? 'flex-row-reverse' : 'flex-row'} items-center my-8`}
>
<div className="w-1/2">
<Image
src={imageSrc}
alt={title}
width={500}
height={300}
className="object-cover rounded-lg"
/>
</div>
<div className="w-1/2 px-6">
<h3 className="text-xl font-bold text-blue-500 mb-4">{title}</h3>
<p className="text-gray-600">{description}</p>
</div>
</div>
);
};

export default ActivityCard;
37 changes: 27 additions & 10 deletions src/app/about-us/member/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ const MEMBERS = [
description: '비품 및 회비 관리, 도서 신청 및 대출 관리',
filter: (member: EachGetMembersResponseDto) =>
member.role === 'TREASURY_HEAD' || member.role === 'TREASURY_ASSISTANT',
sort: (a: EachGetMembersResponseDto) => (a.role === 'TREASURY_HEAD' ? -1 : 1),
sort: (a: EachGetMembersResponseDto) =>
a.role === 'TREASURY_HEAD' ? -1 : 1,
},
{
title: '홍보부',
description: '동아리 홍보 및 홍보물 제작, SNS 관리',
filter: (member: EachGetMembersResponseDto) =>
member.role === 'PUBLIC_RELATIONS_HEAD' || member.role === 'PUBLIC_RELATIONS_ASSISTANT',
sort: (a: EachGetMembersResponseDto) => (a.role === 'PUBLIC_RELATIONS_HEAD' ? -1 : 1),
member.role === 'PUBLIC_RELATIONS_HEAD' ||
member.role === 'PUBLIC_RELATIONS_ASSISTANT',
sort: (a: EachGetMembersResponseDto) =>
a.role === 'PUBLIC_RELATIONS_HEAD' ? -1 : 1,
},
{
title: '기획부',
description: '동아리 행사 기획 및 진행, 회의록 작성',
filter: (member: EachGetMembersResponseDto) =>
member.role === 'PLANNING_HEAD' || member.role === 'PLANNING_ASSISTANT',
sort: (a: EachGetMembersResponseDto) => (a.role === 'PLANNING_HEAD' ? -1 : 1),
sort: (a: EachGetMembersResponseDto) =>
a.role === 'PLANNING_HEAD' ? -1 : 1,
},
];

Expand All @@ -51,7 +55,12 @@ const AboutUsMemberPage = () => {
return (
<div className="flex flex-col items-center mt-32">
<div className="flex flex-col items-center justify-center gap-2">
<Image src={cloudImage} alt="cloud" width={224} className="w-56 animate-updown" />
<Image
src={cloudImage}
alt="cloud"
width={224}
className="w-56 animate-updown"
/>
<h1 className="font-roboto font-extrabold text-5xl lg:text-7xl text-wink-200 tracking-wider">
NEW WAVE IN US
</h1>
Expand All @@ -71,8 +80,12 @@ const AboutUsMemberPage = () => {

<div className="flex flex-wrap justify-center gap-4 px-12">
{members
.filter((member) => member.role === 'PRESIDENT' || member.role === 'VICE_PRESIDENT')
.sort((a) => (a.role === 'PRESIDENT' ? -1 : 1))
.filter(
member =>
member.role === 'PRESIDENT' ||
member.role === 'VICE_PRESIDENT',
)
.sort(a => (a.role === 'PRESIDENT' ? -1 : 1))
.map(({ _id, name, avatar, description, link, role }) => (
<ProfileCard
key={_id}
Expand All @@ -92,8 +105,12 @@ const AboutUsMemberPage = () => {
<div className="flex flex-row items-start gap-8">
{MEMBERS.map(({ title, description, filter, sort }) => (
<div className="flex flex-col items-center justify-center gap-6">
<h1 className="font-bold text-3xl text-center">&lt;{title}&gt;</h1>
<p className="font-regular text-lg text-center text-zinc-700]">{description}</p>
<h1 className="font-bold text-3xl text-center">
&lt;{title}&gt;
</h1>
<p className="font-regular text-lg text-center text-zinc-700]">
{description}
</p>

<div className="flex flex-col gap-6">
{members
Expand All @@ -119,7 +136,7 @@ const AboutUsMemberPage = () => {
<div className="mt-16">
<div className="flex flex-wrap justify-center gap-4 px-12">
{members
.filter((member) => member.role === 'MEMBER')
.filter(member => member.role === 'MEMBER')
.sort((a, b) => a.name.localeCompare(b.name))
.map(({ _id, name, avatar, description, link }) => (
<ProfileCard
Expand Down
Loading

0 comments on commit 1d785e5

Please sign in to comment.