-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Petals banner * Petals banner * fiw warning
- Loading branch information
1 parent
6bea21d
commit e00150f
Showing
9 changed files
with
112 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,63 @@ | ||
import hamburgerMenu from "assets/images/hamburger-menu.svg"; | ||
import setting from "assets/images/setting.svg"; | ||
import WarningModal from "modules/service/components/WarningModal"; | ||
import { useState } from "react"; | ||
import { type ForwardedRef, forwardRef, useState } from "react"; | ||
import WarningIcon from "shared/components/WarningIcon"; | ||
import type { HeaderProps } from "shared/types"; | ||
|
||
const Header = ({ setRightSidebar, hamburgerMenuOpen, setHamburgerMenu, title }: HeaderProps) => { | ||
const [open, setIsOpen] = useState(false); | ||
import PetalsBanner from "../../../shared/components/PetalsBanner"; | ||
|
||
const closeModal = () => { | ||
setIsOpen(false); | ||
}; | ||
const Header = forwardRef( | ||
( | ||
{ setRightSidebar, hamburgerMenuOpen, setHamburgerMenu, title, isPetals = false }: HeaderProps, | ||
ref: ForwardedRef<HTMLInputElement>, | ||
) => { | ||
const [open, setIsOpen] = useState(false); | ||
|
||
const openModal = () => { | ||
setIsOpen(true); | ||
}; | ||
const closeModal = () => { | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div className="md:border-b border-light w-full h-[77px] py-3 flex sticky bg-grey-900 z-[11] top-0"> | ||
<div className="max-md:w-full flex md:justify-center header__center max-md:items-center"> | ||
<button | ||
onClick={() => setHamburgerMenu(!hamburgerMenuOpen)} | ||
className="md:hidden ml-5 w-10 h-10" | ||
> | ||
<img src={hamburgerMenu} alt="msg" width={22} height={22} className="mx-auto" /> | ||
</button> | ||
<h1 className="flex items-center text-white md:text-xl text-md mx-[18px]">{title}</h1> | ||
</div> | ||
<div className="md:border-l border-light md:pl-6 flex items-center ml-auto max-w-max w-full md:absolute md:right-0"> | ||
<button type="button" onClick={openModal} className="share-chat__btn"> | ||
Share Chat | ||
</button> | ||
<button onClick={() => setRightSidebar(true)} className="setting__btn" type="button"> | ||
<img src={setting} alt="msg" width={22} height={22} /> | ||
</button> | ||
const openModal = () => { | ||
setIsOpen(true); | ||
}; | ||
|
||
return ( | ||
<> | ||
{isPetals ? <PetalsBanner /> : null} | ||
<div | ||
className="md:border-b border-light w-full h-[77px] py-3 flex sticky bg-grey-900 z-[11] top-0" | ||
ref={ref} | ||
> | ||
<div className="max-md:w-full flex md:justify-center header__center max-md:items-center"> | ||
<button | ||
onClick={() => setHamburgerMenu(!hamburgerMenuOpen)} | ||
className="md:hidden ml-5 w-10 h-10" | ||
> | ||
<img src={hamburgerMenu} alt="msg" width={22} height={22} className="mx-auto" /> | ||
</button> | ||
<h1 className="flex items-center text-white md:text-xl text-md mx-[18px]">{title}</h1> | ||
</div> | ||
<div className="md:border-l border-light md:pl-6 flex items-center ml-auto max-w-max w-full md:absolute md:right-0"> | ||
<button type="button" onClick={openModal} className="share-chat__btn"> | ||
Share Chat | ||
</button> | ||
<button onClick={() => setRightSidebar(true)} className="setting__btn" type="button"> | ||
<img src={setting} alt="msg" width={22} height={22} /> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<WarningModal | ||
description="Share Chat is not available yet" | ||
title="Coming Soon" | ||
isOpen={open} | ||
onCancel={closeModal} | ||
onOk={closeModal} | ||
icon={<WarningIcon className="w-32 h-32" />} | ||
/> | ||
</> | ||
); | ||
}; | ||
<WarningModal | ||
description="Share Chat is not available yet" | ||
title="Coming Soon" | ||
isOpen={open} | ||
onCancel={closeModal} | ||
onOk={closeModal} | ||
icon={<WarningIcon className="w-32 h-32" />} | ||
/> | ||
</> | ||
); | ||
}, | ||
); | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import icon from "../../assets/images/network.png"; | ||
|
||
const NetworkIcon = () => { | ||
return <img src={icon} style={{ height: "25px" }} />; | ||
return <img src={icon} style={{ height: "25px" }} alt="network-icon" />; | ||
}; | ||
|
||
export default NetworkIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const PetalsBanner = () => { | ||
return ( | ||
<div className="flex items-center bg-primary p-4"> | ||
<p className="z-10"> | ||
Feeling slow with the Public Network?{" "} | ||
<a | ||
href="mailto:[email protected]" | ||
target="_blank" | ||
rel="noreferrer" | ||
className="underline font-bold" | ||
> | ||
Get in Touch | ||
</a>{" "} | ||
for the Pro Plan! | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PetalsBanner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters