Skip to content

Commit

Permalink
chore(dashboard): add responsive heading text
Browse files Browse the repository at this point in the history
Signed-off-by: amitamrutiya2210 <[email protected]>
  • Loading branch information
amitamrutiya committed May 5, 2024
1 parent edb88a9 commit c4ead7d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/dashboard/components/heading.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"use client"
import React from "react"
import { Box, Typography } from "@mui/joy"

import { Box } from "@mui/joy"
import { Typography, useMediaQuery, useTheme } from "@mui/material"

import { usePathname } from "next/navigation"

import { URLS } from "@/app/url"
Expand All @@ -21,6 +24,8 @@ export function getTitle(path: string): {
const Heading = () => {
const pathName = usePathname()
const pageInfo = getTitle(pathName)
const theme = useTheme()
const isMobileDevice = useMediaQuery(theme.breakpoints.down("sm"))

return (
<Box
Expand All @@ -33,14 +38,14 @@ const Heading = () => {
justifyContent: "space-between",
}}
>
<Typography level="h2">{pageInfo.title}</Typography>
<Typography variant={isMobileDevice ? "h3" : "h2"}>{pageInfo.title}</Typography>
<Typography
sx={{
color: "grey",
fontSize: "1em",
marginTop: "0.8em",
}}
level="h4"
variant="h4"
>
{pageInfo.badge}
</Typography>
Expand Down

0 comments on commit c4ead7d

Please sign in to comment.