-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from KNU-HAEDAL/develop
개발 진행상황 합치기
- Loading branch information
Showing
37 changed files
with
1,271 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: ESLint test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Pnpm package manager | ||
run: | | ||
npm install -g pnpm | ||
- name: Install Dependencies | ||
run: pnpm install | ||
|
||
- name: Lint Code | ||
run: pnpm lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ChallengeListResponse } from './getChallengeList.response'; | ||
import { axiosClient } from '@/apis/AxiosClient'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
const getChallengeListPath = () => '/api/challengeGroups/shorts'; | ||
|
||
const challengeListQueryKey = [getChallengeListPath()]; | ||
|
||
const getChallengeList = async ( | ||
page: number, | ||
size: number | ||
): Promise<ChallengeListResponse> => { | ||
const response = await axiosClient.get(getChallengeListPath(), { | ||
params: { | ||
page, | ||
size, | ||
}, | ||
}); | ||
return response.data; | ||
}; | ||
|
||
export const useGetChallengeList = (page: number, size: number) => { | ||
return useQuery<ChallengeListResponse, Error>({ | ||
queryKey: [challengeListQueryKey, page, size], | ||
queryFn: () => getChallengeList(page, size), | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import ApiResponse from '@/apis/ApiResponse'; | ||
|
||
export type ChallengeListData = { | ||
totalPage: number; | ||
hasNext: boolean; | ||
data: { | ||
id: number; | ||
title: string; | ||
content: string; | ||
participantCount: number; | ||
startDate: string; | ||
endDate: string; | ||
category: 'HEALTH' | 'ECHO' | 'SHARE' | 'VOLUNTEER' | 'ETC'; | ||
}[]; | ||
}; | ||
|
||
export type ChallengeListResponse = ApiResponse<ChallengeListData>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Chip = styled.div<{ margin?: string; color?: string }>` | ||
padding: 4px 12px; | ||
border-radius: 50px; | ||
border: ${({ color }) => | ||
color ? `${color} 0.5px solid` : `var(--color-green-01) 0.5px solid`}; | ||
background-color: var(--color-white); | ||
color: ${({ color }) => (color ? color : `var(--color-green-01)`)}; | ||
font-size: var(--font-size-xs); | ||
font-weight: 600; | ||
text-align: center; | ||
margin: ${({ margin }) => (margin ? `${margin}` : null)}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import UserImage from '@/assets/UserImage.svg'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const ProfileImage = styled.div<{ size?: number; src?: string }>` | ||
width: ${({ size }) => (size ? `${size}rem` : '3rem')}; | ||
height: ${({ size }) => (size ? `${size}rem` : '3rem')}; | ||
aspect-ratio: 1 / 1; | ||
border-radius: 50%; | ||
background-image: url(${({ src }) => src || UserImage}); | ||
background-size: cover; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.