-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(journal): ajout du contexte de la journée dans le journal
- Loading branch information
Showing
5 changed files
with
58 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import {StyleSheet, View} from 'react-native'; | ||
import Text from '../../components/MyText'; | ||
|
||
const Context = ({data}) => { | ||
if (!data || !data.userComment) return null; | ||
|
||
const Detail = ({title, text}) => { | ||
if (!text) return null; | ||
return ( | ||
<Text> | ||
<Text style={styles.boldText}>{title} : </Text> | ||
<Text style={styles.italic}>{text}</Text> | ||
</Text> | ||
); | ||
}; | ||
|
||
return ( | ||
<> | ||
<View style={styles.divider} /> | ||
<View style={styles.container}> | ||
<View style={styles.textContainer}> | ||
<Detail title="Contexte" text={data.userComment || 'Oui'} /> | ||
</View> | ||
</View> | ||
</> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
paddingHorizontal: 20, | ||
paddingVertical: 10, | ||
}, | ||
textContainer: {width: '100%'}, | ||
boldText: {fontWeight: 'bold'}, | ||
italic: {fontStyle: 'italic'}, | ||
divider: { | ||
height: 1, | ||
backgroundColor: 'rgba(38, 56, 124, 0.08)', | ||
marginVertical: 10, | ||
width: '60%', | ||
alignSelf: 'center', | ||
}, | ||
}); | ||
|
||
export default Context; |
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