2024-03-22 23:41:51 +01:00
|
|
|
import { Button } from "react-native-paper"
|
|
|
|
|
2024-05-20 15:05:34 +02:00
|
|
|
import { About } from "@/presentation/react-native/components/About"
|
2024-03-22 23:41:51 +01:00
|
|
|
import { useAuthentication } from "@/presentation/react/contexts/Authentication"
|
|
|
|
|
|
|
|
const SettingsPage: React.FC = () => {
|
|
|
|
const { logout, authenticationPresenter } = useAuthentication()
|
|
|
|
|
|
|
|
const handleLogout = async (): Promise<void> => {
|
|
|
|
await authenticationPresenter.logout()
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2024-05-20 15:05:34 +02:00
|
|
|
<About
|
|
|
|
actionButton={
|
|
|
|
<Button
|
|
|
|
mode="contained"
|
|
|
|
labelStyle={{ fontSize: 18 }}
|
|
|
|
onPress={handleLogout}
|
|
|
|
loading={logout.state === "loading"}
|
|
|
|
disabled={logout.state === "loading"}
|
|
|
|
>
|
|
|
|
Logout
|
|
|
|
</Button>
|
|
|
|
}
|
|
|
|
/>
|
2024-03-22 23:41:51 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsPage
|