Skip to content

Commit

Permalink
Merge pull request #130 from negarn/dev
Browse files Browse the repository at this point in the history
send theme on change
  • Loading branch information
ashkanx committed May 31, 2019
2 parents a7d7d28 + 4e863e7 commit e7cbc32
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import Localize from 'App/Components/Elements/localize.jsx';
import DarkModeIcon from 'Images/app/settings/img-theme-dark.svg';
import LightModeIcon from 'Images/app/settings/img-theme-light.svg';
import { connect } from 'Stores/connect';
import GTM from 'Utils/gtm';

const ThemeSelectSettings = ({ is_dark_mode, toggleDarkMode, updateBarrierColor }) => {
const darkOnClick = () => {
if (!is_dark_mode) {
const new_dark_mode = toggleDarkMode();
updateBarrierColor(new_dark_mode);
GTM.pushDataLayer({ event: 'switch theme' });
}
};

const lightOnClick = () => {
if (is_dark_mode) {
const new_dark_mode = toggleDarkMode();
updateBarrierColor(new_dark_mode);
GTM.pushDataLayer({ event: 'switch theme' });
}
};
return (
Expand Down

0 comments on commit e7cbc32

Please sign in to comment.