Skip to content

Commit

Permalink
Added minimize button
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Rodg committed Mar 24, 2018
1 parent d7455f3 commit 5fefcdc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cryptocap",
"version": "1.0.5",
"version": "1.0.6",
"description":
"A taskbar application for tracking your cryptocurrencies. Built using electron, react, and webpack.",
"main": "main.js",
Expand All @@ -16,11 +16,11 @@
"package-mac": "webpack --config webpack.build.config.js",
"package-mas": "webpack --config webpack.build.config.js",
"postpackage-win":
"electron-packager ./ CryptoCap --out=./builds/output --asar --app-version=1.0.5 --overwrite --platform=win32 --arch=all --icon=assets/icons/win/cryptocap.png.ico --prune=true --version-string.FileDescription='CryptoCap' --app-bundle-id=cryptocap",
"electron-packager ./ CryptoCap --out=./builds/output --asar --app-version=1.0.6 --overwrite --platform=win32 --arch=all --icon=assets/icons/win/cryptocap.png.ico --prune=true --version-string.FileDescription='CryptoCap' --app-bundle-id=cryptocap",
"postpackage-mac":
"electron-packager ./ CryptoCap --out=./builds/output --asar --app-version=1.0.5 --overwrite --platform=darwin --arch=x64 --icon=assets/MyIcon.icns --prune=true --version-string.FileDescription='CryptoCap' --app-bundle-id=cryptocap --app-category-type=public.app-category.finance",
"electron-packager ./ CryptoCap --out=./builds/output --asar --app-version=1.0.6 --overwrite --platform=darwin --arch=x64 --icon=assets/MyIcon.icns --prune=true --version-string.FileDescription='CryptoCap' --app-bundle-id=cryptocap --app-category-type=public.app-category.finance",
"postpackage-mas":
"electron-packager ./ CryptoCap --out=./builds/output --asar --app-version=1.0.5 --overwrite --platform=mas --arch=x64 --icon=assets/MyIcon.icns --prune=true --version-string.FileDescription='CryptoCap' --app-bundle-id=com.curtisrodgers.cryptocap --helper-bundle-id=com.curtisrodgers.cryptocap.helper --app-category-type=public.app-category.finance --app-copyright='Copyright © 2018 Curtis Rodgers'",
"electron-packager ./ CryptoCap --out=./builds/output --asar --app-version=1.0.6 --overwrite --platform=mas --arch=x64 --icon=assets/MyIcon.icns --prune=true --version-string.FileDescription='CryptoCap' --app-bundle-id=com.curtisrodgers.cryptocap --helper-bundle-id=com.curtisrodgers.cryptocap.helper --app-category-type=public.app-category.finance --app-copyright='Copyright © 2018 Curtis Rodgers'",
"sign-mas-dev":
"electron-osx-sign ./builds/output/CryptoCap-mas-x64/CryptoCap.app --verbose --type=development --entitlements=./builds/entitlements/mas.entitlements --entitlements-inherit=./builds/entitlements/mas.inherit.entitlements",
"sign-mas":
Expand Down
7 changes: 7 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ class App extends Component {
app.quit();
}

// Minimize button clicked
handleMinimize() {
app.hide();
app.blur();
}

// Fiat Currency Type Changed
handleCurrencyTypeChange = select => {
const updateObject = {
Expand Down Expand Up @@ -386,6 +392,7 @@ class App extends Component {
<ContentHome
{...props}
onCloseApp={this.handleCloseApp}
onMinimizeApp={this.handleMinimize}
globalData={this.state.globalData}
selectedFiatCurrency={this.state.selectedFiatCurrency}
selectedLocale={this.state.selectedLocale}
Expand Down
23 changes: 23 additions & 0 deletions src/components/Common/MinimizeButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Libraries
import React from "react";

// Icons
import { IconButton } from "./IconButton";

const MinimizeButton = ({ onMinimize }) => {
return (
<IconButton onClick={onMinimize}>
<svg
fill="#000000"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<line x1="5" y1="14" x2="19" y2="14" strokeWidth="2" stroke="#aaa" />
</svg>
</IconButton>
);
};

export default MinimizeButton;
6 changes: 5 additions & 1 deletion src/components/Common/Title.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import styled from "styled-components";
import BackButton from "./BackButton";
import SettingsButton from "./SettingsButton";
import ExitButton from "./ExitButton";
import MinimizeButton from "./MinimizeButton";

// Styles
const StyledTitle = styled.div`
Expand Down Expand Up @@ -38,7 +39,9 @@ const Title = ({
showBack,
showSettings,
showExit,
onCloseApp
onCloseApp,
onMinimizeApp,
showMinimize
}) => {
return (
<StyledTitle>
Expand All @@ -49,6 +52,7 @@ const Title = ({
<NavButtons>
{showBack && <BackButton />}
{showSettings && <SettingsButton />}
{showMinimize && <MinimizeButton onMinimize={onMinimizeApp} />}
{showExit && <ExitButton onCloseApp={onCloseApp} />}
</NavButtons>
</StyledTitle>
Expand Down
3 changes: 3 additions & 0 deletions src/components/ContentHome/ContentHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { SubTitle } from "../Common/SubTitle";

const ContentHome = ({
onCloseApp,
onMinimizeApp,
exchangeRates,
selectedFiatCurrency,
selectedLocale,
Expand All @@ -26,7 +27,9 @@ const ContentHome = ({
text="CryptoCap"
showSettings={true}
showExit={true}
showMinimize={true}
onCloseApp={onCloseApp}
onMinimizeApp={onMinimizeApp}
/>
<GridTwoColContainer>
{mySavedCryptos && mySavedCryptos.length > 0 ? (
Expand Down

0 comments on commit 5fefcdc

Please sign in to comment.