Skip to content

Commit

Permalink
indicator focus screen flexbox solved, click sounds improved
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgaerdonmez committed Jul 20, 2020
1 parent 2456d86 commit 9fac639
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 14 deletions.
19 changes: 19 additions & 0 deletions app/appstoreshowcase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# App Store Showcase Screenshots Lines

## The simplest and powerfull metronome to power your music, practice, studio records

## A simple user interface for you to easily jump in

## Adjustable BPM

## Change the beats

## Select your preferred sound preset

## Tap your beat and have it converted to bpm for you

## Use keyboard shortcuts to easily control

## Access to focus mode to have the minimal user interface for practising

## Want more features, contact us or you can send a pull request yourself, it's OPEN SOURCE
21 changes: 15 additions & 6 deletions electron/windows/MainWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,17 @@ class MainWindow extends BrowserWindow {
},
];

if (process.platform === "darwin") {
mainMenuTemplate.unshift({
label: app.name,
});
}
const appNamedMenu = {
label: app.name,
submenu: [
{
label: "Reset App",
click: () => {
this.webContents.send("app:reset");
},
},
],
};

if (isDev) {
mainMenuTemplate.push({
Expand All @@ -113,7 +119,10 @@ class MainWindow extends BrowserWindow {
});
}

const mainMenu = Menu.buildFromTemplate(mainMenuTemplate);
const mainMenu = Menu.buildFromTemplate([
appNamedMenu,
...mainMenuTemplate,
]);
Menu.setApplicationMenu(mainMenu);
};

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"react-scripts": "3.4.1",
"react-transition-group": "^4.4.1",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"typescript": "~3.7.2"
},
Expand All @@ -33,6 +34,7 @@
"@types/react-dom": "^16.9.0",
"@types/react-redux": "^7.1.9",
"@types/react-transition-group": "^4.4.0",
"@types/redux-persist": "^4.3.1",
"asar": "^3.0.3",
"concurrently": "^5.2.0",
"electron": "^8.2.5",
Expand Down
Binary file modified public/sounds/preset10/main.wav
Binary file not shown.
Binary file modified public/sounds/preset10/second.wav
Binary file not shown.
Binary file added public/sounds/preset11/main.wav
Binary file not shown.
Binary file added public/sounds/preset11/second.wav
Binary file not shown.
Binary file modified public/sounds/preset2/main.wav
Binary file not shown.
Binary file modified public/sounds/preset2/second.wav
Binary file not shown.
Binary file modified public/sounds/preset4/main.wav
Binary file not shown.
Binary file modified public/sounds/preset4/second.wav
Binary file not shown.
Binary file modified public/sounds/preset5/main.wav
Binary file not shown.
Binary file modified public/sounds/preset5/second.wav
Binary file not shown.
Binary file modified public/sounds/preset7/main.wav
Binary file not shown.
Binary file modified public/sounds/preset7/second.wav
Binary file not shown.
12 changes: 11 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import React from "react";
import React, { useEffect } from "react";
import { useDispatch } from "react-redux";
import Metronome from "./components/Metronome";
import "./sass/App.scss";

function App() {
const dispatch = useDispatch();

useEffect(() => {
const resetHandler = () => dispatch({ type: "RESET", payload: undefined });
window.ipcRenderer.on("app:reset", resetHandler);
return () => {
window.ipcRenderer.removeListener("app:reset", resetHandler);
};
}, [dispatch]);
return <Metronome />;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Metronome/Indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Indicator(): ReactElement {
}`;

return (
<TransitionGroup>
<TransitionGroup style={{ width: "100%" }}>
<ul
className={`indicator-container metronome-child-container ${
focusMode ? "indicator-container-focused" : ""
Expand Down
2 changes: 1 addition & 1 deletion src/components/Metronome/TapBpmScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactElement, useEffect } from "react";
import React, { ReactElement } from "react";
import "../../sass/Metronome/TabBpmScreen.scss";

import { useDispatch, useSelector } from "react-redux";
Expand Down
7 changes: 5 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import ReactDOM from "react-dom";
import App from "./App";

import { Provider } from "react-redux";
import store from "./store/store";
import { PersistGate } from "redux-persist/integration/react";
import { store, persistor } from "./store/store";

if (!window.ipcRenderer) {
window.ipcRenderer = {
Expand All @@ -17,7 +18,9 @@ if (!window.ipcRenderer) {
ReactDOM.render(
<React.StrictMode>
<Provider store={store}>
<App />
<PersistGate persistor={persistor}>
<App />
</PersistGate>
</Provider>
</React.StrictMode>,
document.getElementById("root")
Expand Down
1 change: 1 addition & 0 deletions src/sass/Metronome/Indicator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
}

.indicator-container-focused {
width: 100%;
background-color: transparent;
&:hover {
background-color: $light-gray;
Expand Down
2 changes: 1 addition & 1 deletion src/store/actions/metronome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const clearBeatTimeout = () => ({
export let beats = beatLoader(1);

export const setPreset = (preset: number) => {
const limit = 10;
const limit = 11;
const _preset = preset > limit ? 1 : preset < 1 ? 1 : preset;
beats = beatLoader(_preset);
return {
Expand Down
2 changes: 2 additions & 0 deletions src/store/reducers/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default (
switch (type) {
case ACTION.TOGGLE_FOCUS_MODE:
return { ...state, focusMode: !state.focusMode };
case "RESET":
return initialState;
default:
return state;
}
Expand Down
2 changes: 2 additions & 0 deletions src/store/reducers/metronome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export default (
...state,
tapBpm: { ...state.tapBpm, ...payload },
};
case "RESET":
return initialState;
default:
return state;
}
Expand Down
15 changes: 13 additions & 2 deletions src/store/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createStore, combineReducers, applyMiddleware, compose } from "redux";
import thunk from "redux-thunk";
import { persistStore, persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage";
import MetronomeReducer from "./reducers/metronome";
import AppReducer from "./reducers/app";
import { ReduxState } from "../types/redux";
Expand All @@ -9,13 +11,22 @@ const reducers = combineReducers<ReduxState>({
app: AppReducer,
});

const persistConfig = {
key: "root",
storage,
};

const persistedReducer = persistReducer(persistConfig, reducers);

const store = createStore(
reducers,
persistedReducer,
compose(
applyMiddleware(thunk)
// (window as any).__REDUX_DEVTOOLS_EXTENSION__ &&
// (window as any).__REDUX_DEVTOOLS_EXTENSION__()
)
);

export default store;
const persistor = persistStore(store);

export { store, persistor };

0 comments on commit 9fac639

Please sign in to comment.