-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): initial pass at making lists mobile optimized
- Loading branch information
Showing
11 changed files
with
286 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./useFormatCurrency"; | ||
export * from "./useIsSmallScreen"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import * as React from "react"; | ||
|
||
const formatDef = new Intl.NumberFormat("de", { | ||
currency: "EUR", | ||
style: "currency", | ||
minimumFractionDigits: 2, | ||
maximumFractionDigits: 2, | ||
}); | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export const useFormatCurrency = () => { | ||
return React.useCallback((value: number, currencySymbol: string) => { | ||
return formatDef.format(value).replace("€", currencySymbol); | ||
}, []); | ||
const { i18n } = useTranslation(); | ||
|
||
return React.useCallback( | ||
(value: number, currencySymbol: string) => { | ||
const formatDef = new Intl.NumberFormat(i18n.language, { | ||
currency: "EUR", | ||
style: "currency", | ||
minimumFractionDigits: 2, | ||
maximumFractionDigits: 2, | ||
}); | ||
|
||
return formatDef.format(value).replace("€", currencySymbol); | ||
}, | ||
[i18n] | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { useMediaQuery, useTheme } from "@mui/material"; | ||
|
||
export const useIsSmallScreen = () => { | ||
const theme = useTheme(); | ||
return useMediaQuery(theme.breakpoints.down("md")); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.