Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Add deprecation message and link to web UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjswensen committed Mar 23, 2019
1 parent 1a9c338 commit d8da139
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function createWindow () {
width: 1218,
minWidth: 1126,
height: 732,
minHeight: 540,
minHeight: 582,
title: 'Themer',
titleBarStyle: 'hiddenInset',
webPreferences: {
Expand Down
13 changes: 9 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"lodash": "^4.17.10",
"pn": "^1.1.0",
"prettier": "^1.13.5",
"qs": "^6.7.0",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-redux": "^5.0.7",
Expand Down
2 changes: 2 additions & 0 deletions renderer/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ColorSet from './ColorSet';
import Dialogs from './Dialogs';
import UpdateNotifier from './UpdateNotifier';
import css from './App.css';
import DeprecationNotice from './DeprecationNotice';

const App = ({ isDialogOpen, title, isFocusMode }) => (
<section className={ css.gui }>
Expand All @@ -20,6 +21,7 @@ const App = ({ isDialogOpen, title, isFocusMode }) => (
<ColorSet />
<ColorSet light={ true } />
</div>
<DeprecationNotice />
<UpdateNotifier />
</div>
<Dialogs />
Expand Down
12 changes: 12 additions & 0 deletions renderer/components/DeprecationNotice.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.deprecationNotice {
background-color: #282629;
color: #FFFCFF;
padding: 0.75em;
text-align: center;
}

.deprecationNotice a {
color: #66BFFF;
text-decoration: underline;
cursor: pointer;
}
40 changes: 40 additions & 0 deletions renderer/components/DeprecationNotice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import { shell } from 'electron';
import qs from 'qs';
import { connect } from 'react-redux';
import { External } from './Icons';
import Emoji from './Emoji';
import css from './DeprecationNotice.css';

const getQueryString = colorSets => qs.stringify(
{
colors: colorSets,
activeColorSet: Object.values(colorSets.dark).filter(Boolean).length ? 'dark' : 'light',
calculateIntermediaryShades: {
dark: false,
light: false,
}
},
{ allowDots: true },
);

const DeprecationNotice = ({ colorSets }) => (
<div className={ css.deprecationNotice }>
<Emoji emoji="⚠️"/>
{' '}
Heads up: this GUI for themer has been deprecated.
{' '}
<a onClick={ () => shell.openExternal(`https://themer.mjswensen.com?${getQueryString(colorSets)}`) }>
Open current theme in the new Web UI
<External />
</a>
</div>
);

const mapStateToProps = state => ({
colorSets: state.colorSets
});

export default connect(
mapStateToProps,
)(DeprecationNotice);

0 comments on commit d8da139

Please sign in to comment.