Application Android et IOS pour l'amicale des élèves
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ActionsDashboardItem.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // @flow
  2. import * as React from 'react';
  3. import {Button, Card, withTheme} from 'react-native-paper';
  4. import {StyleSheet} from "react-native";
  5. import i18n from 'i18n-js';
  6. type Props = {
  7. navigation: Object,
  8. theme: Object,
  9. }
  10. class ActionsDashBoardItem extends React.PureComponent<Props> {
  11. colors: Object;
  12. constructor(props) {
  13. super(props);
  14. this.colors = this.props.theme.colors;
  15. }
  16. openDrawer = () => this.props.navigation.openDrawer();
  17. gotToSettings = () => this.props.navigation.navigate("SettingsScreen");
  18. render() {
  19. return (
  20. <Card style={{
  21. ...styles.card,
  22. borderColor: this.colors.primary,
  23. }}>
  24. <Card.Content style={styles.content}>
  25. <Button
  26. icon="information"
  27. mode="contained"
  28. onPress={this.openDrawer}
  29. style={styles.servicesButton}
  30. >
  31. {i18n.t("homeScreen.servicesButton")}
  32. </Button>
  33. <Button
  34. icon="settings"
  35. mode="contained"
  36. onPress={this.gotToSettings}
  37. style={styles.settingsButton}
  38. compact
  39. />
  40. </Card.Content>
  41. </Card>
  42. );
  43. }
  44. }
  45. const styles = StyleSheet.create({
  46. card: {
  47. width: 'auto',
  48. marginLeft: 10,
  49. marginRight: 10,
  50. marginTop: 10,
  51. overflow: 'hidden',
  52. elevation: 4,
  53. borderWidth: 1,
  54. },
  55. avatar: {
  56. backgroundColor: 'transparent'
  57. },
  58. content: {
  59. flex: 1,
  60. flexDirection: 'row',
  61. },
  62. servicesButton: {
  63. marginLeft: 'auto',
  64. marginRight: 5,
  65. },
  66. settingsButton: {
  67. marginLeft: 5,
  68. marginRight: 'auto',
  69. }
  70. });
  71. export default withTheme(ActionsDashBoardItem);