Skip to content

Commit

Permalink
Use API client in index
Browse files Browse the repository at this point in the history
  • Loading branch information
LoLei committed Mar 18, 2022
1 parent dd536a1 commit 4cbd76b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hooks/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const useApi = () => {
return volDecRequestResult;
};

return { play, pause, volInc, volDec };
return { play, pause, volInc, volDec } as const;
};

export default useApi;
4 changes: 3 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import Head from 'next/head';
import Image from 'next/image';
import { BiMinus, BiPause, BiPlay, BiPlus } from 'react-icons/bi';
import ThemeSwitcher from '../components/ThemeSwitcher';
import useApi from '../hooks/useApi';
import styles from '../styles/Home.module.scss';

export default function Home() {
const { isDark } = useTheme();
const { play, pause, volInc, volDec } = useApi();

return (
<div className={styles.container}>
<div>
<Head>
<title>Home Remote</title>
<meta name="description" content="Home Remote - Control your devices" />
Expand Down

0 comments on commit 4cbd76b

Please sign in to comment.