-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antoine Robiez
committed
Mar 8, 2024
1 parent
fbaf20b
commit 8b0d49a
Showing
12 changed files
with
87 additions
and
63 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
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
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
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
12 changes: 12 additions & 0 deletions
12
shared/data/src/commonMain/kotlin/fr/androidmakers/store/firebase/FirebaseUserRepository.kt
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,12 @@ | ||
package fr.androidmakers.store.firebase | ||
|
||
import dev.gitlive.firebase.Firebase | ||
import dev.gitlive.firebase.auth.auth | ||
import fr.androidmakers.domain.model.User | ||
import fr.androidmakers.domain.repo.UserRepository | ||
|
||
class FirebaseUserRepository : UserRepository { | ||
override suspend fun getUser(): User? { | ||
return Firebase.auth.currentUser?.toUser() | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
shared/data/src/commonMain/kotlin/fr/androidmakers/store/firebase/mappers.kt
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,8 @@ | ||
package fr.androidmakers.store.firebase | ||
|
||
import dev.gitlive.firebase.auth.FirebaseUser | ||
import fr.androidmakers.domain.model.User | ||
|
||
fun FirebaseUser.toUser(): User { | ||
return User(uid, photoURL) | ||
} |
6 changes: 6 additions & 0 deletions
6
shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/model/User.kt
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,6 @@ | ||
package fr.androidmakers.domain.model | ||
|
||
data class User( | ||
val id: String, | ||
val photoUrl: String? | ||
) |
7 changes: 7 additions & 0 deletions
7
shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/repo/UserRepository.kt
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,7 @@ | ||
package fr.androidmakers.domain.repo | ||
|
||
import fr.androidmakers.domain.model.User | ||
|
||
interface UserRepository { | ||
suspend fun getUser(): User? | ||
} |