-
Notifications
You must be signed in to change notification settings - Fork 0
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 #41 from Student-Center/working/WEAV-122
[WEAV-122] �프로필 위젯 입력 기능 구현
- Loading branch information
Showing
39 changed files
with
2,940 additions
and
79 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
434 changes: 424 additions & 10 deletions
434
OpenApiGenerator/Sources/OpenapiGenerated/Client.swift
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
6 changes: 3 additions & 3 deletions
6
...System/DesignCore/Sources/Color+Ext.swift → ...ects/Core/CoreKit/Sources/Color+Ext.swift
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
56 changes: 56 additions & 0 deletions
56
Projects/Core/NetworkKit/Sources/ProfileService/ProfileService.swift
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,56 @@ | ||
// | ||
// ProfileService.swift | ||
// CommonKit | ||
// | ||
// Created by 김지수 on 11/14/24. | ||
// Copyright © 2024 com.weave. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import CoreKit | ||
import OpenapiGenerated | ||
import Model | ||
|
||
public protocol ProfileServiceProtocol { | ||
func requestPutProfileWidget( | ||
widgetType: Components.Schemas.ProfileWidgetType, | ||
content: String | ||
) async throws | ||
|
||
func requestDeleteProfileWidget( | ||
widgetType: Components.Schemas.ProfileWidgetType | ||
) async throws | ||
} | ||
|
||
public final class ProfileService { | ||
public static let shared = ProfileService() | ||
private init() {} | ||
} | ||
|
||
extension ProfileService: ProfileServiceProtocol { | ||
public func requestPutProfileWidget( | ||
widgetType: Components.Schemas.ProfileWidgetType, | ||
content: String | ||
) async throws { | ||
let result = try await client.putProfileWidget( | ||
body: .json( | ||
.init( | ||
_type: widgetType, | ||
content: content | ||
) | ||
) | ||
) | ||
let _ = try result.ok | ||
} | ||
|
||
public func requestDeleteProfileWidget( | ||
widgetType: Components.Schemas.ProfileWidgetType | ||
) async throws { | ||
let response = try await client.deleteProfileWidget( | ||
.init( | ||
path: .init(_type: widgetType) | ||
) | ||
) | ||
_ = try response.noContent | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
Projects/Core/NetworkKit/Sources/ProfileService/ProfileServiceMock.swift
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,30 @@ | ||
// | ||
// ProfileServiceMock.swift | ||
// NetworkKit | ||
// | ||
// Created by 김지수 on 11/15/24. | ||
// Copyright © 2024 com.weave. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import OpenapiGenerated | ||
import CoreKit | ||
|
||
public final class ProfileServiceMock: ProfileServiceProtocol { | ||
public init() {} | ||
|
||
public func requestPutProfileWidget( | ||
widgetType: Components.Schemas.ProfileWidgetType, | ||
content: String | ||
) async throws { | ||
print("✅ [ProfileServiceMock] requestPutProfileWidget 성공!") | ||
return | ||
} | ||
|
||
public func requestDeleteProfileWidget( | ||
widgetType: Components.Schemas.ProfileWidgetType | ||
) async throws { | ||
print("✅ [ProfileServiceMock] requestDeleteProfileWidget 성공!") | ||
return | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
.../DesignSystem/DesignCore/Resources/Images/Images.xcassets/pencil 1.imageset/Contents.json
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,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "pencil.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "pencil@2x.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "pencil@3x.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+296 Bytes
...System/DesignCore/Resources/Images/Images.xcassets/pencil 1.imageset/pencil.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
BIN
+503 Bytes
...tem/DesignCore/Resources/Images/Images.xcassets/pencil 1.imageset/pencil@2x.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
BIN
+700 Bytes
...tem/DesignCore/Resources/Images/Images.xcassets/pencil 1.imageset/pencil@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...tem/DesignCore/Resources/Images/Images.xcassets/plus_circle_filled.imageset/Contents.json
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,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "plus_circle_filled.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "plus_circle_filled@2x.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "plus_circle_filled@3x.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+392 Bytes
...urces/Images/Images.xcassets/plus_circle_filled.imageset/plus_circle_filled.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
BIN
+673 Bytes
...es/Images/Images.xcassets/plus_circle_filled.imageset/plus_circle_filled@2x.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
BIN
+980 Bytes
...es/Images/Images.xcassets/plus_circle_filled.imageset/plus_circle_filled@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
Projects/DesignSystem/DesignCore/Sources/FlatTextFieldOption.swift
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,29 @@ | ||
// | ||
// FlatTextFieldOption.swift | ||
// DesignCore | ||
// | ||
// Created by 김지수 on 11/14/24. | ||
// Copyright © 2024 com.weave. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct FlatTextFieldOptionModifier: ViewModifier { | ||
let keyboardType: UIKeyboardType | ||
|
||
func body(content: Content) -> some View { | ||
content | ||
.keyboardType(keyboardType) | ||
.interactiveDismissDisabled() | ||
.textInputAutocapitalization(.never) | ||
.autocorrectionDisabled() | ||
.speechAnnouncementsQueued(false) | ||
.speechSpellsOutCharacters(false) | ||
} | ||
} | ||
|
||
extension View { | ||
public func flatTextFieldOption(keyboardType: UIKeyboardType = .default) -> some View { | ||
modifier(FlatTextFieldOptionModifier(keyboardType: keyboardType)) | ||
} | ||
} |
82 changes: 82 additions & 0 deletions
82
Projects/DesignSystem/DesignCore/Sources/ProfileWidget/ProfileWidgetView.swift
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,82 @@ | ||
// | ||
// ProfileWidgetView.swift | ||
// DesignCore | ||
// | ||
// Created by 김지수 on 11/7/24. | ||
// Copyright © 2024 com.weave. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import CoreKit | ||
|
||
public enum ProfileWidgetIconType { | ||
case add | ||
case edit | ||
|
||
var image: Image { | ||
switch self { | ||
case .add: DesignCore.Images.plusCircleFilled.image | ||
case .edit: DesignCore.Images.pencil1.image | ||
} | ||
} | ||
} | ||
|
||
public struct ProfileWidgetView: View { | ||
|
||
public let title: String | ||
public let bodyText: String | ||
public let titleColor: Color | ||
public let bodyColor: Color | ||
public let gradientColors: [Color] | ||
public var iconType: ProfileWidgetIconType? | ||
|
||
public init( | ||
title: String, | ||
bodyText: String, | ||
titleColor: Color, | ||
bodyColor: Color, | ||
gradientColors: [Color], | ||
iconType: ProfileWidgetIconType? = nil | ||
) { | ||
self.title = title | ||
self.bodyText = bodyText | ||
self.titleColor = titleColor | ||
self.bodyColor = bodyColor | ||
self.gradientColors = gradientColors | ||
self.iconType = iconType | ||
} | ||
|
||
public var body: some View { | ||
ZStack { | ||
RoundedRectangle(cornerRadius: 24) | ||
.fill( | ||
LinearGradient( | ||
colors: gradientColors, | ||
startPoint: .top, | ||
endPoint: .bottom | ||
) | ||
) | ||
VStack { | ||
HStack { | ||
Text(title) | ||
.pretendard(weight: ._600, size: 22) | ||
.foregroundStyle(titleColor) | ||
Spacer() | ||
if let iconType { | ||
iconType.image | ||
.resizable() | ||
.frame(width: 22, height: 22) | ||
} | ||
} | ||
Spacer() | ||
ScrollView { | ||
LeftAlignText(bodyText) | ||
.typography(.regular_14) | ||
.foregroundStyle(bodyColor) | ||
} | ||
} | ||
.scrollIndicators(.hidden) | ||
.padding(.all, 20) | ||
} | ||
} | ||
} |
Oops, something went wrong.