Skip to content

Commit

Permalink
Use (th) instead of (t) for Theme lambda function
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Oct 7, 2024
1 parent 0d4a413 commit 94326c9
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/components/AppBar/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { themeColors } from "types/theme";

/** A button that redirects to the home page */
export default function Logo(): ReactElement {
const isSmDown = useMediaQuery<Theme>((t) => t.breakpoints.down("sm"));
const isMdDown = useMediaQuery<Theme>((t) => t.breakpoints.down("md"));
const isSmDown = useMediaQuery<Theme>((th) => th.breakpoints.down("sm"));
const isMdDown = useMediaQuery<Theme>((th) => th.breakpoints.down("md"));
const navigate = useNavigate();
return (
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppBar/NavigationButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function NavButton(props: NavButtonProps): ReactElement {
const { t } = useTranslation();
const navigate = useNavigate();
const { windowWidth } = useWindowSize();
const showText = useMediaQuery<Theme>((t) => t.breakpoints.up("sm"));
const showText = useMediaQuery<Theme>((th) => th.breakpoints.up("sm"));

return (
<Button
Expand Down
6 changes: 3 additions & 3 deletions src/components/AppBar/ProjectButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export default function ProjectButtons(props: TabProps): ReactElement {
const { t } = useTranslation();
const navigate = useNavigate();

const isMdUp = useMediaQuery<Theme>((t) => t.breakpoints.up("md"));
const isLg = useMediaQuery<Theme>((t) => t.breakpoints.only("lg"));
const isXl = useMediaQuery<Theme>((t) => t.breakpoints.only("xl"));
const isMdUp = useMediaQuery<Theme>((th) => th.breakpoints.up("md"));
const isLg = useMediaQuery<Theme>((th) => th.breakpoints.only("lg"));
const isXl = useMediaQuery<Theme>((th) => th.breakpoints.only("xl"));
const nameLength = isXl
? projNameLength.xl
: isLg
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppBar/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default function UserMenu(props: TabProps): ReactElement {
const [isAdmin, setIsAdmin] = useState(false);
const username = LocalStorage.getCurrentUser()?.username;

const isLgUp = useMediaQuery<Theme>((t) => t.breakpoints.up("lg"));
const isXl = useMediaQuery<Theme>((t) => t.breakpoints.only("xl"));
const isLgUp = useMediaQuery<Theme>((th) => th.breakpoints.up("lg"));
const isXl = useMediaQuery<Theme>((th) => th.breakpoints.only("xl"));
const nameLength = isXl ? usernameLength.xl : usernameLength.lg;

function handleClick(event: MouseEvent<HTMLButtonElement>): void {
Expand Down
4 changes: 2 additions & 2 deletions src/components/LandingPage/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const topBarHeight = 70;

/** A bar shown at the top of the landing page. */
export default function TopBar(): ReactElement {
const showSubtitle = useMediaQuery<Theme>((t) => t.breakpoints.up("sm"));
const isMdUp = useMediaQuery<Theme>((t) => t.breakpoints.up("md"));
const showSubtitle = useMediaQuery<Theme>((th) => th.breakpoints.up("sm"));
const isMdUp = useMediaQuery<Theme>((th) => th.breakpoints.up("md"));
const { t } = useTranslation();

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/LandingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const heightBetweenBars =
parseInt(theme.spacing(1));

export default function LandingPage(): ReactElement {
const isXs = useMediaQuery<Theme>((t) => t.breakpoints.only("xs"));
const isXs = useMediaQuery<Theme>((th) => th.breakpoints.only("xs"));
const navigate = useNavigate();

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useAppDispatch } from "rootRedux/hooks";
/** Where users create a project or choose an existing one */
export default function ProjectScreen(): ReactElement {
const dispatch = useAppDispatch();
const isXs = useMediaQuery<Theme>((t) => t.breakpoints.only("xs"));
const isXs = useMediaQuery<Theme>((th) => th.breakpoints.only("xs"));

/* Disable Data Entry, Data Cleanup, Project Settings until a project is selected or created. */
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function ProjectSettingsComponent(): ReactElement {
const project = useAppSelector(
(state: StoreState) => state.currentProjectState.project
);
const hideLabels = useMediaQuery<Theme>((t) => t.breakpoints.down("md"));
const hideLabels = useMediaQuery<Theme>((th) => th.breakpoints.down("md"));
const navigate = useNavigate();
const { t } = useTranslation();

Expand Down
2 changes: 1 addition & 1 deletion src/components/TreeView/TreeDepiction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { parent } from "resources/tree";
import { useWindowSize } from "utilities/useWindowSize";

export default function TreeDepiction(props: TreeDepictionProps): ReactElement {
const showTree = useMediaQuery<Theme>((t) => t.breakpoints.up("sm"));
const showTree = useMediaQuery<Theme>((th) => th.breakpoints.up("sm"));

const [colWidth, setColWidth] = useState(0);

Expand Down
2 changes: 1 addition & 1 deletion src/components/TreeView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function TreeView(props: TreeViewProps): ReactElement {
);
const [visible, setVisible] = useState(true);
const dispatch = useAppDispatch();
const showButtonToTop = useMediaQuery<Theme>((t) => t.breakpoints.up("sm"));
const showButtonToTop = useMediaQuery<Theme>((th) => th.breakpoints.up("sm"));
const { resolvedLanguage } = useTranslation().i18n;

useEffect(() => {
Expand Down

0 comments on commit 94326c9

Please sign in to comment.