-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fbf61d
commit b409c2a
Showing
11 changed files
with
92 additions
and
16 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
11 changes: 11 additions & 0 deletions
11
ui/src/components/General/HelpIcon/components/Help/index.tsx
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,11 @@ | ||
import React from "react"; | ||
|
||
interface indexProps { | ||
text: string; | ||
} | ||
|
||
const Help: React.FC<indexProps> = ({ text }) => { | ||
return <h1>{text}</h1>; | ||
}; | ||
|
||
export default Help; |
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,41 @@ | ||
import React, { useState } from "react"; | ||
import { Button, Modal } from "antd"; | ||
import Icon from "components/General/Icon"; | ||
import Help from "./components/Help"; | ||
|
||
const HelpIcon: React.FC<{ helpText: string }> = ({ helpText }) => { | ||
const [isModalOpen, setIsModalOpen] = useState(false); | ||
|
||
const showModal = () => { | ||
setIsModalOpen(true); | ||
}; | ||
|
||
const closeModal = () => { | ||
setIsModalOpen(false); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Button | ||
size="small" | ||
key="Github" | ||
type="default" | ||
shape="circle" | ||
icon={<Icon name="Info" size={15} />} | ||
onClick={showModal} | ||
/> | ||
<Modal | ||
title="Help" | ||
open={isModalOpen} | ||
footer={null} | ||
keyboard={true} | ||
maskClosable={true} | ||
onCancel={closeModal} | ||
> | ||
<Help text={helpText} /> | ||
</Modal> | ||
</> | ||
); | ||
}; | ||
|
||
export default HelpIcon; |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,9 @@ | ||
import { routesById } from "pages/Routes/utils/constant"; | ||
|
||
const PAGES = ["About", "Feedback", "Newsfeed"]; | ||
|
||
const HELP = { | ||
[routesById.colorpicker.id]: "colorpicker", | ||
[routesById.shadesandtints.id]: "shadesandtints", | ||
}; | ||
export { PAGES, HELP }; |
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,17 @@ | ||
import { routes } from "pages/Routes/utils/constant"; | ||
import { useLocation } from "react-router-dom"; | ||
import { HELP } from "./constants"; | ||
|
||
const usePageTitle = () => { | ||
const { pathname } = useLocation(); | ||
const page = routes.find((route) => route.path === pathname) || { | ||
title: "Page Not Found", | ||
description: "", | ||
id: "", | ||
}; | ||
|
||
const { title, description, id } = page; | ||
return [title, description, HELP[id] || ""]; | ||
}; | ||
|
||
export default usePageTitle; |
File renamed without changes.
14 changes: 11 additions & 3 deletions
14
ui/src/components/Hoc/withPageTitle.tsx → ...nents/Hoc/withPageTitle/withPageTitle.tsx
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
File renamed without changes.
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