mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
update geopoint styles
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import { ISideDrawerFieldProps } from "@src/components/fields/types";
|
||||
|
||||
import { Box, Stack, TextField } from "@mui/material";
|
||||
import DatePicker from "@mui/lab/DatePicker";
|
||||
import DateTimeIcon from "@mui/icons-material/AccessTime";
|
||||
import { fieldSx, getFieldId } from "@src/components/SideDrawer/utils";
|
||||
import { Stack, TextField } from "@mui/material";
|
||||
import { getFieldId } from "@src/components/SideDrawer/utils";
|
||||
import { GeoPoint } from "firebase/firestore";
|
||||
|
||||
export default function GeoPointField({
|
||||
@@ -34,11 +32,13 @@ export default function GeoPointField({
|
||||
label="Latitude"
|
||||
type="number"
|
||||
value={latitude}
|
||||
inputProps={{ min: -90, max: 90 }}
|
||||
inputProps={{ min: -90.0, max: 90.0 }}
|
||||
onChange={handleChange("latitude")}
|
||||
disabled={disabled}
|
||||
onBlur={onSubmit}
|
||||
fullWidth
|
||||
InputProps={{ style: { fontVariantNumeric: "tabular-nums" } }}
|
||||
id={getFieldId(column.key)}
|
||||
/>
|
||||
<TextField
|
||||
label="Longitude"
|
||||
@@ -49,6 +49,8 @@ export default function GeoPointField({
|
||||
disabled={disabled}
|
||||
onBlur={onSubmit}
|
||||
fullWidth
|
||||
InputProps={{ style: { fontVariantNumeric: "tabular-nums" } }}
|
||||
id={getFieldId(column.key + "-long")}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { IBasicCellProps } from "@src/components/fields/types";
|
||||
import { Typography } from "@mui/material";
|
||||
|
||||
export default function Duration({ value }: IBasicCellProps) {
|
||||
export default function GeoPoint({ value }: IBasicCellProps) {
|
||||
if (value === undefined) return null;
|
||||
const { latitude, longitude } = value;
|
||||
|
||||
@@ -24,9 +25,13 @@ export default function Duration({ value }: IBasicCellProps) {
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{latDegrees}°{latMinutes}'{latSeconds.toFixed(2)}"{latDirection},
|
||||
{longDegrees}°{longMinutes}'{longSeconds.toFixed(2)}"{longDirection}
|
||||
</>
|
||||
<Typography variant="inherit" component="span" sx={{ fontFamily: "mono" }}>
|
||||
{latDegrees.toString().padStart(2, "0")}°
|
||||
{latMinutes.toString().padStart(2, "0")}′
|
||||
{latSeconds.toFixed(1).toString().padStart(3, "0")}″{latDirection}{" "}
|
||||
{longDegrees.toString().padStart(2, "0")}°
|
||||
{longMinutes.toString().padStart(2, "0")}′
|
||||
{longSeconds.toFixed(1).toString().padStart(3, "0")}″{longDirection}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user