-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
218 additions
and
1 deletion.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,159 @@ | ||
import React from 'react'; | ||
import { View, StyleSheet, Text, TouchableOpacity } from 'react-native'; | ||
import { inject, observer } from 'mobx-react'; | ||
|
||
import Button from './Button'; | ||
import ModalBox from './ModalBox'; | ||
|
||
import ModalStore from '../stores/ModalStore'; | ||
|
||
import { localeString } from '../utils/LocaleUtils'; | ||
import { themeColor } from '../utils/ThemeUtils'; | ||
|
||
import Copy from '../assets/images/SVG/Copy.svg'; | ||
import Leaving from '../assets/images/SVG/Leaving.svg'; | ||
|
||
import Clipboard from '@react-native-clipboard/clipboard'; | ||
|
||
interface ModalProps { | ||
ModalStore: ModalStore; | ||
} | ||
|
||
@inject('ModalStore') | ||
@observer | ||
export default class ZeusModal extends React.Component<ModalProps, {}> { | ||
render() { | ||
const { ModalStore } = this.props; | ||
const { showModal, modalUrl, closeModal, onPress } = ModalStore; | ||
|
||
return ( | ||
<ModalBox | ||
isOpen={showModal} | ||
style={{ | ||
backgroundColor: 'transparent', | ||
paddingLeft: 24, | ||
paddingRight: 24, | ||
height: 580 | ||
}} | ||
swipeToClose={false} | ||
backButtonClose={false} | ||
backdropPressToClose={false} | ||
position="bottom" | ||
ref="modal" | ||
> | ||
<View | ||
style={{ | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
marginTop: 22 | ||
}} | ||
> | ||
<View | ||
style={{ | ||
backgroundColor: 'white', | ||
borderRadius: 30, | ||
padding: 35, | ||
alignItems: 'center', | ||
shadowColor: '#000', | ||
shadowOffset: { | ||
width: 0, | ||
height: 2 | ||
} | ||
}} | ||
> | ||
<Leaving /> | ||
<Text | ||
style={{ | ||
fontSize: 24, | ||
fontWeight: 'bold', | ||
color: 'black' | ||
}} | ||
> | ||
{localeString('components.Modal.externalLink')} | ||
</Text> | ||
<Text | ||
style={{ | ||
marginTop: 20, | ||
marginBottom: 25, | ||
textAlign: 'center' | ||
}} | ||
> | ||
{localeString('components.Modal.proceed')} | ||
</Text> | ||
<TouchableOpacity | ||
style={{ | ||
borderWidth: 1, | ||
borderRadius: 5, | ||
marginBottom: 25, | ||
backgroundColor: themeColor('background'), | ||
marginLeft: -25, | ||
marginRight: -25 | ||
}} | ||
onPress={() => Clipboard.setString(modalUrl)} | ||
> | ||
<Text | ||
style={{ | ||
padding: 20, | ||
paddingRight: 45, | ||
paddingBottom: 5, | ||
fontWeight: 'bold', | ||
color: themeColor('text') | ||
}} | ||
> | ||
{localeString('components.Modal.copyLink')} | ||
</Text> | ||
<Text | ||
style={{ | ||
padding: 20, | ||
paddingRight: 45, | ||
color: themeColor('text') | ||
}} | ||
> | ||
{modalUrl} | ||
</Text> | ||
<View | ||
style={{ | ||
position: 'absolute', | ||
right: 10, | ||
top: 10 | ||
}} | ||
> | ||
<Copy | ||
height="30px" | ||
width="30px" | ||
stroke={themeColor('text')} | ||
/> | ||
</View> | ||
</TouchableOpacity> | ||
<View style={styles.buttons}> | ||
<View style={styles.button}> | ||
<Button | ||
title={localeString('general.proceed')} | ||
onPress={onPress} | ||
tertiary | ||
></Button> | ||
</View> | ||
<View style={styles.button}> | ||
<Button | ||
title={localeString('general.cancel')} | ||
onPress={closeModal} | ||
></Button> | ||
</View> | ||
</View> | ||
</View> | ||
</View> | ||
</ModalBox> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
buttons: { | ||
width: '100%' | ||
}, | ||
button: { | ||
marginBottom: 20, | ||
width: 350 | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { action, observable } from 'mobx'; | ||
|
||
export default class ModalStore { | ||
@observable public showModal: boolean = false; | ||
@observable public modalUrl: string; | ||
@observable public clipboardValue: string; | ||
@observable public onPress: () => void; | ||
|
||
@action | ||
public toggleModal = (status: boolean) => { | ||
this.showModal = status; | ||
}; | ||
|
||
@action | ||
public setUrl = (text: string) => { | ||
this.modalUrl = text; | ||
}; | ||
|
||
@action | ||
public closeModal = () => { | ||
this.showModal = false; | ||
}; | ||
|
||
@action | ||
public setAction = (action: any) => { | ||
this.onPress = action; | ||
}; | ||
|
||
@action | ||
public setClipboardValue = (value: string) => { | ||
this.clipboardValue = value; | ||
}; | ||
} |
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