Added login and logout
This commit is contained in:
24
components/Buttons/create-time-ticket-button.component.jsx
Normal file
24
components/Buttons/create-time-ticket-button.component.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import { Text } from "react-native";
|
||||
import { Button } from "react-native-paper";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
|
||||
// const mapDispatchToProps = (dispatch) => ({
|
||||
// signOut: () => dispatch(employeeSignOut()),
|
||||
// });
|
||||
|
||||
export function AddTimeTicketButton({ doOnPress }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Button
|
||||
mode="text"
|
||||
compact={true}
|
||||
onPress={() => doOnPress()}
|
||||
icon="plus"
|
||||
>
|
||||
<Text style={{fontSize: 12}}>{t("timeticketbrowser.actions.ticket")}</Text>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
export default connect(null, null)(AddTimeTicketButton);
|
||||
25
components/Buttons/employee-sign-out-button.component.jsx
Normal file
25
components/Buttons/employee-sign-out-button.component.jsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from "react";
|
||||
import { Text } from "react-native";
|
||||
import { Button } from "react-native-paper";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { employeeSignOut } from "../../redux/employee/employee.actions";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
signOut: () => dispatch(employeeSignOut()),
|
||||
});
|
||||
|
||||
export function SignOutButton({ signOut }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Button
|
||||
mode="text"
|
||||
compact={true}
|
||||
onPress={() => signOut()}
|
||||
icon="logout"
|
||||
>
|
||||
<Text style={{fontSize: 12}}>{t("general.actions.logout")}</Text>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
export default connect(null, mapDispatchToProps)(SignOutButton);
|
||||
Reference in New Issue
Block a user