-
Notifications
You must be signed in to change notification settings - Fork 1
/
WhiteButton.swift
50 lines (41 loc) · 1.21 KB
/
WhiteButton.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// WhiteButton.swift
// BuildNetflixClone
//
// Created by Siddhant Mulajkar on 05/03/21.
//
import SwiftUI
struct WhiteButton: View {
var text: String
var imageName: String
var action:() -> Void
var body: some View {
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
HStack {
Spacer()
Image(systemName: imageName)
.font(.headline)
Text(text)
.bold()
.font(.system(size: 16))
.padding(.vertical, 3)
Spacer()
}
.background(Color.white)
.foregroundColor(.black)
.padding(.vertical, 6)
.cornerRadius(/*@START_MENU_TOKEN@*/3.0/*@END_MENU_TOKEN@*/)
})
}
}
struct WhiteButton_Previews: PreviewProvider {
static var previews: some View {
ZStack {
Color.black
.edgesIgnoringSafeArea(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/)
WhiteButton(text: "Play", imageName: "play.fill") {
//action goes here
}
}
}
}