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

๐Ÿ”€ :: [#74] ์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ ํŽ˜์ด์ง€ ํผ๋ธ”๋ฆฌ์‹ฑ #75

Merged
merged 6 commits into from
Jan 12, 2025

Conversation

Xixn2
Copy link
Member

@Xixn2 Xixn2 commented Jan 12, 2025

๐Ÿ’ก ๊ฐœ์š”

์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ ํŽ˜์ด์ง€ ํผ๋ธ”๋ฆฌ์‹ฑ

๐Ÿ“ƒ ์ž‘์—…๋‚ด์šฉ

  • ์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ ํŽ˜์ด์ง€ ํผ๋ธ”๋ฆฌ์‹ฑ ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • SceneApplicationInfoListDetail ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ์ž‘ ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ExpoProgramDetail ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ์ž‘ ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • InfoListView์™€ SceneApplicationInfoListView๋ฅผ ์žฌ ์‚ฌ์šฉ ํ•  ์ˆ˜ ์žˆ๋„๋ก Func์—์„œ Struct๋กœ ๋ณ€๊ฒฝ ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐ŸŽธ ๊ธฐํƒ€

2025-01-12.8.24.53.mov

Summary by CodeRabbit

  • ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ

    • ์‚ฌ์šฉ์ž ๊ด€๋ฆฌ ํ™”๋ฉด ์ถ”๊ฐ€
    • ํ”„๋กœ๊ทธ๋žจ ์ƒ์„ธ ๋ณด๊ธฐ ๊ธฐ๋Šฅ ๊ฐœ์„ 
    • ์ฐธ๊ฐ€์ž ์ •๋ณด ๋ชฉ๋ก ๋ ˆ์ด์•„์›ƒ ์—…๋ฐ์ดํŠธ
  • ๋””์ž์ธ ์‹œ์Šคํ…œ

    • ์ƒˆ๋กœ์šด ์•„์ด์ฝ˜ ๋ฐ ๋ฒ„ํŠผ ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
    • ์ •๋ณด ๋ชฉ๋ก ๋ฐ ์ƒ์„ธ ๋ณด๊ธฐ ์ปดํฌ๋„ŒํŠธ ๊ฐœ์„ 
  • ๋ฒ„๊ทธ ์ˆ˜์ •

    • ํ”„๋กœ๊ทธ๋žจ ์ƒ์„ธ ๋ณด๊ธฐ์˜ ๋ ˆ์ด์•„์›ƒ ๋ฐ ์Šคํฌ๋กค ๊ธฐ๋Šฅ ์ตœ์ ํ™”

@Xixn2 Xixn2 added 2๏ธโƒฃ Priority: Medium ์šฐ์„ ์ˆœ์œ„ - ์ค‘ โœจ Feature ์‹ ๊ทœ ๊ธฐ๋Šฅ labels Jan 12, 2025
@Xixn2 Xixn2 requested a review from uuuunseo January 12, 2025 11:27
@Xixn2 Xixn2 self-assigned this Jan 12, 2025
Copy link

coderabbitai bot commented Jan 12, 2025

Walkthrough

์ด ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋Š” ์•ฑ์˜ ๋””์ž์ธ ์‹œ์Šคํ…œ๊ณผ ์‚ฌ์šฉ์ž ๊ด€๋ฆฌ ๊ธฐ๋Šฅ์— ๋Œ€ํ•œ ์—ฌ๋Ÿฌ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ํฌํ•จํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ƒˆ๋กœ์šด ์ด๋ฏธ์ง€ ์—์…‹๊ณผ ํ•จ๊ป˜ InfoListView, SceneApplicationInfoListView, SceneApplicationInfoListDetail ๋“ฑ์˜ ์ƒˆ๋กœ์šด SwiftUI ๋ทฐ๊ฐ€ ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ExpoProgramDetail ๋ทฐ์—๋Š” ํ‡ด์‹ค ์‹œ๊ฐ„ ์†์„ฑ์ด ์ถ”๊ฐ€๋˜์—ˆ์œผ๋ฉฐ, ProgramDetailView์™€ UserManagementView์˜ ๋ ˆ์ด์•„์›ƒ์ด ์—…๋ฐ์ดํŠธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Changes

ํŒŒ์ผ ๋ณ€๊ฒฝ ์š”์•ฝ
Projects/App/Resources/Assets.xcassets/blackBottomButton.imageset/Contents.json ์ƒˆ ์ด๋ฏธ์ง€ ์—์…‹ JSON ํŒŒ์ผ ์ถ”๊ฐ€
Projects/App/Resources/Assets.xcassets/okIcon.imageset/Contents.json ์ƒˆ ์ด๋ฏธ์ง€ ์—์…‹ JSON ํŒŒ์ผ ์ถ”๊ฐ€
Projects/App/Sources/DesignSystem/InfoList/InfoListView.swift ์ƒˆ๋กœ์šด ์ •๋ณด ๋ชฉ๋ก ๋ทฐ ์ƒ์„ฑ
Projects/App/Sources/DesignSystem/InfoList/SceneApplicationInfoListView.swift ์ƒˆ๋กœ์šด ํ˜„์žฅ ์‹ ์ฒญ ์ •๋ณด ๋ชฉ๋ก ๋ทฐ ์ƒ์„ฑ
Projects/App/Sources/DesignSystem/Program/ExpoProgramDetail.swift ํ‡ด์‹ค ์‹œ๊ฐ„ ์†์„ฑ ์ถ”๊ฐ€ ๋ฐ ๋ ˆ์ด์•„์›ƒ ์ˆ˜์ •
Projects/App/Sources/DesignSystem/Program/SceneApplicationInfoListDetail.swift ์ƒˆ๋กœ์šด ํ˜„์žฅ ์‹ ์ฒญ ์ •๋ณด ์ƒ์„ธ ๋ทฐ ์ƒ์„ฑ
Projects/App/Sources/Feature/ProgramDetailFeature/Sources/ProgramDetailView.swift ๋ ˆ์ด์•„์›ƒ ์žฌ๊ตฌ์„ฑ ๋ฐ ์Šคํฌ๋กค ๋ทฐ ์ถ”๊ฐ€
Projects/App/Sources/Feature/UserManagementFeature/Sources/UserManagementView.swift ์ƒˆ๋กœ์šด ์‚ฌ์šฉ์ž ๊ด€๋ฆฌ ๋ทฐ ์ƒ์„ฑ

Poem

๐Ÿฐ ์ฝ”๋“œ์˜ ํ† ๋ผ, ์ƒˆ ๊ธฐ๋Šฅ์„ ๋›ฐ์–ด๋‹ค๋…€
์—์…‹๊ณผ ๋ทฐ๋ฅผ ๊น”๋”ํžˆ ์ •๋ฆฌํ•ด
ํ‡ด์‹ค ์‹œ๊ฐ„๋„ ์ถ”๊ฐ€ํ•˜๊ณ 
์Šคํฌ๋กค์€ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ํ˜๋Ÿฌ๊ฐ€๋„ค
๊ฐœ๋ฐœ์˜ ์ฆ๊ฑฐ์›€, ํ† ๋ผ๊ฐ€ ๋…ธ๋ž˜ํ•ด! ๐Ÿš€


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

โค๏ธ Share
๐Ÿชง Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

๐Ÿงน Nitpick comments (11)
Projects/App/Sources/DesignSystem/InfoList/SceneApplicationInfoListView.swift (2)

13-43: ์ ‘๊ทผ์„ฑ ๋ฐ ์œ ์ง€๋ณด์ˆ˜์„ฑ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

๋‹ค์Œ ์‚ฌํ•ญ๋“ค์„ ๊ฐœ์„ ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค:

  1. ๊ณ ์ •๋œ ๋„ˆ๋น„๊ฐ’๊ณผ ๊ฐ„๊ฒฉ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋””๋ฐ”์ด์Šค ํฌ๊ธฐ์— ๋”ฐ๋ผ ๋ ˆ์ด์•„์›ƒ์ด ๊นจ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ƒ๋Œ€์ ์ธ ํฌ๊ธฐ๋‚˜ GeometryReader ์‚ฌ์šฉ์„ ๊ณ ๋ คํ•ด๋ณด์„ธ์š”.
  2. ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๋ฌธ์ž์—ด์€ ์ง€์—ญํ™”๋ฅผ ์œ„ํ•ด ๋ณ„๋„ ์ƒ์ˆ˜๋กœ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
  3. ๋ฐ˜๋ณต๋˜๋Š” Text ์Šคํƒ€์ผ๋ง์„ ์œ„ํ•œ modifier ํ•จ์ˆ˜๋ฅผ ๋งŒ๋“ค๋ฉด ์ฝ”๋“œ ์ค‘๋ณต์„ ์ค„์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ์‹œ ๊ฐœ์„ ์•ˆ:

// ๋ฌธ์ž์—ด ์ƒ์ˆ˜
private enum Strings {
    static let name = "์„ฑ๋ช…"
    static let organization = "์†Œ์†"
    static let position = "์ง๊ธ‰"
    static let contact = "์•ˆ๋‚ด๋ฌธ์ž ๋ฐœ์†ก์šฉ ์—ฐ๋ฝ์ฒ˜"
    static let consent = "๊ฐœ์ธ์ •๋ณด๋™์˜์ œ๊ณต ๋™์˜"
}

// ๊ณตํ†ต Text ์Šคํƒ€์ผ modifier
extension View {
    func columnHeaderStyle(width: CGFloat) -> some View {
        self
            .frame(width: width, alignment: .leading)
            .expoFont(.caption1B)
            .expoColor(ExpoColor.gray600)
    }
}

11-45: ์žฌ์‚ฌ์šฉ์„ฑ ํ–ฅ์ƒ์„ ์œ„ํ•œ ์ œ์•ˆ

ํ˜„์žฌ ๋ทฐ๊ฐ€ ๊ณ ์ •๋œ ํ˜•ํƒœ๋กœ ๊ตฌํ˜„๋˜์–ด ์žˆ์–ด ๋‹ค๋ฅธ ์ƒํ™ฉ์—์„œ ์žฌ์‚ฌ์šฉํ•˜๊ธฐ ์–ด๋ ค์šธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ๋ชจ๋ธ๊ณผ ์„ค์ •์„ ์ฃผ์ž…๋ฐ›๋Š” ํ˜•ํƒœ๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

struct ColumnConfig {
    let title: String
    let width: CGFloat
}

struct SceneApplicationInfoListView: View {
    let columns: [ColumnConfig]
    
    var body: some View {
        VStack(spacing: 16) {
            // ... ๊ธฐ์กด ์ฝ”๋“œ ...
            HStack(spacing: 45) {
                ForEach(columns, id: \.title) { column in
                    Text(column.title)
                        .columnHeaderStyle(width: column.width)
                }
                Spacer()
            }
            // ... ๊ธฐ์กด ์ฝ”๋“œ ...
        }
    }
}
Projects/App/Sources/DesignSystem/Program/SceneApplicationInfoListDetail.swift (2)

11-20: ์†์„ฑ๋“ค์˜ ์ ‘๊ทผ ์ œ์–ด์ž๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ ์„ ์–ธํ•ด์ฃผ์„ธ์š”.

ํ˜„์žฌ ๋ชจ๋“  ์†์„ฑ๋“ค์ด ์•”์‹œ์  internal ์ ‘๊ทผ ์ˆ˜์ค€์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์™ธ๋ถ€์—์„œ ์ ‘๊ทผํ•  ํ•„์š”๊ฐ€ ์—†๋Š” ์†์„ฑ๋“ค์€ private์œผ๋กœ ์„ ์–ธํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

public struct SceneApplicationInfoListDetail: View {
-    var programNum: Int
-    var userName: String
-    var affiliation: String
-    var position: String
-    var phoneNumber: String
-    var consentStatus: Bool
-    var action: () -> Void
+    private let programNum: Int
+    private let userName: String
+    private let affiliation: String
+    private let position: String
+    private let phoneNumber: String
+    private let consentStatus: Bool
+    private let action: () -> Void

80-82: ํ”„๋ฆฌ๋ทฐ๋ฅผ ํ˜„์žฌ ๋ทฐ์— ๋งž๊ฒŒ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”.

UserManagementView ๋Œ€์‹  SceneApplicationInfoListDetail์˜ ํ”„๋ฆฌ๋ทฐ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ด ๋” ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค.

 #Preview {
-    UserManagementView()
+    SceneApplicationInfoListDetail(
+        programNum: 1,
+        userName: "ํ™๊ธธ๋™",
+        affiliation: "ํšŒ์‚ฌ",
+        position: "๊ฐœ๋ฐœ์ž",
+        phoneNumber: "01012345678",
+        consentStatus: true
+    )
 }
Projects/App/Sources/Feature/ProgramDetailFeature/Sources/ProgramDetailView.swift (1)

79-89: ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๋ฐ์ดํ„ฐ ๋Œ€์‹ ์— ๋ชจ๋ธ ์‚ฌ์šฉ ๊ถŒ์žฅ

ForEach ๋‚ด๋ถ€์—์„œ ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์‹ค์ œ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ํ™œ์šฉํ•˜์—ฌ ๋ทฐ์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ”์ธ๋”ฉํ•˜๋ฉด ์œ ์ง€๋ณด์ˆ˜์„ฑ๊ณผ ํ™•์žฅ์„ฑ์ด ํ–ฅ์ƒ๋ฉ๋‹ˆ๋‹ค.

Projects/App/Sources/DesignSystem/InfoList/InfoListView.swift (1)

18-39: ํ•˜๋“œ์ฝ”๋”ฉ๋œ ํ”„๋ ˆ์ž„ ํฌ๊ธฐ ๋Œ€์‹  ์œ ์—ฐํ•œ ๋ ˆ์ด์•„์›ƒ ์‚ฌ์šฉ ๊ถŒ์žฅ

Text ๋ทฐ์— ๊ณ ์ •๋œ width์™€ padding ๊ฐ’์„ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์–‘ํ•œ ๊ธฐ๊ธฐ ํ™”๋ฉด ํฌ๊ธฐ์—์„œ ๋ ˆ์ด์•„์›ƒ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Spacer()๋‚˜ GeometryReader๋ฅผ ํ™œ์šฉํ•˜์—ฌ ๋™์ ์ธ ๋ ˆ์ด์•„์›ƒ์„ ๊ตฌ์„ฑํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

Projects/App/Sources/DesignSystem/Program/ExpoProgramDetail.swift (1)

51-74: ํ•˜๋“œ์ฝ”๋”ฉ๋œ ํ”„๋ ˆ์ž„ ํฌ๊ธฐ ๋Œ€์‹  ๋ฐ˜์‘ํ˜• ๋ ˆ์ด์•„์›ƒ ์‚ฌ์šฉ ๊ถŒ์žฅ

Text ๋ทฐ์— ๊ณ ์ •๋œ width๋ฅผ ์„ค์ •ํ•˜๋ฉด ํ™”๋ฉด ํฌ๊ธฐ์— ๋”ฐ๋ผ ๋ ˆ์ด์•„์›ƒ์ด ๊นจ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. HStack ๋‚ด์—์„œ Spacer()๋ฅผ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ LazyVGrid ๋“ฑ์„ ํ™œ์šฉํ•˜์—ฌ ๋‹ค์–‘ํ•œ ํ™”๋ฉด ํฌ๊ธฐ์— ๋Œ€์‘ํ•˜๋Š” ๋ฐ˜์‘ํ˜• ๋ ˆ์ด์•„์›ƒ์„ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

Projects/App/Sources/Feature/UserManagementFeature/Sources/UserManagementView.swift (4)

1-10: ๋ฌธ์„œํ™” ๊ฐœ์„  ์ œ์•ˆ

๋ทฐ์˜ ๋ชฉ์ ๊ณผ ์ฃผ์š” ๊ธฐ๋Šฅ์„ ์„ค๋ช…ํ•˜๋Š” ๋ฌธ์„œ ์ฃผ์„์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฌธ์„œ ์ฃผ์„์„ ์ถ”๊ฐ€ํ•ด๋ณด์„ธ์š”:

 //
 //  UserManagementView.swift
 //  Expo-iOS
 //
 //  Created by ์„œ์ง€์™„ on 1/5/25.
 //  Copyright ยฉ 2025 SchoolofCompany. All rights reserved.
 //

+/// `UserManagementView`๋Š” ์ด๋ฒคํŠธ ์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ ๋ทฐ์ž…๋‹ˆ๋‹ค.
+/// - ์‚ฌ์ „ ํ–‰์‚ฌ ์ฐธ๊ฐ€์ž, ํ˜„์žฅ ์‹ ์ฒญ ์ฐธ๊ฐ€์ž, ์‚ฌ์ „ ๊ต์› ์›์ˆ˜ ์ฐธ๊ฐ€์ž๋ฅผ ๊ตฌ๋ถ„ํ•˜์—ฌ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
+/// - ์ฐธ๊ฐ€์ž ๋ชฉ๋ก์„ ํ™•์ธํ•˜๊ณ  ์ƒ์„ธ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
+
 import SwiftUI

11-15: ์ƒํƒœ ๋ณ€์ˆ˜ ์ด๋ฆ„ ๊ฐœ์„  ๋ฐ ๋ฌธ์„œํ™” ์ œ์•ˆ

์ƒํƒœ ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์„ ๋” ๋ช…ํ™•ํ•˜๊ฒŒ ํ•˜๊ณ , ๊ฐ ๋ณ€์ˆ˜์˜ ์šฉ๋„๋ฅผ ์„ค๋ช…ํ•˜๋Š” ๋ฌธ์„œ ์ฃผ์„์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ณ€๊ฒฝํ•ด๋ณด์„ธ์š”:

 struct UserManagementView: View {
     @Environment(\.dismiss) var dismiss
-    @State private var userInfoListName: String = "์‚ฌ์ „ ํ–‰์‚ฌ"
-    @State private var userInfoListButtonAction: Bool = false
+    /// ์„ ํƒ๋œ ์ฐธ๊ฐ€์ž ๋ชฉ๋ก ์œ ํ˜• (์‚ฌ์ „ ํ–‰์‚ฌ, ํ˜„์žฅ ์‹ ์ฒญ, ์‚ฌ์ „ ๊ต์› ์›์ˆ˜)
+    @State private var selectedParticipantType: String = "์‚ฌ์ „ ํ–‰์‚ฌ"
+    /// ์ฐธ๊ฐ€์ž ์œ ํ˜• ์„ ํƒ ์‹œํŠธ ํ‘œ์‹œ ์—ฌ๋ถ€
+    @State private var isParticipantTypeSheetPresented: Bool = false

16-32: ๋„ค๋น„๊ฒŒ์ด์…˜ ๊ตฌํ˜„ ๊ฐœ์„  ์ œ์•ˆ

ํ˜„์žฌ ZStack์„ ์‚ฌ์šฉํ•œ ๋„ค๋น„๊ฒŒ์ด์…˜ ๊ตฌํ˜„๋ณด๋‹ค SwiftUI์˜ ๋„ค๋น„๊ฒŒ์ด์…˜ ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ™œ์šฉํ•˜๋ฉด ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด NavigationStack์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌํ˜„ํ•ด๋ณด์„ธ์š”:

-    var body: some View {
-        ZStack {
-            HStack(spacing: 0) {
-                Button {
-                    dismiss()
-                } label: {
-                    ExpoIOSAsset.Assets.leftBackButton.swiftUIImage
-                        .padding(.leading, 4)
-                }
-
-                Spacer()
-            }
-
-            Text("์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ")
-                .expoFont(.body1R)
-        }
+    var body: some View {
+        NavigationStack {
+            VStack {
+                // ๊ธฐ์กด ์ปจํ…์ธ 
+            }
+            .navigationTitle("์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ")
+            .navigationBarTitleDisplayMode(.center)
+            .navigationBarBackButtonHidden(true)
+            .toolbar {
+                ToolbarItem(placement: .navigationBarLeading) {
+                    Button {
+                        dismiss()
+                    } label: {
+                        ExpoIOSAsset.Assets.leftBackButton.swiftUIImage
+                    }
+                }
+            }
+        }

159-161: ํ”„๋ฆฌ๋ทฐ ๊ตฌํ˜„ ๊ฐœ์„  ์ œ์•ˆ

ํ”„๋ฆฌ๋ทฐ์— ์ƒ˜ํ”Œ ๋ฐ์ดํ„ฐ์™€ ๋‹ค์–‘ํ•œ ์ƒํƒœ๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ๊ฐœ๋ฐœ ์‹œ ๋” ์œ ์šฉํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ”„๋ฆฌ๋ทฐ๋ฅผ ๊ฐœ์„ ํ•ด๋ณด์„ธ์š”:

#Preview {
    Group {
        UserManagementView(viewModel: ParticipantViewModel(participants: PreviewData.sampleParticipants))
            .previewDisplayName("๊ธฐ๋ณธ ์ƒํƒœ")
        
        UserManagementView(viewModel: ParticipantViewModel(participants: []))
            .previewDisplayName("๋นˆ ์ƒํƒœ")
    }
}

enum PreviewData {
    static let sampleParticipants: [Participant] = [
        // ์ƒ˜ํ”Œ ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€
    ]
}
๐Ÿ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 889055f and f9c685f.

โ›” Files ignored due to path filters (2)
  • Projects/App/Resources/Assets.xcassets/blackBottomButton.imageset/blackBottomButton.svg is excluded by !**/*.svg
  • Projects/App/Resources/Assets.xcassets/okIcon.imageset/okIcon.svg is excluded by !**/*.svg
๐Ÿ“’ Files selected for processing (9)
  • Projects/App/Resources/Assets.xcassets/blackBottomButton.imageset/Contents.json (1 hunks)
  • Projects/App/Resources/Assets.xcassets/okIcon.imageset/Contents.json (1 hunks)
  • Projects/App/Sources/DesignSystem/InfoList/InfoListView.swift (1 hunks)
  • Projects/App/Sources/DesignSystem/InfoList/SceneApplicationInfoListView.swift (1 hunks)
  • Projects/App/Sources/DesignSystem/Program/ExpoProgramDetail.swift (5 hunks)
  • Projects/App/Sources/DesignSystem/Program/SceneApplicationInfoListDetail.swift (1 hunks)
  • Projects/App/Sources/Feature/ProgramDetailFeature/Sources/ProgramDetailView.swift (1 hunks)
  • Projects/App/Sources/Feature/ProgramFeature/Sources/ProgramView.swift (0 hunks)
  • Projects/App/Sources/Feature/UserManagementFeature/Sources/UserManagementView.swift (1 hunks)
๐Ÿ’ค Files with no reviewable changes (1)
  • Projects/App/Sources/Feature/ProgramFeature/Sources/ProgramView.swift
โœ… Files skipped from review due to trivial changes (2)
  • Projects/App/Resources/Assets.xcassets/okIcon.imageset/Contents.json
  • Projects/App/Resources/Assets.xcassets/blackBottomButton.imageset/Contents.json
๐Ÿ”‡ Additional comments (3)
Projects/App/Sources/DesignSystem/Program/SceneApplicationInfoListDetail.swift (2)

1-10: ํŒŒ์ผ ํ—ค๋”์™€ import ๋ฌธ์ด ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ์ ์ธ ํŒŒ์ผ ๊ตฌ์กฐ๊ฐ€ ์ž˜ ๊ฐ–์ถฐ์ ธ ์žˆ์Šต๋‹ˆ๋‹ค.


22-38: ์ดˆ๊ธฐํ™” ๊ตฌ๋ฌธ์ด ์ž˜ ๊ตฌํ˜„๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋งค๊ฐœ๋ณ€์ˆ˜์™€ ๊ธฐ๋ณธ๊ฐ’์ด ์ ์ ˆํ•˜๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

Projects/App/Sources/DesignSystem/Program/ExpoProgramDetail.swift (1)

92-92: Preview ๋ณ€๊ฒฝ ์‚ฌํ•ญ ํ™•์ธ ํ•„์š”

#Preview์—์„œ ProgramDetailView() ๋Œ€์‹  UserManagementView()๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์˜๋„๋œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ธ์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

Comment on lines +47 to +49
#Preview {
UserManagementView()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ› ๏ธ Refactor suggestion

ํ”„๋ฆฌ๋ทฐ ์ˆ˜์ •์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

ํ˜„์žฌ ํ”„๋ฆฌ๋ทฐ๊ฐ€ UserManagementView()๋ฅผ ํ‘œ์‹œํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ์ด๋Š” SceneApplicationInfoListView์˜ ๋™์ž‘์„ ํ™•์ธํ•˜๊ธฐ์— ์ ์ ˆํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ง์ ‘ ํ”„๋ฆฌ๋ทฐํ•˜๋„๋ก ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”.

 #Preview {
-    UserManagementView()
+    SceneApplicationInfoListView()
 }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#Preview {
UserManagementView()
}
#Preview {
SceneApplicationInfoListView()
}

