From 77b583d42341d00fc1fd458f552afa2cd847d955 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Fri, 3 Jul 2020 23:45:39 +0300
Subject: feat: display notifications on top if mobile

---
 src/pages/Page.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/pages/Page.tsx')

diff --git a/src/pages/Page.tsx b/src/pages/Page.tsx
index c0ba3d2..56d7372 100644
--- a/src/pages/Page.tsx
+++ b/src/pages/Page.tsx
@@ -1,5 +1,6 @@
 import React from 'react';
-import { makeStyles } from '@material-ui/core/styles';
+import { makeStyles, useTheme } from '@material-ui/core/styles';
+import { useMediaQuery } from '@material-ui/core';
 import { SnackbarProvider } from 'notistack';
 
 import ProfilePage from './ProfilePage/ProfilePage';
@@ -24,12 +25,14 @@ const useStyles = makeStyles(theme => ({
 const Page: React.FC = () => {
   const { page } = useNavigate();
   const classes = useStyles();
+  const theme = useTheme();
+  const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
 
   return (
     <SnackbarProvider
       maxSnack={3}
       anchorOrigin={{
-        vertical: 'bottom',
+        vertical: isMobile ? 'top' : 'bottom',
         horizontal: 'right'
       }}
     >
-- 
cgit v1.2.3

