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.

ProxiwashAboutScreen.js 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // @flow
  2. import * as React from 'react';
  3. import {Image, View} from 'react-native';
  4. import i18n from 'i18n-js';
  5. import {Card, Avatar, Paragraph, Title} from 'react-native-paper';
  6. import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
  7. import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
  8. const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proxiwash.png';
  9. export type LaverieType = {
  10. id: string,
  11. title: string,
  12. subtitle: string,
  13. description: string,
  14. tarif: string,
  15. paymentMethods: string,
  16. icon: string,
  17. url: string,
  18. };
  19. export const PROXIWASH_DATA = {
  20. washinsa: {
  21. id: 'washinsa',
  22. title: i18n.t('screens.proxiwash.washinsa.title'),
  23. subtitle: i18n.t('screens.proxiwash.washinsa.subtitle'),
  24. description: i18n.t('screens.proxiwash.washinsa.description'),
  25. tarif: i18n.t('screens.proxiwash.washinsa.tariff'),
  26. paymentMethods: i18n.t('screens.proxiwash.washinsa.paymentMethods'),
  27. icon: 'school-outline',
  28. url:
  29. 'https://etud.insa-toulouse.fr/~amicale_app/v2/washinsa/washinsa_data.json',
  30. },
  31. tripodeB: {
  32. id: 'tripodeB',
  33. title: i18n.t('screens.proxiwash.tripodeB.title'),
  34. subtitle: i18n.t('screens.proxiwash.tripodeB.subtitle'),
  35. description: i18n.t('screens.proxiwash.tripodeB.description'),
  36. tarif: i18n.t('screens.proxiwash.tripodeB.tariff'),
  37. paymentMethods: i18n.t('screens.proxiwash.tripodeB.paymentMethods'),
  38. icon: 'domain',
  39. url:
  40. 'https://etud.insa-toulouse.fr/~amicale_app/v2/washinsa/tripode_b_data.json',
  41. },
  42. };
  43. /**
  44. * Class defining the proxiwash about screen.
  45. */
  46. export default class ProxiwashAboutScreen extends React.Component<null> {
  47. static getCardItem(item: LaverieType): React.Node {
  48. return (
  49. <Card style={{margin: 5}}>
  50. <Card.Title
  51. title={item.title}
  52. subtitle={item.subtitle}
  53. left={(iconProps: CardTitleIconPropsType): React.Node => (
  54. <Avatar.Icon size={iconProps.size} icon={item.icon} />
  55. )}
  56. />
  57. <Card.Content>
  58. <Paragraph>{item.description}</Paragraph>
  59. <Title>{i18n.t('screens.proxiwash.tariffs')}</Title>
  60. <Paragraph>{item.tarif}</Paragraph>
  61. <Title>{i18n.t('screens.proxiwash.paymentMethods')}</Title>
  62. <Paragraph>{item.paymentMethods}</Paragraph>
  63. </Card.Content>
  64. </Card>
  65. );
  66. }
  67. render(): React.Node {
  68. return (
  69. <CollapsibleScrollView style={{padding: 5}} hasTab>
  70. <View
  71. style={{
  72. width: '100%',
  73. height: 100,
  74. marginTop: 20,
  75. marginBottom: 20,
  76. justifyContent: 'center',
  77. alignItems: 'center',
  78. }}>
  79. <Image
  80. source={{uri: LOGO}}
  81. style={{height: '100%', width: '100%', resizeMode: 'contain'}}
  82. />
  83. </View>
  84. {ProxiwashAboutScreen.getCardItem(PROXIWASH_DATA.washinsa)}
  85. {ProxiwashAboutScreen.getCardItem(PROXIWASH_DATA.tripodeB)}
  86. <Card style={{margin: 5}}>
  87. <Card.Title
  88. title={i18n.t('screens.proxiwash.dryer')}
  89. left={(iconProps: CardTitleIconPropsType): React.Node => (
  90. <Avatar.Icon size={iconProps.size} icon="tumble-dryer" />
  91. )}
  92. />
  93. <Card.Content>
  94. <Title>{i18n.t('screens.proxiwash.procedure')}</Title>
  95. <Paragraph>{i18n.t('screens.proxiwash.dryerProcedure')}</Paragraph>
  96. <Title>{i18n.t('screens.proxiwash.tips')}</Title>
  97. <Paragraph>{i18n.t('screens.proxiwash.dryerTips')}</Paragraph>
  98. </Card.Content>
  99. </Card>
  100. <Card style={{margin: 5}}>
  101. <Card.Title
  102. title={i18n.t('screens.proxiwash.washer')}
  103. left={(iconProps: CardTitleIconPropsType): React.Node => (
  104. <Avatar.Icon size={iconProps.size} icon="washing-machine" />
  105. )}
  106. />
  107. <Card.Content>
  108. <Title>{i18n.t('screens.proxiwash.procedure')}</Title>
  109. <Paragraph>{i18n.t('screens.proxiwash.washerProcedure')}</Paragraph>
  110. <Title>{i18n.t('screens.proxiwash.tips')}</Title>
  111. <Paragraph>{i18n.t('screens.proxiwash.washerTips')}</Paragraph>
  112. </Card.Content>
  113. </Card>
  114. </CollapsibleScrollView>
  115. );
  116. }
  117. }