This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
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
1 parent
cd5f764
commit c738954
Showing
11 changed files
with
21,959 additions
and
60 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ import connectComponent from '../../helpers/connect-component'; | |
import getLocale from '../../helpers/get-locale'; | ||
|
||
import { close } from '../../state/root/dialog-about/actions'; | ||
import { open as openDialogOpenSourceNotices } from '../../state/root/dialog-open-source-notices/actions'; | ||
import translatiumIconPng from '../../images/products/[email protected]'; | ||
|
||
import { requestOpenInBrowser } from '../../senders'; | ||
|
@@ -61,6 +62,7 @@ const About = (props) => { | |
const { | ||
classes, | ||
onClose, | ||
onOpenDialogOpenSourceNotices, | ||
open, | ||
} = props; | ||
|
||
|
@@ -95,6 +97,14 @@ const About = (props) => { | |
{getLocale('support')} | ||
</Button> | ||
|
||
<br /> | ||
|
||
<Button | ||
onClick={onOpenDialogOpenSourceNotices} | ||
> | ||
Open Source Notices | ||
</Button> | ||
|
||
<Typography variant="body2" className={classes.madeBy}> | ||
<span>Made with </span> | ||
<span role="img" aria-label="love">❤</span> | ||
|
@@ -116,6 +126,7 @@ const About = (props) => { | |
About.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
onOpenDialogOpenSourceNotices: PropTypes.func.isRequired, | ||
open: PropTypes.bool.isRequired, | ||
}; | ||
|
||
|
@@ -125,6 +136,7 @@ const mapStateToProps = (state) => ({ | |
|
||
const actionCreators = { | ||
close, | ||
openDialogOpenSourceNotices, | ||
}; | ||
|
||
export default connectComponent( | ||
|
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,75 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import React, { useEffect, useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
|
||
import connectComponent from '../../helpers/connect-component'; | ||
|
||
import { close } from '../../state/root/dialog-open-source-notices/actions'; | ||
|
||
import EnhancedDialogTitle from '../shared/enhanced-dialog-title'; | ||
|
||
const styles = (theme) => ({ | ||
dialogContent: { | ||
whiteSpace: 'pre-line', | ||
paddingBottom: theme.spacing(2), | ||
overflowX: 'hidden', | ||
}, | ||
}); | ||
|
||
const DialogOpenSourceNotices = ({ | ||
classes, | ||
onClose, | ||
open, | ||
}) => { | ||
const [content, setContent] = useState('Loading...'); | ||
useEffect(() => { | ||
window.fetch('./open-source-notices.txt') | ||
.then((res) => res.text()) | ||
.then((text) => { | ||
setContent(text); | ||
}) | ||
// eslint-disable-next-line no-console | ||
.catch(console.log); | ||
}); | ||
|
||
return ( | ||
<Dialog | ||
className={classes.root} | ||
onClose={onClose} | ||
open={open} | ||
> | ||
<EnhancedDialogTitle onClose={onClose}> | ||
Open Source Notices | ||
</EnhancedDialogTitle> | ||
<DialogContent className={classes.dialogContent}> | ||
{content} | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
DialogOpenSourceNotices.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
open: PropTypes.bool.isRequired, | ||
}; | ||
|
||
const mapStateToProps = (state) => ({ | ||
open: state.dialogOpenSourceNotices.open, | ||
}); | ||
|
||
const actionCreators = { | ||
close, | ||
}; | ||
|
||
export default connectComponent( | ||
DialogOpenSourceNotices, | ||
mapStateToProps, | ||
actionCreators, | ||
styles, | ||
); |
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,15 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { | ||
DIALOG_OPEN_SOURCE_NOTICES_CLOSE, | ||
DIALOG_OPEN_SOURCE_NOTICES_OPEN, | ||
} from '../../../constants/actions'; | ||
|
||
export const close = () => ({ | ||
type: DIALOG_OPEN_SOURCE_NOTICES_CLOSE, | ||
}); | ||
|
||
export const open = () => ({ | ||
type: DIALOG_OPEN_SOURCE_NOTICES_OPEN, | ||
}); |
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,19 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { combineReducers } from 'redux'; | ||
|
||
import { | ||
DIALOG_OPEN_SOURCE_NOTICES_CLOSE, | ||
DIALOG_OPEN_SOURCE_NOTICES_OPEN, | ||
} from '../../../constants/actions'; | ||
|
||
const open = (state = false, action) => { | ||
switch (action.type) { | ||
case DIALOG_OPEN_SOURCE_NOTICES_CLOSE: return false; | ||
case DIALOG_OPEN_SOURCE_NOTICES_OPEN: return true; | ||
default: return state; | ||
} | ||
}; | ||
|
||
export default combineReducers({ open }); |
Oops, something went wrong.