Implement Slack authentication on iOS
This commit is contained in:
parent
ec8cc533ab
commit
df549d48e6
10 changed files with 419 additions and 81 deletions
|
|
@ -30,59 +30,9 @@ struct NetworkView<Content: View>: View {
|
|||
}
|
||||
}
|
||||
|
||||
struct AddNetworkView: View {
|
||||
var body: some View {
|
||||
Text("Add Network")
|
||||
.frame(maxWidth: .infinity, minHeight: 175, maxHeight: 175)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(style: .init(lineWidth: 2, dash: [6]))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
extension NetworkView where Content == AnyView {
|
||||
init(network: any Network) {
|
||||
color = network.backgroundColor
|
||||
content = { AnyView(network.label) }
|
||||
}
|
||||
}
|
||||
|
||||
struct NetworkCarouselView: View {
|
||||
var networks: [any Network] = [
|
||||
HackClub(id: "1"),
|
||||
HackClub(id: "2"),
|
||||
WireGuard(id: "4"),
|
||||
HackClub(id: "5"),
|
||||
]
|
||||
|
||||
var body: some View {
|
||||
ScrollView(.horizontal) {
|
||||
LazyHStack {
|
||||
ForEach(networks, id: \.id) { network in
|
||||
NetworkView(network: network)
|
||||
.containerRelativeFrame(.horizontal, count: 10, span: 7, spacing: 0, alignment: .center)
|
||||
.scrollTransition(.interactive, axis: .horizontal) { content, phase in
|
||||
content
|
||||
.scaleEffect(1.0 - abs(phase.value) * 0.1)
|
||||
}
|
||||
}
|
||||
AddNetworkView()
|
||||
}
|
||||
.scrollTargetLayout()
|
||||
}
|
||||
.scrollClipDisabled()
|
||||
.scrollIndicators(.hidden)
|
||||
.defaultScrollAnchor(.center)
|
||||
.scrollTargetBehavior(.viewAligned)
|
||||
.containerRelativeFrame(.horizontal)
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct NetworkCarouselView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
NetworkCarouselView()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue