-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/bodyBudy/bodyBuddy into …
…develop
- Loading branch information
Showing
24 changed files
with
846 additions
and
290 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
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 |
---|---|---|
@@ -1,7 +1,35 @@ | ||
interface post { | ||
content: string; | ||
creationDate: Date; | ||
fieldId: string; | ||
images: string | string[]; | ||
title: string; | ||
totalComments: number; | ||
userId: string; | ||
} | ||
|
||
interface review { | ||
content: string; | ||
creationDate: Date; | ||
isActivation: boolean; | ||
rating: number; | ||
userId: string; | ||
trainerInfo: trainer; | ||
} | ||
|
||
interface trainer { | ||
trainerId: string; | ||
image: string; | ||
name: string; | ||
fieldId: string; | ||
introduction: string; | ||
} | ||
|
||
interface EditorGroupProps { | ||
selectedItem: string; | ||
className: string; | ||
leftUrl?: string; | ||
EditorURL?: string; | ||
lastEdited?: reveiw | post; | ||
onChangeEditingMode?: Dispatch<SetStateAction<boolean>>; | ||
onChangeDeleteMode: Dispatch<SetStateAction<boolean>>; | ||
} |
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,27 @@ | ||
import Image from 'next/image'; | ||
import { ChangeEvent } from 'react'; | ||
import { StyledImageUploader } from './styledProfile'; | ||
|
||
export const ProfileUploader = ({ profile, setProfile }: ProfileProps) => { | ||
const uploadImage = (e: ChangeEvent<HTMLInputElement>) => { | ||
e.target.files && setProfile(URL.createObjectURL(e.target.files[0])); | ||
}; | ||
|
||
return ( | ||
<StyledImageUploader> | ||
<div className={profile ? 'uploaded' : ''}> | ||
{profile ? ( | ||
<> | ||
<Image src={profile} alt="프로필" width={'125px'} height={'125px'} /> | ||
<button onClick={() => setProfile('')}></button> | ||
</> | ||
) : ( | ||
<> | ||
<label htmlFor="profile"></label> | ||
<input type="file" id="profile" name="file" onChange={uploadImage} /> | ||
</> | ||
)} | ||
</div> | ||
</StyledImageUploader> | ||
); | ||
}; |
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,4 @@ | ||
interface ProfileProps { | ||
profile: string; | ||
setProfile: Dispatch<SetStateAction<string>>; | ||
} |
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,33 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const StyledImageUploader = styled.div` | ||
margin: 0 auto; | ||
width: 125px; | ||
.uploaded { | ||
position: relative; | ||
} | ||
button { | ||
position: absolute; | ||
right: -10px; | ||
top: -10px; | ||
width: 25px; | ||
height: 25px; | ||
background: url('/assets/common/button-delete.svg') no-repeat; | ||
cursor: pointer; | ||
} | ||
label { | ||
display: inline-block; | ||
cursor: pointer; | ||
background: center url('/assets/common/profile.svg') no-repeat; | ||
width: 125px; | ||
height: 125px; | ||
border-radius: 50%; | ||
} | ||
input[type='file'] { | ||
display: none; | ||
} | ||
`; |
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,7 @@ | ||
interface RatingGroupProps { | ||
isEditingMode: boolean; | ||
onChangeRating?: ChangeEvent<HTMLInputElement>; | ||
star?: number; | ||
width: number; | ||
height: number; | ||
} |
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,4 @@ | ||
interface ImageUploaderProps { | ||
url: string[]; | ||
setImageUrl: Dispatch<SetStateAction<string[]>>; | ||
} |
Oops, something went wrong.