-
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.
- Loading branch information
1 parent
2b9cfe3
commit 6200153
Showing
15 changed files
with
324 additions
and
55 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
30 changes: 30 additions & 0 deletions
30
Projects/Shared/DesignSystem/Example/Sources/NavigationDetailView.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 @@ | ||
// | ||
// NavigationDetailView.swift | ||
// DesignSystemExample | ||
// | ||
// Created by devMinseok on 8/7/24. | ||
// Copyright © 2024 PomoNyang. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
import DesignSystem | ||
|
||
struct NavigationDetailView: View { | ||
var body: some View { | ||
NavigationContainer( | ||
title: Text("Title"), | ||
style: .navigation, | ||
navBackground: .clear | ||
) { | ||
ScrollView { | ||
|
||
} | ||
} | ||
.background(Global.Color.gray50) | ||
} | ||
} | ||
|
||
#Preview { | ||
NavigationDetailView() | ||
} |
10 changes: 10 additions & 0 deletions
10
...sources/Image.xcassets/24_arrow_left_primary.imageset/24_arrow_left_primary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
...Shared/DesignSystem/Resources/Image.xcassets/24_arrow_left_primary.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "24_arrow_left_primary.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ystem/Resources/Image.xcassets/24_cancel_primary.imageset/24_cancel_primary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
...cts/Shared/DesignSystem/Resources/Image.xcassets/24_cancel_primary.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "24_cancel_primary.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Projects/Shared/DesignSystem/Resources/Image.xcassets/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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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
83 changes: 83 additions & 0 deletions
83
Projects/Shared/DesignSystem/Sources/Component/NavigationBar/NavigationBar.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,83 @@ | ||
// | ||
// NavigationBar.swift | ||
// DesignSystem | ||
// | ||
// Created by devMinseok on 8/7/24. | ||
// Copyright © 2024 PomoNyang. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct NavigationBar<Title: View, Trailing: View, Background: ShapeStyle>: View { | ||
let title: Title | ||
let trailing: Trailing | ||
let style: NavigationBarStyle | ||
let background: Background | ||
let foregroundColor: Color | ||
let onDismiss: () -> Void | ||
|
||
init( | ||
title: Title, | ||
trailing: Trailing, | ||
style: NavigationBarStyle, | ||
background: Background, | ||
foregroundColor: Color, | ||
onDismiss: @escaping () -> Void | ||
) { | ||
self.title = title | ||
self.trailing = trailing | ||
self.style = style | ||
self.background = background | ||
self.foregroundColor = foregroundColor | ||
self.onDismiss = onDismiss | ||
} | ||
|
||
var body: some View { | ||
ZStack(alignment: style == .bottomSheet ? .leading : .center) { | ||
self.title | ||
.font(Typography.bodySB) | ||
.lineLimit(1) | ||
.frame(maxWidth: .infinity, alignment: .center) | ||
HStack { | ||
switch style { | ||
case .modal: | ||
Button { | ||
self.onDismiss() | ||
} label: { | ||
DesignSystemAsset.Image._24CancelPrimary.swiftUIImage | ||
.renderingMode(.template) | ||
.foregroundStyle(foregroundColor) | ||
} | ||
Spacer() | ||
self.trailing | ||
|
||
case .navigation: | ||
Button { | ||
self.onDismiss() | ||
} label: { | ||
DesignSystemAsset.Image._24ArrowLeftPrimary.swiftUIImage | ||
.renderingMode(.template) | ||
.foregroundStyle(foregroundColor) | ||
} | ||
Spacer() | ||
self.trailing | ||
|
||
case .bottomSheet: | ||
Spacer() | ||
Button { | ||
self.onDismiss() | ||
} label: { | ||
DesignSystemAsset.Image._24CancelPrimary.swiftUIImage | ||
.renderingMode(.template) | ||
.foregroundStyle(foregroundColor) | ||
} | ||
} | ||
} | ||
} | ||
.padding(.horizontal, 10) | ||
.frame(maxWidth: .infinity) | ||
.frame(height: 56) | ||
.background(background) | ||
.foregroundStyle(foregroundColor) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Projects/Shared/DesignSystem/Sources/Component/NavigationBar/NavigationBarStyle.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,15 @@ | ||
// | ||
// NavigationBarStyle.swift | ||
// DesignSystem | ||
// | ||
// Created by devMinseok on 8/7/24. | ||
// Copyright © 2024 PomoNyang. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum NavigationBarStyle { | ||
case modal | ||
case navigation | ||
case bottomSheet | ||
} |
Oops, something went wrong.