Skip to content

Commit

Permalink
added tag component in mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
NabeelAyubee committed Jan 8, 2025
1 parent 5c6b7d6 commit 92810ab
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Card, CardHeader, Switch, Toast, ToggleSwitch } from "@egovernments/dig
import React, { createContext, Fragment, useContext, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import UploadDataMapping from "./UploadDataMapping";
import TagComponent from "./TagComponent";

const UploadDataMappingContext = createContext("UploadDataMappingContext");

Expand All @@ -11,18 +12,22 @@ export const useUploadDataMappingContext = () => {
function UploadDataMappingWrapper({ props: customProps, formData, currentCategories, onSelect }) {
const { t } = useTranslation();
const searchParams = new URLSearchParams(window.location.search);
const campaignName = customProps?.sessionData?.HCM_CAMPAIGN_NAME?.campaignName || searchParams.get("campaignName");
const tenantId = Digit.ULBService.getCurrentTenantId();
const [showToast, setShowToast] = useState(null);
const { id, draft, key, ...queryParams } = Digit.Hooks.useQueryParams();
return (
<Fragment>
<UploadDataMappingContext.Provider value={{ formData: customProps }}>
<Card className="dataMappingCard">
<CardHeader>{t(`UPLOAD_DATA_MAPPING`)}</CardHeader>
<div style={{ width: "100%" }}>
<UploadDataMapping formData={customProps} currentCategories={currentCategories} onSelect={onSelect} />
</div>
</Card>
<div className="card-container1">
<TagComponent campaignName={campaignName} />
<Card className="dataMappingCard">
<CardHeader>{t(`UPLOAD_DATA_MAPPING`)}</CardHeader>
<div style={{ width: "100%" }}>
<UploadDataMapping formData={customProps} currentCategories={currentCategories} onSelect={onSelect} />
</div>
</Card>
</div>
</UploadDataMappingContext.Provider>
{showToast && (
<Toast
Expand Down

0 comments on commit 92810ab

Please sign in to comment.