generated from AND-SOPT-ANDROID/and-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: 3주차 필수 과제 #6
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b8df27e
docs: 3주차 과제
wjdrjs00 cc48bdf
docs: 이미지 수정
wjdrjs00 976dd26
docs: 간격 수정
wjdrjs00 2ca2b34
feat(extension): snackBar 확장함수 추가
wjdrjs00 b5484eb
docs: 문서 수정
wjdrjs00 e946b6b
refactor(signup): 이메일, 패스워드 형식 검증 로직 분리
wjdrjs00 69bda83
chore: 간단한 명명 수정
wjdrjs00 8cb994f
fix(core): SnackBar 제거
wjdrjs00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,22 @@ | ||
package org.sopt.and.core.extension | ||
|
||
import androidx.compose.material3.SnackbarHostState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.Modifier | ||
|
||
@Composable | ||
fun Modifier.showSnackbarEffect( | ||
message: String, | ||
snackbarHostState: SnackbarHostState, | ||
onMessageShown: () -> Unit = {} | ||
) = this.then( | ||
Modifier.apply { | ||
if (message.isNotEmpty()) { | ||
LaunchedEffect(snackbarHostState) { | ||
snackbarHostState.showSnackbar(message) | ||
onMessageShown() | ||
} | ||
} | ||
} | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어 .. 이 코드에 대해 설명해주실 수 있을까요 ?? Modifier.으로 시작하는 함수를 처음봐서요 ! |
wjdrjs00 marked this conversation as resolved.
Show resolved
Hide resolved
|
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,64 @@ | ||
# 3주차 필수 과제 | ||
|
||
## 과제 | ||
|
||
- [x] 지금까지 과제로 진행한 뷰에 대해서 실습 때 진행한 플로우를 바탕으로 컴포넌트화 및 UI단 설계를 진행해주세요. | ||
- (홈, MY, 로그인, 회원가입 필수 검색 선택) | ||
|
||
| 회원가입 | 로그인 | 홈 | MY | | ||
|:----------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------| | ||
| <img src="https://github.com/user-attachments/assets/843c8ea9-e6ee-4e99-9462-16533232f9aa" alt="회원가입 화면" width="250"> | <img src="https://github.com/user-attachments/assets/7d058ee8-d3db-459c-98c2-99b7c132d879" alt="로그인 화면" width="250"> | <img src="https://github.com/user-attachments/assets/5df0a20f-6e12-4b07-82b5-695dba6eb5ee" alt="홈 화면" width="250"> | <img src="https://github.com/user-attachments/assets/e6b323b0-462f-41ff-8b81-c153a52208ef" alt="MY 화면" width="250"> | | ||
|
||
<br> | ||
|
||
## 1. 공통 컴포넌트 찾기 | ||
|
||
<img width="1055" alt="공통 컴포넌트" src="https://github.com/user-attachments/assets/cf552486-2dd2-4698-b767-6a3d22552265"> | ||
|
||
- 공통 컴포넌트 추출 기준은 두 화면이상 공통적으로 보이는 컴포넌트 기준으로 추출해봤습니다. | ||
- text는 text색상별로 컴포넌트화 해보면 어떨까? 하는 생각으로 한번 추출해 봤습니다. | ||
- ex) `whiteText()` / `grayText()` | ||
|
||
<br> | ||
|
||
## 2. 뷰 스케치 및 각 화면 컴포넌트화 | ||
|
||
| 회원가입 | 로그인 | | ||
|:-------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------| | ||
| <img width="500" alt="회원가입 뷰 스케치" src="https://github.com/user-attachments/assets/a2675b7f-952b-4956-b23a-005003941058"> | <img width="500" alt="로그인 뷰 스케치" src="https://github.com/user-attachments/assets/0c3d49c8-e50c-4d1c-8225-07973cc6f175"> | | ||
| 홈 | MY | | ||
| <img width="520" alt="홈 뷰 스케치" src="https://github.com/user-attachments/assets/0ea3b906-3209-4615-8a54-a37c2f5540f4"> | <img width="480" alt="MY 뷰 스케치" src="https://github.com/user-attachments/assets/626cb726-0507-4530-8cd9-ea6716a9addc"> | | ||
|
||
<br> | ||
|
||
## 3. UI 로직 설계 | ||
|
||
| 회원가입 | 로그인 | | ||
|:----------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------| | ||
| <img width="500" alt="회원가입 UI 로직 설계" src="https://github.com/user-attachments/assets/b862a7d2-32f3-4d86-99cd-a4f0437808a2"> | <img width="500" alt="로그인 로직설계" src="https://github.com/user-attachments/assets/5fde7f8e-2441-4be6-bf9e-da6de88a6e5b"> | | ||
| 홈 | MY | | ||
| <img width="500" alt="홈 UI 로직 설계" src="https://github.com/user-attachments/assets/6d4c66f1-3fb9-4b33-b2d0-c148831fd228"> | <img width="500" alt="My UI 로직 설계" src="https://github.com/user-attachments/assets/8d40dbfe-96bc-49b4-9fdc-9aba98159155"> | | ||
|
||
<br> | ||
|
||
## 4. 공통되는 로직 확장함수화 | ||
|
||
- 오류메시지 출력 부분 (snackbar) | ||
|
||
```kotlin | ||
@Composable | ||
fun Modifier.showSnackbarEffect( | ||
message: String, | ||
snackbarHostState: SnackbarHostState, | ||
onMessageShown: () -> Unit = {} | ||
) = this.then( | ||
Modifier.apply { | ||
if (message.isNotEmpty()) { | ||
LaunchedEffect(snackbarHostState) { | ||
snackbarHostState.showSnackbar(message) | ||
onMessageShown() | ||
} | ||
} | ||
} | ||
) | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 확장함수는 어떤 것을 의도하려고 하는지 가늠이 안되네요....message를 변경시킬 때 showSnackbar를 호출하는건지, snackbarHostState가 변경될때 showSnackbar를 호출하는건지, 그리고 onMessageShown은 왜 있는건지 다 명확한 이유가 없는 것 같습니다...한번 함수 설계를 다시 해보시는 것을 권장드립니다.
이게 Modifier에 체이닝 되어야 하는것인지, 그렇다면 왜 그래야 하는지부터 생각해보면 좋을 것 같아요.