Skip to content

Commit 8dcd914

Browse files
authored
feat: add a border around the view showing the opacity in opacity screen (#157) (#162)
Reviewed-by: Pierre-Yves Lapersonne <[email protected]>
1 parent d319c30 commit 8dcd914

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased](https://github.com/Orange-OpenSource/ouds-ios/compare/0.3.0...develop)
88

9+
### Added
10+
11+
- [DemoApp] On opacity screen, add a border around the view showing the opacity ([#157](https://github.com/Orange-OpenSource/ouds-ios/issues/157))
12+
913
## [0.3.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.2.0...0.3.0) - 2024-10-04
1014

1115
### Added

OUDS/Core/Components/Sources/ViewModifiers/BorderModifiers/BorderModifier.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ struct BorderModifier: ViewModifier {
2929
/// The radius of the border to apply
3030
private let radius: BorderRadiusSemanticToken
3131

32-
/// The colors of the border
32+
/// The color token used for the border
3333
private let color: ColorSemanticToken
3434

3535
/// Color to apply depending to the `colorScheme`
3636
private var colorToApply: Color {
37-
(colorScheme == .light ? color.light.color : color.dark.color)
37+
color.color(for: colorScheme)
3838
}
3939

4040
/// To know if the device is in light mode or in dark mode

Showcase/Showcase.xcodeproj/project.pbxproj

+2-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
073543172CA172CA001187EA /* TypographyTokenElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypographyTokenElement.swift; sourceTree = "<group>"; };
8787
0735431A2CA18C48001187EA /* TypographyTokenPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypographyTokenPage.swift; sourceTree = "<group>"; };
8888
073543222CA192F9001187EA /* TokenElement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenElement.swift; sourceTree = "<group>"; };
89-
073543232CA192F9001187EA /* ShacaseElementPage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShacaseElementPage.swift; sourceTree = "<group>"; };
9089
074008222C942810006B8729 /* Snapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Snapshot.swift; sourceTree = "<group>"; };
9190
0740A9872C9833670069D24A /* Appfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Appfile; path = fastlane/Appfile; sourceTree = "<group>"; };
9291
0740A9882C9833670069D24A /* Fastfile */ = {isa = PBXFileReference; lastKnownFileType = text; name = Fastfile; path = fastlane/Fastfile; sourceTree = "<group>"; };
@@ -132,7 +131,7 @@
132131
51BD761C2C466FCF0033365D /* WebView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = "<group>"; };
133132
51BD761E2C466FCF0033365D /* Showcase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Showcase.swift; sourceTree = "<group>"; };
134133
51BD761F2C466FCF0033365D /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
135-
51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ShowcaseElementPage.swift; path = Showcase/Pages/Utils/ShowcaseElementPage.swift; sourceTree = "<group>"; };
134+
51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShowcaseElementPage.swift; sourceTree = "<group>"; };
136135
974E2EAB64D9123627CD7D29 /* Pods-DemoApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoApp.release.xcconfig"; path = "Target Support Files/Pods-DemoApp/Pods-DemoApp.release.xcconfig"; sourceTree = "<group>"; };
137136
BF4130905502F287757622E2 /* Pods-DemoApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DemoApp.debug.xcconfig"; path = "Target Support Files/Pods-DemoApp/Pods-DemoApp.debug.xcconfig"; sourceTree = "<group>"; };
138137
E0D3017314DBC1733F8D0C79 /* Pods_Showcase.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Showcase.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -182,8 +181,8 @@
182181
children = (
183182
0735430F2CA15440001187EA /* Cards */,
184183
51BD760F2C466FCF0033365D /* ShowcaseElementsPage.swift */,
184+
51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */,
185185
073543152CA17275001187EA /* ShowcaseElement.swift */,
186-
073543232CA192F9001187EA /* ShacaseElementPage.swift */,
187186
);
188187
path = Utils;
189188
sourceTree = "<group>";
@@ -262,7 +261,6 @@
262261
07FDCD882C296A500009AA13 = {
263262
isa = PBXGroup;
264263
children = (
265-
51E3FF0A2CAFD9AE00F1BC59 /* ShowcaseElementPage.swift */,
266264
07FDCDA32C296B170009AA13 /* 🛠 */,
267265
51BD76202C466FCF0033365D /* Showcase */,
268266
0740A9902C9873500069D24A /* ShowcaseTests */,

Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//
1313

1414
import OUDS
15+
import OUDSComponents // for BorderStyleModifier
1516
import OUDSTokensSemantic
1617
import SwiftUI
1718

@@ -50,6 +51,10 @@ struct OpacityTokenPage: View {
5051
Rectangle().fill(colorScheme == .dark ? .white : .black)
5152
.opacity(opacityToken)
5253
.frame(width: 44, height: 44)
54+
.oudsBorder(style: theme.borderStyleDefault,
55+
width: theme.borderWidthThin,
56+
radius: theme.borderRadiusNone,
57+
color: theme.colorContentDefault!)
5358
.transformEffect(CGAffineTransform(translationX: 10, y: 10))
5459
}
5560
.frame(width: 54, height: 54, alignment: .leading)

0 commit comments

Comments
 (0)