var userName: String
var affiliation: String
var position: String
var phoneNumber: String
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ› ๏ธ Refactor suggestion

์ „ํ™”๋ฒˆํ˜ธ ํ˜•์‹ ๊ฒ€์ฆ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

phoneNumber ์†์„ฑ์— ๋Œ€ํ•œ ํ˜•์‹ ๊ฒ€์ฆ์ด ์—†์Šต๋‹ˆ๋‹ค. ์˜ฌ๋ฐ”๋ฅธ ์ „ํ™”๋ฒˆํ˜ธ ํ˜•์‹์ธ์ง€ ํ™•์ธํ•˜๋Š” ๋กœ์ง์„ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

private func isValidPhoneNumber(_ number: String) -> Bool {
    let pattern = "^01[0-1, 7][0-9]{7,8}$"
    let predicate = NSPredicate(format: "SELF MATCHES %@", pattern)
    return predicate.evaluate(with: number)
}

Comment on lines +44 to +66
HStack(spacing: 0) {
Text("\(programNum)")
.expoFont(.caption1B)
.padding(.leading, 8)
.frame(width: 50, alignment: .leading)

Text(userName)
.frame(width: 70, alignment: .leading)

Text(affiliation)
.frame(width: 70, alignment: .leading)

Text(position)
.frame(width: 70, alignment: .leading)

Text(phoneNumber)
.frame(width: 170, alignment: .leading)

Image(consentStatus ? "okIcon" : "ButtonX")
.frame(width: 130, alignment: .center)
}
.padding(.bottom, 36)
.expoFont(.caption2R)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ› ๏ธ Refactor suggestion

