Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClientProvider, QueryClient } from 'react-query';
import { ReactQueryDevtools } from 'react-query/devtools';
import { Todos, Header, BottomNavigation } from './components';
import { Todos, Header, Footer } from './components';

const queryClient = new QueryClient();

Expand All @@ -13,7 +13,7 @@ const App = (): JSX.Element => {
<Todos />
<ReactQueryDevtools />
</QueryClientProvider>
<BottomNavigation />
<Footer />
</div>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/BottomNavigation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ClipboardListIcon, ChartSquareBarIcon, AdjustmentsIcon } from '@heroicons/react/outline';
import { AdjustmentsIcon, ChartSquareBarIcon, ClipboardListIcon } from '@heroicons/react/outline';

const BottomNavigation = (): JSX.Element => {
const BottomNavigation = ({ className }: { className?: string }): JSX.Element => {
return (
<nav className="fixed inset-x-0 bottom-0 flex justify-between text-xs text-blue-900 bg-blue-100 md:hidden">
<nav className={`flex justify-between text-xs text-blue-900 bg-blue-100 md:hidden ${className ?? ''}`}>
<button
type="button"
className="w-full p-3 text-center transition duration-300 hover:bg-blue-200 hover:text-blue-800"
Expand Down
16 changes: 16 additions & 0 deletions src/components/CtaButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { PlusIcon } from '@heroicons/react/outline';

const CtaButton = ({ className }: { className?: string }): JSX.Element => {
return (
<button
type="button"
className={`text-white transition duration-200 ease-in bg-blue-500 rounded-full shadow w-14 h-14 hover:bg-blue-700 active:shadow-lg focus:outline-none ${
className ?? ''
}`}
>
<PlusIcon />
</button>
);
};

export { CtaButton };
13 changes: 13 additions & 0 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { BottomNavigation } from '../BottomNavigation';
import { CtaButton } from '../CtaButton';

const Footer = (): JSX.Element => {
return (
<>
<CtaButton className="fixed z-10 md:bottom-8 bottom-24 right-6" />
<BottomNavigation className="fixed inset-x-0 bottom-0" />
</>
);
};

export { Footer };
3 changes: 1 addition & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { Todos } from './Todos';
export { Header } from './Header';
export { BottomNavigation } from './BottomNavigation';
export { SearchBox } from './SearchBox';
export { Footer } from './Footer';