Skip to content

Commit

Permalink
added static require
Browse files Browse the repository at this point in the history
  • Loading branch information
danicaMat committed Feb 25, 2022
1 parent 59bf7e5 commit 536a9ca
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

This project is made possible by the people and organizations listed in this document.


## Contributors

<img src="docs/images/id_pass_logo.svg" width="150" height="50">


![ID PASS](id_pass_logo.png)

[ID PASS](https://www.idpass.org/)

<img src="docs/images/newlogic_logo.svg" width="100" height="200">
![Newlogic](newlogic_logo.png)

[Newlogic](https://www.newlogic.com/)
Binary file added docs/images/id_pass_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/newlogic_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 26 additions & 3 deletions screens/Profile/Credits.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Asset } from 'expo-asset';
import { Dimensions, StyleSheet, View } from 'react-native';
import { Dimensions, Image, StyleSheet, View } from 'react-native';
import { Divider, Icon, ListItem, Overlay } from 'react-native-elements';
import Markdown from 'react-native-simple-markdown'
import { Button, Text, Column, Row } from '../../components/ui';
Expand All @@ -10,7 +10,10 @@ const mdFile = require('../../Credits.md')
export const Credits: React.FC<CreditsProps> = (props) => {
const [isViewing, setIsViewing] = useState(false);
const [content, setContent] = useState("");

const images = {
'newlogic_logo.png' : require('../../docs/images/newlogic_logo.png'),
'id_pass_logo.png' : require('../../docs/images/id_pass_logo.png'),
}
const styles = StyleSheet.create({
buttonContainer: {
position: 'absolute',
Expand All @@ -29,6 +32,9 @@ export const Credits: React.FC<CreditsProps> = (props) => {
const markdownStyles = {
heading1: {
fontSize: 24,
},
image: {
maxWidth: 150
}
}

Expand All @@ -39,6 +45,20 @@ export const Credits: React.FC<CreditsProps> = (props) => {
setContent(file);
}

const rules = {
image: {
react: (node, output, state) => (
<View key={`image-${state.key}`}>
<Image
style={{ width: 150, height: 50 }}
source={images[node.target]}
resizeMode="contain"
/>
</View>
),
}
}

useEffect(() => {
(async () => {
await fetchLocalFile();
Expand All @@ -65,7 +85,10 @@ export const Credits: React.FC<CreditsProps> = (props) => {
</Row>
<Divider />
<View style={styles.markdownView}>
<Markdown children={content} />
<Markdown
rules={rules}
children={content}
styles={markdownStyles}/>
</View>
</View>

Expand Down

0 comments on commit 536a9ca

Please sign in to comment.