Skip to content

Commit

Permalink
refactor: avoid duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Aug 29, 2024
1 parent c01e79e commit 6e928da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/site/src/components/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { THEME_LOCALSTORAGE_KEY } from '../hooks/theme.js';
const PREFERS_LIGHT_MQ = '(prefers-color-scheme: light)';
import { THEME_LOCALSTORAGE_KEY, PREFERS_LIGHT_MQ } from '../hooks/theme.js';

/**
* A blocking element that runs on the client before hydration to update the <html> preferred class
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/hooks/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect, useRef } from 'react';
import { Theme } from '@myst-theme/common';
import { isTheme } from '@myst-theme/providers';
const PREFERS_LIGHT_MQ = '(prefers-color-scheme: light)';
import { postThemeToAPI } from '../actions/theme.js';

export const PREFERS_LIGHT_MQ = '(prefers-color-scheme: light)';
export const THEME_LOCALSTORAGE_KEY = 'myst:theme';

export function getPreferredTheme() {
Expand Down

0 comments on commit 6e928da

Please sign in to comment.