๋ ˆ์ด์•„์›ƒ ๊ฐ’์„ ์ƒ์ˆ˜๋กœ ๋ถ„๋ฆฌํ•˜๊ณ  ์ ‘๊ทผ์„ฑ์„ ๊ฐœ์„ ํ•ด์ฃผ์„ธ์š”.

  1. ํ•˜๋“œ์ฝ”๋”ฉ๋œ ํ”„๋ ˆ์ž„ ๋„ˆ๋น„๊ฐ’๋“ค์„ ์ƒ์ˆ˜๋กœ ๋ถ„๋ฆฌํ•˜๋ฉด ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ์šฉ์ดํ•ด์ง‘๋‹ˆ๋‹ค.
  2. VoiceOver ์ง€์›์„ ์œ„ํ•œ ์ ‘๊ทผ์„ฑ ๋ ˆ์ด๋ธ”์ด ๋ˆ„๋ฝ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
+ private enum Layout {
+     static let programNumWidth: CGFloat = 50
+     static let nameWidth: CGFloat = 70
+     static let affiliationWidth: CGFloat = 70
+     static let positionWidth: CGFloat = 70
+     static let phoneWidth: CGFloat = 170
+     static let statusWidth: CGFloat = 130
+ }

 HStack(spacing: 0) {
     Text("\(programNum)")
         .expoFont(.caption1B)
         .padding(.leading, 8)
-        .frame(width: 50, alignment: .leading)
+        .frame(width: Layout.programNumWidth, alignment: .leading)
+        .accessibilityLabel("ํ”„๋กœ๊ทธ๋žจ ๋ฒˆํ˜ธ \(programNum)")

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +41 to +75
Button(action: {
self.action()
}) {
HStack(spacing: 0) {
Text("\(programNum)")
.expoFont(.caption1B)
.padding(.leading, 8)
.frame(width: 50, alignment: .leading)

Text(userName)
.frame(width: 70, alignment: .leading)

Text(affiliation)
.frame(width: 70, alignment: .leading)

Text(position)
.frame(width: 70, alignment: .leading)

Text(phoneNumber)
.frame(width: 170, alignment: .leading)

Image(consentStatus ? "okIcon" : "ButtonX")
.frame(width: 130, alignment: .center)
}
.padding(.bottom, 36)
.expoFont(.caption2R)
}
.buttonStyle(PlainButtonStyle())
.gesture(
DragGesture(minimumDistance: 0)
.onChanged { _ in self.isPressed = true }
.onEnded { _ in
self.isPressed = false
self.action()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue

์ค‘๋ณต ์•ก์…˜ ํ˜ธ์ถœ์„ ์ œ๊ฑฐํ•ด์ฃผ์„ธ์š”.

Button์˜ action๊ณผ gesture์˜ onEnded์—์„œ ๋ชจ๋‘ action()์„ ํ˜ธ์ถœํ•˜๊ณ  ์žˆ์–ด ์ค‘๋ณต ์‹คํ–‰๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

- Button(action: {
-     self.action()
- }) {
+ Button(action: {}) {
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Button(action: {
self.action()
}) {
HStack(spacing: 0) {
Text("\(programNum)")
.expoFont(.caption1B)
.padding(.leading, 8)
.frame(width: 50, alignment: .leading)
Text(userName)
.frame(width: 70, alignment: .leading)
Text(affiliation)
.frame(width: 70, alignment: .leading)
Text(position)
.frame(width: 70, alignment: .leading)
Text(phoneNumber)
.frame(width: 170, alignment: .leading)
Image(consentStatus ? "okIcon" : "ButtonX")
.frame(width: 130, alignment: .center)
}
.padding(.bottom, 36)
.expoFont(.caption2R)
}
.buttonStyle(PlainButtonStyle())
.gesture(
DragGesture(minimumDistance: 0)
.onChanged { _ in self.isPressed = true }
.onEnded { _ in
self.isPressed = false
self.action()
}
Button(action: {}) {
HStack(spacing: 0) {
Text("\(programNum)")
.expoFont(.caption1B)
.padding(.leading, 8)
.frame(width: 50, alignment: .leading)
Text(userName)
.frame(width: 70, alignment: .leading)
Text(affiliation)
.frame(width: 70, alignment: .leading)
Text(position)
.frame(width: 70, alignment: .leading)
Text(phoneNumber)
.frame(width: 170, alignment: .leading)
Image(consentStatus ? "okIcon" : "ButtonX")
.frame(width: 130, alignment: .center)
}
.padding(.bottom, 36)
.expoFont(.caption2R)
}
.buttonStyle(PlainButtonStyle())
.gesture(
DragGesture(minimumDistance: 0)
.onChanged { _ in self.isPressed = true }
.onEnded { _ in
self.isPressed = false
self.action()
}

Comment on lines +74 to +91
ScrollView(.horizontal, showsIndicators: false) {
InfoListView()
.padding(.top, 12)

ScrollView(showsIndicators: false) {
ForEach(1..<10, id: \.self) { index in
ExpoProgramDetail(
programNum: index,
userName: "์„œ์ง€์™„",
affiliation: "๊ณ ๋“ฑํ•™๊ต",
position: "์—ฐ์ˆ˜์ž",
attendanceState: true,
inTime: "10:30",
outTime: "11:30"
)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ› ๏ธ Refactor suggestion

์ค‘์ฒฉ๋œ ScrollView๋กœ ์ธํ•œ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜ ๋ฐ ์„ฑ๋Šฅ ๋ฌธ์ œ ๊ฐ€๋Šฅ์„ฑ ํ™•์ธ ํ•„์š”

ScrollView(.horizontal) ๋‚ด์— ScrollView๋ฅผ ์ค‘์ฒฉํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋ฉด ์Šคํฌ๋กค ์ด๋ฒคํŠธ๊ฐ€ ์ถฉ๋Œํ•˜์—ฌ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์— ๋ถ€์ •์ ์ธ ์˜ํ–ฅ์„ ์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŠนํžˆ ์Šคํฌ๋กค ๋ฐฉํ–ฅ์ด ๋‹ค๋ฅธ ScrollView๋ฅผ ์ค‘์ฒฉํ•  ๊ฒฝ์šฐ ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ๋™์ž‘์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ ˆ์ด์•„์›ƒ์„ ์žฌ๊ตฌ์„ฑํ•˜์—ฌ ์ค‘์ฒฉ๋œ ScrollView๋ฅผ ํ”ผํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

Comment on lines +67 to +71
Text("100๋ช…")
.expoColor(ExpoColor.main)
.expoFont(.caption2R)
.padding(.trailing, 16)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue

์ฐธ๊ฐ€์ž ์ˆ˜ ํ•˜๋“œ์ฝ”๋”ฉ ๊ฐœ์„  ํ•„์š”

์ฐธ๊ฐ€์ž ์ˆ˜๊ฐ€ ํ•˜๋“œ์ฝ”๋”ฉ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์‹ค์ œ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ˜์˜ํ•˜๋„๋ก ์ˆ˜์ •์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

์ฐธ๊ฐ€์ž ์ˆ˜๋ฅผ ๋™์ ์œผ๋กœ ๊ณ„์‚ฐํ•˜์—ฌ ํ‘œ์‹œํ•˜๋„๋ก ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”. ๋˜ํ•œ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ƒํƒœ ๊ด€๋ฆฌ๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

Comment on lines +74 to +110
ScrollView(.horizontal, showsIndicators: false) {
if userInfoListName == "ํ˜„์žฅ ์‹ ์ฒญ" {
SceneApplicationInfoListView()
.padding(.top, 12)
} else {
InfoListView()
.padding(.top, 12)
}

ScrollView(showsIndicators: false) {
ForEach(1..<10, id: \.self) { index in
if userInfoListName == "ํ˜„์žฅ ์‹ ์ฒญ" {
SceneApplicationInfoListDetail(
programNum: index,
userName: "์„œ์ง€์™„",
affiliation: "๊ณ ๋“ฑํ•™๊ต",
position: "์—ฐ์ˆ˜์ž",
phoneNumber: "01062860063",
consentStatus: true
)
} else {
ExpoProgramDetail(
programNum: index,
userName: "์„œ์ง€์™„",
affiliation: "๊ณ ๋“ฑํ•™๊ต",
position: "์—ฐ์ˆ˜์ž",
attendanceState: true,
inTime: "10:30",
outTime: "11:30"
)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
.padding(.top, 15)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ› ๏ธ Refactor suggestion

์Šคํฌ๋กค ๋ทฐ ๊ตฌํ˜„ ๋ฐ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๊ฐœ์„  ํ•„์š”

  1. ์ค‘์ฒฉ๋œ ScrollView๋Š” ์„ฑ๋Šฅ ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  2. ํ…Œ์ŠคํŠธ ๋ฐ์ดํ„ฐ๊ฐ€ ํ•˜๋“œ์ฝ”๋”ฉ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

  1. ์ค‘์ฒฉ๋œ ScrollView ๋Œ€์‹  LazyVStack๊ณผ ๋‹จ์ผ ScrollView๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”.
  2. ์‹ค์ œ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ์ƒ์„ฑํ•˜๊ณ  ObservableObject๋ฅผ ํ™œ์šฉํ•œ ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ์„ ๊ตฌํ˜„ํ•˜์„ธ์š”.

์˜ˆ์‹œ ์ฝ”๋“œ:

class ParticipantViewModel: ObservableObject {
    @Published var participants: [Participant] = []
    
    func fetchParticipants(type: String) {
        // API ํ˜ธ์ถœ ๋ฐ ๋ฐ์ดํ„ฐ ๋กœ๋”ฉ ๊ตฌํ˜„
    }
}

struct Participant: Identifiable {
    let id: UUID
    let programNum: Int
    let userName: String
    let affiliation: String
    // ... ๊ธฐํƒ€ ํ•„์š”ํ•œ ์†์„ฑ๋“ค
}

Comment on lines +113 to +155
.sheet(isPresented: $userInfoListButtonAction) {
VStack(spacing: 0){
Button {
userInfoListName = "์‚ฌ์ „ ํ–‰์‚ฌ"
userInfoListButtonAction.toggle()
} label: {
Text("์‚ฌ์ „ ํ–‰์‚ฌ ์ฐธ๊ฐ€์ž")
.frame(maxWidth: .infinity, minHeight: 58)
.foregroundStyle(.black)
}
.padding(.top, 15)

Button {
userInfoListName = "ํ˜„์žฅ ์‹ ์ฒญ"
userInfoListButtonAction.toggle()
} label: {
Text("ํ˜„์žฅ ์‹ ์ฒญ ์ฐธ๊ฐ€์ž")
.frame(maxWidth: .infinity, minHeight: 58)
.foregroundStyle(.black)
}

Button {
userInfoListName = "์‚ฌ์ „ ๊ต์› ์›์ˆ˜"
userInfoListButtonAction.toggle()
} label: {
Text("์‚ฌ์ „ ๊ต์› ์›์ˆ˜ ์ฐธ๊ฐ€์ž")
.frame(maxWidth: .infinity, minHeight: 58)
.foregroundStyle(.black)
}

Button {
userInfoListButtonAction.toggle()
} label: {
Text("์ทจ์†Œ")
.frame(maxWidth: .infinity, minHeight: 58)
.expoColor(ExpoColor.error)
}

Spacer()
}
.expoFont(.body2R)
.presentationDetents([.height(230)])
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ› ๏ธ Refactor suggestion

์‹œํŠธ ๊ตฌํ˜„ ๊ฐœ์„  ์ œ์•ˆ

๋ฒ„ํŠผ ๊ตฌํ˜„์ด ๋ฐ˜๋ณต๋˜๊ณ  ์žˆ์œผ๋ฉฐ, ์ฐธ๊ฐ€์ž ์œ ํ˜•์ด ํ•˜๋“œ์ฝ”๋”ฉ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

  1. ์ฐธ๊ฐ€์ž ์œ ํ˜•์„ ์—ด๊ฑฐํ˜•์œผ๋กœ ์ •์˜
  2. ๊ณตํ†ต ๋ฒ„ํŠผ ์Šคํƒ€์ผ์„ ์ถ”์ถœ
  3. ๋™์  ์‹œํŠธ ๋†’์ด ๊ณ„์‚ฐ
enum ParticipantType: String, CaseIterable {
    case preEvent = "์‚ฌ์ „ ํ–‰์‚ฌ"
    case onSite = "ํ˜„์žฅ ์‹ ์ฒญ"
    case preTeacher = "์‚ฌ์ „ ๊ต์› ์›์ˆ˜"
    
    var description: String {
        return "\(rawValue) ์ฐธ๊ฐ€์ž"
    }
}

struct ParticipantTypeButton: View {
    let type: ParticipantType
    let action: () -> Void
    
    var body: some View {
        Button(action: action) {
            Text(type.description)
                .frame(maxWidth: .infinity, minHeight: 58)
                .foregroundStyle(.black)
        }
    }
}

@Xixn2 Xixn2 merged commit a2ba17d into develop Jan 12, 2025
3 checks passed
@Xixn2 Xixn2 deleted the 74-UserManagement-Publishing branch January 12, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2๏ธโƒฃ Priority: Medium ์šฐ์„ ์ˆœ์œ„ - ์ค‘ โœจ Feature ์‹ ๊ทœ ๊ธฐ๋Šฅ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

์ฐธ๊ฐ€์ž ๊ด€๋ฆฌ ํŽ˜์ด์ง€ ํผ๋ธ”๋ฆฌ์‹ฑ
2 participants