Skip to content

Commit ae4b322

Browse files
On Login/Signup, for mobile, only show language selector inside the drawer
1 parent dc67498 commit ae4b322

3 files changed

Lines changed: 14 additions & 31 deletions

File tree

app/web/components/Navigation/Navigation.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,14 @@ export default function Navigation() {
298298
};
299299

300300
const drawerItems = (
301-
<div>
301+
<Box
302+
sx={{
303+
display: "flex",
304+
flexDirection: "column",
305+
height: "100%",
306+
justifyContent: "space-between",
307+
}}
308+
>
302309
<List>
303310
{(isAuthenticated ? loggedInDrawerMenu : loggedOutDrawerMenu)(
304311
t,
@@ -329,7 +336,11 @@ export default function Navigation() {
329336
</ListItem>
330337
))}
331338
</List>
332-
</div>
339+
340+
<Box sx={{ marginX: "auto", marginBottom: theme.spacing(2) }}>
341+
<LanguagePickerSelect />
342+
</Box>
343+
</Box>
333344
);
334345

335346
const loggedInMenuItems = useMemo(

app/web/features/auth/login/Login.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { alpha, Box, styled, Typography, useMediaQuery } from "@mui/material";
1+
import { alpha, styled, Typography } from "@mui/material";
22
import Alert from "components/Alert";
33
import HtmlMeta from "components/HtmlMeta";
44
import StyledLink from "components/StyledLink";
55
import AntibotNote from "features/antibot/AntibotNote";
6-
import LanguagePickerSelect from "features/translate/LanguagePickerSelect";
76
import { Trans, useTranslation } from "i18n";
87
import { AUTH, GLOBAL, LANDING } from "i18n/namespaces";
98
import { useRouter } from "next/router";
109
import { useEffect } from "react";
1110
import CouchersTextLogo from "resources/CouchersTextLogo";
1211
import { dashboardRoute, signupRoute } from "routes";
13-
import { theme } from "theme";
1412
import stringOrFirstString from "utils/stringOrFirstString";
1513

1614
import { useAuthContext } from "../AuthProvider";
@@ -43,7 +41,6 @@ export default function Login() {
4341
const error = authState.error;
4442

4543
const router = useRouter();
46-
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
4744
const from = stringOrFirstString(router.query.from) ?? dashboardRoute;
4845
const redirectTo = from === "/" || from === "%2F" ? dashboardRoute : from;
4946

@@ -94,17 +91,6 @@ export default function Login() {
9491
<AntibotNote />
9592
</Typography>
9693
</StyledFormWrapper>
97-
{isMobile && (
98-
<Box
99-
sx={{
100-
display: "flex",
101-
justifyContent: "center",
102-
marginTop: theme.spacing(2),
103-
}}
104-
>
105-
<LanguagePickerSelect />
106-
</Box>
107-
)}
10894
</StyledContent>
10995
</>
11096
);

app/web/features/auth/signup/Signup.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
Skeleton,
66
styled,
77
Typography,
8-
useMediaQuery,
98
} from "@mui/material";
109
import { useQuery } from "@tanstack/react-query";
1110
import Alert from "components/Alert";
@@ -14,7 +13,6 @@ import CenteredSpinner from "components/CenteredSpinner/CenteredSpinner";
1413
import HtmlMeta from "components/HtmlMeta";
1514
import Redirect from "components/Redirect";
1615
import StyledLink from "components/StyledLink";
17-
import LanguagePickerSelect from "features/translate/LanguagePickerSelect";
1816
import { RpcError } from "grpc-web";
1917
import { Trans, useTranslation } from "i18n";
2018
import { AUTH, GLOBAL } from "i18n/namespaces";
@@ -45,7 +43,6 @@ const StyledFormWrapper = styled("div")(({ theme }) => ({
4543
export default function Signup() {
4644
const { t } = useTranslation([AUTH, GLOBAL]);
4745
const router = useRouter();
48-
const isMobile = useMediaQuery(theme.breakpoints.down("md"));
4946

5047
const { authState, authActions } = useAuthContext();
5148
const authenticated = authState.authenticated;
@@ -194,17 +191,6 @@ export default function Signup() {
194191
</Trans>
195192
</Typography>
196193
</StyledFormWrapper>
197-
{isMobile && (
198-
<Box
199-
sx={{
200-
display: "flex",
201-
justifyContent: "center",
202-
marginTop: theme.spacing(2),
203-
}}
204-
>
205-
<LanguagePickerSelect />
206-
</Box>
207-
)}
208194
</Container>
209195
</>
210196
);

0 commit comments

Comments
 (0)