-
Notifications
You must be signed in to change notification settings - Fork 4
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 #1098 from adevinta/demo-snackbar-uiview
[Demo] Added Snackbar demo
- Loading branch information
Showing
55 changed files
with
995 additions
and
2,184 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Components.swift | ||
// SparkDemo | ||
// | ||
// Created by louis.borlee on 19/09/2024. | ||
// Copyright © 2024 Adevinta. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
enum Components: CaseIterable { | ||
case snackbar | ||
} |
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
41 changes: 41 additions & 0 deletions
41
.Demo/Classes/View/Components/Main/Configuration/SwiftUI/OptionalEnumSelector.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,41 @@ | ||
// | ||
// OptionalEnumSelector.swift | ||
// SparkDemo | ||
// | ||
// Created by louis.borlee on 19/09/2024. | ||
// Copyright © 2024 Adevinta. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct OptionalEnumSelector<Value>: View where Value: CaseIterable & Hashable { | ||
let title: String | ||
let dialogTitle: String | ||
let values: [Value] | ||
@Binding var value: Value? | ||
|
||
var nameFormatter: (Value?) -> String = { value in | ||
return value?.name ?? "Default" | ||
} | ||
|
||
@State private var isPresented = false | ||
|
||
var body: some View { | ||
HStack() { | ||
Text("\(title): ").bold() | ||
Button(self.nameFormatter(value)) { | ||
self.isPresented = true | ||
} | ||
.confirmationDialog(dialogTitle, isPresented: self.$isPresented) { | ||
ForEach(self.values, id: \.self) { value in | ||
Button(self.nameFormatter(value)) { | ||
self.value = value | ||
} | ||
} | ||
Button("Default") { | ||
self.value = nil | ||
} | ||
} | ||
} | ||
} | ||
} |
43 changes: 0 additions & 43 deletions
43
.Demo/Classes/View/ListView/Cells/BadgeCell/BadgeCell.swift
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
.Demo/Classes/View/ListView/Cells/BadgeCell/BadgeConfiguration.swift
This file was deleted.
Oops, something went wrong.
77 changes: 0 additions & 77 deletions
77
.Demo/Classes/View/ListView/Cells/ButtonCell/ButtonCell.swift
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
.Demo/Classes/View/ListView/Cells/ButtonCell/ButtonConfiguration.swift
This file was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
.Demo/Classes/View/ListView/Cells/CheckboxCell/CheckboxCell.swift
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
.Demo/Classes/View/ListView/Cells/CheckboxCell/CheckboxConfiguration.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.