Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Add migration guide card (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
quanglam2807 authored Jan 1, 2021
1 parent f010edb commit 09685bf
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 5 deletions.
Binary file modified build-resources/icon.icns
Binary file not shown.
Binary file modified build-resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "public/electron.js",
"repository": "https://github.com/webcatalog/translatium",
"author": {
"name": "WebCatalog Ltd",
"name": "Quang Lam",
"email": "[email protected]"
},
"license": "MPL-2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { ROUTE_LANGUAGE_LIST } from '../../../constants/routes';

import Dictionary from './dictionary';
import History from './history';
import RatingCard from './rating-card';
import MigrationCard from './migration-card';

const styles = (theme) => ({
container: {
Expand Down Expand Up @@ -327,7 +327,7 @@ class Home extends React.Component {
</CardActions>
</Card>

<RatingCard />
<MigrationCard />

{output.outputDict && output.source === 'translate.googleapis.com' && <Dictionary />}
</div>
Expand Down
69 changes: 69 additions & 0 deletions src/components/pages/home/migration-card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* 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 from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import Button from '@material-ui/core/Button';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import CardActions from '@material-ui/core/CardActions';
import Typography from '@material-ui/core/Typography';

import connectComponent from '../../../helpers/connect-component';

import {
requestOpenInBrowser,
} from '../../../senders';

const styles = (theme) => ({
card: {
borderTop: theme.palette.type === 'dark' ? 'none' : '1px solid rgba(0, 0, 0, 0.12)',
borderBottom: theme.palette.type === 'dark' ? 'none' : '1px solid rgba(0, 0, 0, 0.12)',
},
migrationCard: {
marginTop: theme.spacing(2),
},
migrationCardActions: {
justifyContent: 'center',
},
});

const MigrationCard = ({
classes,
}) => (
<Card elevation={0} square className={classNames(classes.card, classes.migrationCard)}>
<CardContent>
<Typography variant="body2" component="p">
Because of a few reasons, we have to republish Translatium under a new app listing.
To continue receiving updates, please reinstall the app from our new listing.
</Typography>
</CardContent>
<CardActions className={classes.migrationCardActions}>
<Button
variant="contained"
size="medium"
color="primary"
disableElevation
classes={{ label: classes.translateButtonLabel }}
onClick={() => {
requestOpenInBrowser('macappstore://apps.apple.com/app/id1547052291');
}}
>
Mac App Store
</Button>
</CardActions>
</Card>
);

MigrationCard.propTypes = {
classes: PropTypes.object.isRequired,
};

export default connectComponent(
MigrationCard,
null,
null,
styles,
);
2 changes: 1 addition & 1 deletion src/components/pages/home/rating-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const RatingCard = ({
onClick={() => {
requestSetPreference('ratingCardLastClicked', Date.now());
requestSetPreference('ratingCardDidRate', true);
requestOpenInBrowser('macappstore://apps.apple.com/app/id1176624652?action=write-review');
requestOpenInBrowser('macappstore://apps.apple.com/app/id1547052291?action=write-review');
}}
>
{getLocale('rateMacAppStore')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/preferences/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ const Preferences = (props) => {
<>
<Divider />
<ListItem button>
<ListItemText primary={getLocale('rateMacAppStore')} onClick={() => requestOpenInBrowser('macappstore://apps.apple.com/app/id1176624652?action=write-review')} />
<ListItemText primary={getLocale('rateMacAppStore')} onClick={() => requestOpenInBrowser('macappstore://apps.apple.com/app/id1547052291?action=write-review')} />
</ListItem>
</>
)}
Expand Down

0 comments on commit 09685bf

Please sign in to comment.