Skip to content

Commit

Permalink
Update stylesheets and added darkMode variable and toggle.
Browse files Browse the repository at this point in the history
  • Loading branch information
cura-is committed Jul 5, 2018
1 parent 1790b79 commit 25c6cbd
Show file tree
Hide file tree
Showing 39 changed files with 1,013 additions and 996 deletions.
4 changes: 3 additions & 1 deletion src/components/auth/AuthLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class AuthLayout extends Component {
isAPIHealthy: PropTypes.bool.isRequired,
retryHealthCheck: PropTypes.func.isRequired,
isHealthCheckLoading: PropTypes.bool.isRequired,
darkMode: PropTypes.bool.isRequired
};

static contextTypes = {
Expand All @@ -35,11 +36,12 @@ export default class AuthLayout extends Component {
isAPIHealthy,
retryHealthCheck,
isHealthCheckLoading,
darkMode
} = this.props;
const { intl } = this.context;

return (
<div className="auth">
<div className={"auth" + (darkMode ? 'theme__dark' : '')}>
{!isOnline && (
<InfoBar
type="warning"
Expand Down
4 changes: 3 additions & 1 deletion src/components/layout/AppLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default class AppLayout extends Component {
areRequiredRequestsSuccessful: PropTypes.bool.isRequired,
retryRequiredRequests: PropTypes.func.isRequired,
areRequiredRequestsLoading: PropTypes.bool.isRequired,
darkMode: PropTypes.bool.isRequired
};

static defaultProps = {
Expand Down Expand Up @@ -85,12 +86,13 @@ export default class AppLayout extends Component {
areRequiredRequestsSuccessful,
retryRequiredRequests,
areRequiredRequestsLoading,
darkMode
} = this.props;

const { intl } = this.context;

return (
<div>
<div className={(darkMode ? 'theme__dark' : '')}>
<div className="app">
{isWindows && !isFullScreen && <TitleBar menu={window.franz.menu.template} icon={'assets/images/logo.svg'} />}
<div className="app__content">
Expand Down
1 change: 1 addition & 0 deletions src/components/settings/settings/EditSettingsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export default class EditSettingsForm extends Component {
<h2 id="apperance">{intl.formatMessage(messages.headlineAppearance)}</h2>
<Toggle field={form.$('showDisabledServices')} />
<Toggle field={form.$('showMessageBadgeWhenMuted')} />
<Toggle field={form.$('darkMode')} />

{/* Language */}
<h2 id="language">{intl.formatMessage(messages.headlineLanguage)}</h2>
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const DEFAULT_APP_SETTINGS = {
showDisabledServices: true,
showMessageBadgeWhenMuted: true,
enableSpellchecking: true,
darkMode: false,
locale: '',
fallbackLocale: 'en-US',
beta: false,
Expand Down
2 changes: 2 additions & 0 deletions src/containers/layout/AppLayoutContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default class AppLayoutContainer extends Component {
settings,
globalError,
requests,
darkMode,
} = this.props.stores;

const {
Expand Down Expand Up @@ -121,6 +122,7 @@ export default class AppLayoutContainer extends Component {
areRequiredRequestsSuccessful={requests.areRequiredRequestsSuccessful}
retryRequiredRequests={retryRequiredRequests}
areRequiredRequestsLoading={requests.areRequiredRequestsLoading}
darkMode={settings.all.app.darkMode}
>
{React.Children.count(children) > 0 ? children : null}
</AppLayout>
Expand Down
14 changes: 12 additions & 2 deletions src/containers/settings/EditSettingsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const messages = defineMessages({
id: 'settings.app.form.language',
defaultMessage: '!!!Language',
},
darkMode: {
id: 'settings.app.form.darkMode',
defaultMessage: '!!!Dark Mode',
},
showDisabledServices: {
id: 'settings.app.form.showDisabledServices',
defaultMessage: '!!!Display disabled services tabs',
Expand Down Expand Up @@ -84,17 +88,18 @@ export default class EditSettingsScreen extends Component {
});

settings.update({
type: 'app',
type: "app",
data: {
runInBackground: settingsData.runInBackground,
enableSystemTray: settingsData.enableSystemTray,
minimizeToSystemTray: settingsData.minimizeToSystemTray,
enableGPUAcceleration: settingsData.enableGPUAcceleration,
showDisabledServices: settingsData.showDisabledServices,
darkMode: settingsData.darkMode,
showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted,
enableSpellchecking: settingsData.enableSpellchecking,
beta: settingsData.beta, // we need this info in the main process as well
locale: settingsData.locale, // we need this info in the main process as well
locale: settingsData.locale // we need this info in the main process as well
},
});

Expand Down Expand Up @@ -160,6 +165,11 @@ export default class EditSettingsScreen extends Component {
value: settings.all.app.enableSpellchecking,
default: DEFAULT_APP_SETTINGS.enableSpellchecking,
},
darkMode: {
label: intl.formatMessage(messages.darkMode),
value: settings.all.app.darkMode,
default: DEFAULT_APP_SETTINGS.darkMode,
},
enableGPUAcceleration: {
label: intl.formatMessage(messages.enableGPUAcceleration),
value: settings.all.app.enableGPUAcceleration,
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
"settings.app.form.autoLaunchOnStart": "Launch Franz on start",
"settings.app.form.autoLaunchInBackground": "Open in background",
"settings.app.form.enableSystemTray": "Show Franz in system tray",
"settings.app.form.darkMode": "Join the Dark Side",
"settings.app.form.minimizeToSystemTray": "Minimize Franz to system tray",
"settings.app.form.enableMenuBar": "Show Franz in Menu Bar",
"settings.app.form.hideDockIcon": "Hide Franz icon in Dock",
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ const createWindow = () => {
minHeight: 500,
titleBarStyle: isMac ? 'hidden' : '',
frame: isLinux,
backgroundColor: '#3498db',
// backgroundColor: '#3498db',
backgroundColor: '#1E1E1E',
});

// Initialize System Tray
Expand Down
54 changes: 22 additions & 32 deletions src/styles/animations.scss
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
// FadeIn
.fadeIn-appear {
opacity: 0.01;
}
.fadeIn-appear { opacity: .01; }

.fadeIn-appear.fadeIn-appear-active {
opacity: 1;
transition: opacity 0.5s ease-out;
transition: opacity .5s ease-out;
}

.fadeIn-enter {
opacity: 0.01;
transition: opacity 0.5s ease-out;
opacity: .01;
transition: opacity .5s ease-out;
}

.fadeIn-leave {
opacity: 1;
}
.fadeIn-leave { opacity: 1; }

.fadeIn-leave.fadeIn-leave-active {
opacity: 0.01;
opacity: .01;
transition: opacity 300ms ease-in;
}

// FadeIn Fast
.fadeIn-fast-appear {
opacity: 0.01;
}
.fadeIn-fast-appear { opacity: .01; }

.fadeIn-fast-appear.fadeIn-fast-appear-active {
opacity: 1;
transition: opacity 0.25s ease-out;
transition: opacity .25s ease-out;
}

.fadeIn-fast-enter {
opacity: 0.01;
transition: opacity 0.25s ease-out;
opacity: .01;
transition: opacity .25s ease-out;
}

.fadeIn-fast-leave {
opacity: 1;
}
.fadeIn-fast-leave { opacity: 1; }

.fadeIn-fast-leave.fadeIn-fast-leave-active {
opacity: 0.01;
transition: opacity 0.25s ease-in;
opacity: .01;
transition: opacity .25s ease-in;
}

// Slide down
Expand All @@ -54,37 +46,35 @@

.slideDown-appear.slideDown-appear-active {
max-height: 500px;
transition: max-height 0.5s ease-out;
transition: max-height .5s ease-out;
}

.slideDown-enter {
max-height: 0;
transition: max-height 0.5s ease-out;
transition: max-height .5s ease-out;
}

// Slide up
.slideUp-appear {
transform: translateY(20px);
opacity: 0;
transform: translateY(20px);
}

.slideUp-appear.slideUp-appear-active {
transform: translateY(0px);
opacity: 1;
transition: all 0.3s ease-out;
transform: translateY(0px);
transition: all .3s ease-out;
}

.slideUp-enter {
transform: translateY(20px);
opacity: 0;
transition: all 0.3s ease-out;
transform: translateY(20px);
transition: all .3s ease-out;
}

.slideUp-leave {
opacity: 1;
}
.slideUp-leave { opacity: 1; }

.slideUp-leave.slideUp-leave-active {
opacity: 0.01;
opacity: .01;
transition: opacity 300ms ease-in;
}
Loading

0 comments on commit 25c6cbd

Please sign in to comment.