From 46a9097491921400ca31e4de4d974c6194314d4b Mon Sep 17 00:00:00 2001 From: Donkie Date: Sun, 24 Nov 2024 15:04:20 +0100 Subject: [PATCH] Final locations updates --- client/public/locales/en/common.json | 7 ++++- .../pages/locations/components/location.tsx | 10 +++++- .../components/locationContainer.tsx | 31 +++++++++++-------- client/src/pages/locations/index.tsx | 12 ++++--- 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/client/public/locales/en/common.json b/client/public/locales/en/common.json index c1459e9..4b6b4e6 100644 --- a/client/public/locales/en/common.json +++ b/client/public/locales/en/common.json @@ -359,6 +359,9 @@ "help": { "list": "Help | Spoolman" }, + "locations": { + "list": "Locations | Spoolman" + }, "filament": { "list": "Filaments | Spoolman", "show": "#{{id}} Show Filament | Spoolman", @@ -382,7 +385,9 @@ } }, "locations": { + "locations": "Locations", "new_location": "New Location", - "no_location": "No Location" + "no_location": "No Location", + "no_locations_help": "This page lets you organize your spools in locations, add some spools to get started!" } } diff --git a/client/src/pages/locations/components/location.tsx b/client/src/pages/locations/components/location.tsx index 2a56996..a8b04ba 100644 --- a/client/src/pages/locations/components/location.tsx +++ b/client/src/pages/locations/components/location.tsx @@ -1,4 +1,4 @@ -import { Button, Input } from "antd"; +import { Button, Input, theme } from "antd"; import type { Identifier, XYCoord } from "dnd-core"; import { useRef, useState } from "react"; import { useDrag, useDrop } from "react-dnd"; @@ -10,6 +10,8 @@ import { DragItem, ItemTypes, SpoolDragItem } from "../dnd"; import { EMPTYLOC } from "../functions"; import { SpoolList } from "./spoolList"; +const { useToken } = theme; + export function Location({ index, title, @@ -31,6 +33,7 @@ export function Location({ locationSpoolOrder: number[]; setLocationSpoolOrder: (spoolOrder: number[]) => void; }) { + const { token } = useToken(); const t = useTranslate(); const [editTitle, setEditTitle] = useState(false); const [newTitle, setNewTitle] = useState(title); @@ -133,6 +136,10 @@ export function Location({ const canEditTitle = title != EMPTYLOC; + const titleStyle = { + color: canEditTitle ? undefined : token.colorTextTertiary, + }; + return (
{displayTitle} diff --git a/client/src/pages/locations/components/locationContainer.tsx b/client/src/pages/locations/components/locationContainer.tsx index 20d8cfe..deba611 100644 --- a/client/src/pages/locations/components/locationContainer.tsx +++ b/client/src/pages/locations/components/locationContainer.tsx @@ -176,19 +176,24 @@ export function LocationContainer() { }; return ( -
- {containers} -
-
); diff --git a/client/src/pages/locations/index.tsx b/client/src/pages/locations/index.tsx index f9f127e..4c40d52 100644 --- a/client/src/pages/locations/index.tsx +++ b/client/src/pages/locations/index.tsx @@ -1,4 +1,4 @@ -import { IResourceComponentsProps } from "@refinedev/core"; +import { IResourceComponentsProps, useTranslate } from "@refinedev/core"; import dayjs from "dayjs"; import utc from "dayjs/plugin/utc"; import React from "react"; @@ -11,10 +11,14 @@ import "./locations.css"; dayjs.extend(utc); export const Locations: React.FC = () => { + const t = useTranslate(); return ( - - - +
+

{t("locations.locations")}

+ + + +
); };