-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving inboxsearchcomposerV2 #46
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React, { useEffect, useMemo } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import {InboxSearchComposer, Loader, Button ,AddFilled} from "@egovernments/digit-ui-components"; | ||
import {Loader, Button ,AddFilled} from "@egovernments/digit-ui-components"; | ||
import InboxSearchComposerV2 from "../../../../../../ui-components/src/hoc/InboxSearchComposerV2"; | ||
import { Header } from "@egovernments/digit-ui-react-components"; | ||
import { useHistory, useLocation } from "react-router-dom"; | ||
import searchConfigMUKTA from "../../../configs/searchConfigMUKTA"; | ||
|
@@ -68,7 +69,7 @@ const ProjectSearch = () => { | |
)} | ||
</div> | ||
<div className="inbox-search-wrapper"> | ||
<InboxSearchComposer configs={configs}></InboxSearchComposer> | ||
<InboxSearchComposerV2 configs={configs}></InboxSearchComposerV2> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Browsersession is required in v2 |
||
</div> | ||
</React.Fragment> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Header, Loader,InboxSearchComposer} from "@egovernments/digit-ui-components"; | ||
import { Header, Loader} from "@egovernments/digit-ui-components"; | ||
import InboxSearchComposerV2 from "../../../../../../ui-components/src/hoc/InboxSearchComposerV2"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Import here |
||
import inboxConfig from "../../../configs/InboxConfig"; | ||
|
||
const ProjectSearchAndInboxComponent = () => { | ||
|
@@ -25,7 +26,7 @@ const ProjectSearchAndInboxComponent = () => { | |
<React.Fragment> | ||
<Header styles={{ fontSize: "32px" }}>{t(configs?.label)}</Header> | ||
<div className="inbox-search-wrapper"> | ||
<InboxSearchComposer configs={configs}></InboxSearchComposer> | ||
<InboxSearchComposerV2 configs={configs}></InboxSearchComposerV2> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Browser session? |
||
</div> | ||
</React.Fragment> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, {useState} from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import BreakLine from './BreakLine' | ||
const HorizontalNavV2 = ({ configNavItems, activeLink, setActiveLink, showNav = false, children, customStyle = {}, customClassName = "", inFormComposer = true, navClassName = "", navStyles = {},fromSearchComp=false,horizontalLine=false }) => { | ||
const { t } = useTranslation() | ||
const setActive = (item) => { | ||
setActiveLink(item) | ||
} | ||
|
||
const MenuItem = ({ item }) => { | ||
let itemComponent = item.code; | ||
|
||
const Item = () => ( | ||
<span className="menu-item"> | ||
<div className="menu-label">{t(itemComponent)}</div> | ||
</span> | ||
); | ||
|
||
return ( | ||
<Item /> | ||
); | ||
}; | ||
|
||
if(fromSearchComp) { | ||
return ( | ||
<div className={navClassName} style={fromSearchComp ?{width:"100%",...navStyles} :{...navStyles}}> | ||
{showNav && <div className={fromSearchComp?`horizontal-nav ${customClassName}`:`horizontal-nav ${customClassName}`} style={inFormComposer?{ marginLeft: "16px", marginRight: "16px", marginTop:"0px",...customStyle }:{...customStyle}} > | ||
{configNavItems?.map((item, index) => ( | ||
<div className={`sidebar-list-search-form ${activeLink?.name === item.name ? "active" : ""}`} key={index} onClick={() => setActive(item)}> | ||
<MenuItem item={item} /> | ||
</div> | ||
))} | ||
</div> | ||
} | ||
{/* Commenting out for now due to horizontal line coming in every inbox as well */} | ||
{horizontalLine && <BreakLine style={{margin:"0px 16px 0px 16px"}}/>} | ||
{children} | ||
</div> | ||
) | ||
} | ||
return ( | ||
<div className={navClassName} style={{...navStyles}}> | ||
{showNav && <div className={`horizontal-nav ${customClassName}`} style={inFormComposer?{ marginLeft: "16px", marginRight: "16px", ...customStyle }:{...customStyle}} > | ||
{configNavItems?.map((item, index) => ( | ||
<div className={`sidebar-list ${activeLink?.name === item.name ? "active" : ""}`} key={index} onClick={() => setActive(item)}> | ||
<MenuItem item={item} /> | ||
</div> | ||
))} | ||
</div> | ||
} | ||
{children} | ||
</div> | ||
) | ||
} | ||
|
||
export default HorizontalNavV2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check import