Skip to content

Commit

Permalink
fix: linting and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hinakhadim committed Oct 8, 2024
1 parent 800cee4 commit 3225663
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/ThemeToggleButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import Cookies from 'universal-cookie';
import { Icon } from '@openedx/paragon';
import { WbSunny, Nightlight } from '@openedx/paragon/icons';


let themeCookie = 'indigo-toggle-dark';
let themeCookieExpiry = 90; // days
const themeCookie = 'indigo-toggle-dark';
const themeCookieExpiry = 90; // days

const ThemeToggleButton = () => {
const cookies = new Cookies();
Expand All @@ -17,9 +16,7 @@ const ThemeToggleButton = () => {
return new Date(today.getFullYear(), today.getMonth(), today.getDate() + themeCookieExpiry);
};

const getCookieOptions = (serverURL) => {
return { domain: serverURL.hostname, path: '/', expires: getCookieExpiry() };
};
const getCookieOptions = (serverURL) => ({ domain: serverURL.hostname, path: '/', expires: getCookieExpiry() });

const onToggleTheme = () => {
const serverURL = new URL(getConfig().LMS_BASE_URL);
Expand Down

0 comments on commit 3225663

Please sign in to comment.