fix(auth): unify scheme creator display
This commit is contained in:
@@ -40,6 +40,7 @@ import Feature from "ol/Feature";
|
||||
import { bbox, featureCollection } from "@turf/turf";
|
||||
import Timeline from "@components/olmap/core/Controls/Timeline";
|
||||
import { ContaminantSchemaItem, ContaminantSchemeRecord } from "./types";
|
||||
import { useSchemeCreatorName } from "@components/olmap/core/useSchemeCreatorName";
|
||||
|
||||
interface SchemeQueryProps {
|
||||
schemes?: ContaminantSchemeRecord[];
|
||||
@@ -101,6 +102,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
>([]);
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [mapContainer, setMapContainer] = useState<HTMLElement | null>(null);
|
||||
const creatorName = useSchemeCreatorName();
|
||||
|
||||
const { open } = useNotification();
|
||||
const map = useMap();
|
||||
@@ -242,7 +244,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
id: item.scheme_id,
|
||||
schemeName: item.scheme_name,
|
||||
type: item.scheme_type,
|
||||
user: item.username,
|
||||
username: item.username,
|
||||
create_time: item.create_time,
|
||||
startTime: item.scheme_start_time,
|
||||
schemeDetail: item.scheme_detail,
|
||||
@@ -598,7 +600,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
variant="caption"
|
||||
className="font-medium text-gray-900"
|
||||
>
|
||||
{scheme.user}
|
||||
{creatorName(scheme.username)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box className="flex items-center gap-2">
|
||||
|
||||
@@ -9,7 +9,7 @@ export interface ContaminantSchemeRecord {
|
||||
id: number;
|
||||
schemeName: string;
|
||||
type: string;
|
||||
user: string;
|
||||
username: string;
|
||||
create_time: string;
|
||||
startTime: string;
|
||||
schemeDetail?: ContaminantSchemeDetail;
|
||||
|
||||
Reference in New Issue
Block a user