Skip to content

Commit ef39463

Browse files
committed
ui changes
1 parent ad1f667 commit ef39463

File tree

71 files changed

+2910
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2910
-24
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import SwiftUI
16+
import FirebaseAuth
17+
18+
enum AuthProvider: CaseIterable {
19+
case google
20+
case facebook
21+
case twitter
22+
case github
23+
case email
24+
case phone
25+
case anonymous
26+
case microsoft
27+
case yahoo
28+
case apple
29+
30+
var id: String {
31+
switch self {
32+
case .google: return GoogleAuthProvider.id
33+
case .facebook: return FacebookAuthProvider.id
34+
case .twitter: return TwitterAuthProvider.id
35+
case .github: return GitHubAuthProvider.id
36+
case .email: return EmailAuthProvider.id
37+
case .phone: return PhoneAuthProvider.id
38+
case .anonymous: return "anonymous"
39+
case .microsoft: return "microsoft.com"
40+
case .yahoo: return "yahoo.com"
41+
case .apple: return "apple.com"
42+
}
43+
}
44+
45+
var buttonTitle: String {
46+
switch self {
47+
case .google:
48+
return "Sign in with Google"
49+
case .facebook:
50+
return "Sign in with Facebook"
51+
case .twitter:
52+
return "Sign in with Twitter"
53+
case .github:
54+
return "Sign in with GitHub"
55+
case .email:
56+
return "Sign in with Email"
57+
case .phone:
58+
return "Sign in with Phone"
59+
case .anonymous:
60+
return "Sign in Anonymously"
61+
case .microsoft:
62+
return "Sign in with Microsoft"
63+
case .yahoo:
64+
return "Sign in with Yahoo"
65+
case .apple:
66+
return "Sign in with Apple"
67+
}
68+
}
69+
70+
var isSocialProvider: Bool {
71+
switch self {
72+
case .google, .facebook, .twitter, .github:
73+
return true
74+
default:
75+
return false
76+
}
77+
}
78+
79+
static func from(id: String) -> AuthProvider? {
80+
Self.allCases.first { $0.id == id }
81+
}
82+
83+
var providerStyle: ProviderStyle {
84+
switch self {
85+
case .google:
86+
return ProviderStyle(
87+
icon: .fuiIcGoogleg,
88+
backgroundColor: Color(hex: 0xFFFFFF),
89+
contentColor: Color(hex: 0x757575)
90+
)
91+
case .facebook:
92+
return ProviderStyle(
93+
icon: .fuiIcFacebook,
94+
backgroundColor: Color(hex: 0x3B5998),
95+
contentColor: Color(hex: 0xFFFFFF)
96+
)
97+
case .twitter:
98+
return ProviderStyle(
99+
icon: .fuiIcTwitterBird,
100+
backgroundColor: Color(hex: 0x5BAAF4),
101+
contentColor: Color(hex: 0xFFFFFF)
102+
)
103+
case .github:
104+
return ProviderStyle(
105+
icon: .fuiIcGithub,
106+
backgroundColor: Color(hex: 0x24292E),
107+
contentColor: Color(hex: 0xFFFFFF)
108+
)
109+
case .email:
110+
return ProviderStyle(
111+
icon: .fuiIcMail,
112+
backgroundColor: Color(hex: 0xD0021B),
113+
contentColor: Color(hex: 0xFFFFFF)
114+
)
115+
case .phone:
116+
return ProviderStyle(
117+
icon: .fuiIcPhone,
118+
backgroundColor: Color(hex: 0x43C5A5),
119+
contentColor: Color(hex: 0xFFFFFF)
120+
)
121+
case .anonymous:
122+
return ProviderStyle(
123+
icon: .fuiIcAnonymous,
124+
backgroundColor: Color(hex: 0xF4B400),
125+
contentColor: Color(hex: 0xFFFFFF)
126+
)
127+
case .microsoft:
128+
return ProviderStyle(
129+
icon: .fuiIcMicrosoft,
130+
backgroundColor: Color(hex: 0x2F2F2F),
131+
contentColor: Color(hex: 0xFFFFFF)
132+
)
133+
case .yahoo:
134+
return ProviderStyle(
135+
icon: .fuiIcYahoo,
136+
backgroundColor: Color(hex: 0x720E9E),
137+
contentColor: Color(hex: 0xFFFFFF)
138+
)
139+
case .apple:
140+
return ProviderStyle(
141+
icon: .fuiIcApple,
142+
backgroundColor: Color(hex: 0x000000),
143+
contentColor: Color(hex: 0xFFFFFF)
144+
)
145+
}
146+
}
147+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import SwiftUI
16+
17+
extension Color {
18+
init(hex: Int, opacity: Double = 1.0) {
19+
let red = Double((hex & 0xFF0000) >> 16) / 255.0
20+
let green = Double((hex & 0xFF00) >> 8) / 255.0
21+
let blue = Double((hex & 0xFF) >> 0) / 255.0
22+
self.init(.sRGB, red: red, green: green, blue: blue, opacity: opacity)
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
},
8+
{
9+
"appearances" : [
10+
{
11+
"appearance" : "luminosity",
12+
"value" : "dark"
13+
}
14+
],
15+
"idiom" : "universal",
16+
"platform" : "ios",
17+
"size" : "1024x1024"
18+
},
19+
{
20+
"appearances" : [
21+
{
22+
"appearance" : "luminosity",
23+
"value" : "tinted"
24+
}
25+
],
26+
"idiom" : "universal",
27+
"platform" : "ios",
28+
"size" : "1024x1024"
29+
}
30+
],
31+
"info" : {
32+
"author" : "xcode",
33+
"version" : 1
34+
}
35+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "firebase_auth_120dp 2.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "firebase_auth_120dp 1.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "firebase_auth_120dp.png",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "fui_ic_anonymous_white_24dp 2.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "fui_ic_anonymous_white_24dp 1.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "fui_ic_anonymous_white_24dp.png",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}

0 commit comments

Comments
 (0)